-
Notifications
You must be signed in to change notification settings - Fork 123
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
Provide FSharpEntity.EnclosingEntity #830
Comments
Yes, it's not there because of a bit of a flaw in the TAST. I've put it on my TODO list to try to root this problem out. We will need it for other reasons too |
Thanks a lot! |
@auduchinok I managed to improve the performance of unused opens dotnet/fsharp#4497 without implementing this. I'd still like to get it implemented though, it would make things simpler and faster |
@dsyme I've checked the new unused opens implementation and it's indeed works much faster on an average solution/files, however getting children of something like I'm looking into opening a PR with usage of DeclaredEntity, but will try to fix dotnet/fsharp#4658 first. |
In dotnet/fsharp#3803 I do the following:
FSharpFileCheckResults
and presented asFSharpEntity []
)Currently I call
FSharpEntity.MembersFunctionsAndValues
for each namespace/module and it's the bottleneck - on middle sized files the analyzer takes several seconds to finish, onTypeChecker.fs
it takes ~2 minutes, which is too slow.So I'm trying to use different approach: get enclosing entity of each symbol uses and check if it corresponds to a module/ns from open declarations, which eliminates calling
MembersFunctionsAndValues
entirely. Unfortunately, only values, functions and members haveEnclosingEntity
(that is, modules for my purpose). I need this property forFSharpEntity
too.This approach is indeed a lot faster. Ignoring
FSharpEntity
and checking only vals and functions viaEnclosingEntity
processesTypeChecker.fs
in 4 seconds, smaller files in tens of milliseconds.I tried to add this here vasily-kirichenko/visualfsharp@39173f6, but I've completely lost.
EnclosingEntity
should contain proper value for both F# and IL types and modules and namespaces (None
- for root namespaces).@dsyme could you please suggest a proper way to add this functionality?
The text was updated successfully, but these errors were encountered: