Skip to content

Provide FSharpEntity.EnclosingEntity #830

@vasily-kirichenko

Description

@vasily-kirichenko

In dotnet/fsharp#3803 I do the following:

  • get an open declaration (which is now available as a property in FSharpFileCheckResults and presented as FSharpEntity [])
  • check if any of symbols defined in each of the modules / namespaces above is used in the scope this particular open declaration is open

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, on TypeChecker.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 have EnclosingEntity (that is, modules for my purpose). I need this property for FSharpEntity too.

This approach is indeed a lot faster. Ignoring FSharpEntity and checking only vals and functions via EnclosingEntity processes TypeChecker.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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions