Add entity.DeclaringEntity to F# Compiler Service #4633
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implements FCS feature request fsharp/fsharp-compiler-docs#830
This has been requested by @vasily-kirichenko (Visual F# Tools), @auduchinok (Jet Brains Rider) and @nosami (VS for Mac/F# Roslyn bridge)
Feature description
There are many situations where users of FCS symbols require a DeclaringEntity property on an FSharpEntity, e.g. for modules, or types, nested in other modules or types.
This implements this. The implementation requires plumbing through the "partially inferred assembly contents", which stem from CompileOps.fs.
PR Notes
I've renamed a number of things along the way as I needed to do it to understand/clarify/document some of this old code, e.g.
cenv
-->SymbolEnv
inSymbols.fs
WithNoShortPrimaryAssembly
inil.fs
/il.fsi
. We never need this version of thingsTypeCheckOneInputEventually
to pass the partial inferred assembly contents back directly, and thus reduce the number oftcs
tracking fields by oneSymbols.fs