-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected Access form control supertype names #5881
Comments
I think |
Thinking again about the original issue this bug is a follow up to, I guess the real problem is that Access forms have rather lax naming restrictions. Is whitespace allowed in the name or special characters? If yes, what does the specific supertype look like? |
Addendum: The controls has different rules than forms. I did not do a full analysis but for quick reference:
Note that in control's case, all characters are replaced with |
Looking at the issue itself, it seems to break down in the Addendum: It appears that the hidden interfaces (e.g. I also wonder about the fact that the hidden interface are reported to be in another project (see screenshot in post 4 above where you can see the filepath to the accdb is used as a project rather than the actual VBA project's name) is causing problems. |
From a test, I could determine that if a declaration was created for the hidden interface, then bracketing the supertype name would enable the resolution to succeed. In my test, I used
Thoughts? |
Adding a new DeclarationType would work, but IIRC that flag enum is very near capacity already (there's only so many bits to offset in an Int32). If hidden interfaces give us access to members we couldn't resolve before, then I'm all for it! Not giving it the ClassModule flag should effectively mitigate risks of regression, but Max would likely have deeper insights on that matter. In my mind the decision hinges on what we're looking at - if having these types in the finder grants Rubberduck a better, more complete view of user modules, then I think it's worth having them in the resolver pipeline. OTOH if the idea is just to get the resolver to not choke and explode under certain circumstances, then the less-disruptive option 3 would be it. |
First of all, the unexpected supertype names no longer make the resolver explode. It simply issues a warning and does not add the supertype. Option 2 is out of the question. The entire point of the Anyway, we really need the parser here because we can have multi-part typenames like I think a proper solution to deal with interfaces in the typelib, but hidden by the VBE, is none of the options provided. Rather, I think what we should do here is the following, if we really want to resolve the hidden interfaces. |
Adding a new type shouldn't be a problem because the The hidden interface is the one that provides us with definitions of controls on a form. We would need to use that hidden interface to additionally determine whether a procedure declared on a form is an event handler. However, from a user's POV, we want to show it in the toolbar as
Unfortunately this would work out poorly. As an example, if I rename a control on the form, there is no change in VBE's POV but the hidden interface would be now different and that needs to be refreshed. I would suggest that for simplicity, the type lib information should never be cached especially for the current project. Otherwise, the resolver will not be able to reliably give out current information about a document module.
The issue is that currently the hidden interfaces don't even get declared so adding brackets wouldn't have helped. At least, it would only help resolving the non-hidden interface to the document class module. We can provide a trivial fix to bracket the interface name which would reduce the warnings and allow resolution of forms with spaces in their name to their public interfaces. |
Just to take some notes based on the PR #5888 that may be relevant for full resolution of hidden interfaces. The supertypes are also provided from the
In all those cases, the line will be highlighted red and be a compiler error. VBA will try to strip away the brackets. Thus it is impossible to Incidentally, that made me wonder if the semantics for the
The extension module is defined in MS-VBAL 4.2.1. The term
I'm still unclear whether Excel qualifies as a "open host module" because it's not clear what qualifies as an "agent". Still, given that an extension module are supposed to have the same name as extensible module, it does implies that it would not implement a hidden interface, which is the case. In contrast, Access's document module are probably not extension modules since they simply implements Access' objects and provide their own hidden interfaces. This would explain why Access' document modules can contain |
Rubberduck version information
Version 2.5.2.5994
OS: Microsoft Windows NT 10.0.18363.0, x64
Host Product: Microsoft Office x64
Host Version: 16.0.13801.20960
Host Executable: MSACCESS.EXE
Description
As observed in issue #5782, the supertypes of (some) Access form controls we read in end in a dot, which previously failed the entire resolution. This probably indicates that the supertypes are not read correctly. The final part of the type seems to be missing for some reason.
To Reproduce
TBD -> Still need to figure out under which exact circumstances this happens.
Expected behavior
Read sensible supertypes that can be resolved.
Logfile
Extract provide in the original bug.
The text was updated successfully, but these errors were encountered: