-
Notifications
You must be signed in to change notification settings - Fork 847
Replace isModule with ModuleOrNamespaceKind in SynModuleOrNamespace #6027
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
Conversation
|
I updated structure tests. Despite having the following comment implicit modules ranges were returned in structure service: // do not return range for top level implicit module in scriptsChecking I also added cases for explicit module and namespace cases there. |
|
|
||
| // do not return range for top level implicit module in scripts | ||
| if isModule && not isScript then | ||
| if kind <> AnonModule then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check should probably be kind = NamedModule since we don't want to include namespaces?
I think you might be right that we should have the same behavior for anon modules in scripts and non-scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I like the PR. It makes sense that we have a |
|
It seems to be ready. |
| module MyModule = | ||
| () | ||
| """ | ||
| => [ (1, 0, 4, 0), (1, 0, 4, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this again, why are some of these ranges removed from the tests? It looks like it was giving you the range of the whole module itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's removing ranges of anon top level modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, yes that makes sense. That's just an inner module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's nice
|
Thank you |



Storing kind removes some workarounds used by FCS clients for checking whether a module is anonymous and whether a namespace is global.
Adds the following type to replace
isModule: boolfields.