Symbol.IsPrivateToFile
when symbol is not in signature file
#14274
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.
This updates
Symbol.IsPrivateToFile
forFSharpMemberOrFunctionOrValue
to betrue
when it's defined in a file that has a backing signature file but the symbol itself is not in the signature file - therefore cannot be used outside its file.This affects 2 things:
Renaming
This makes renaming such symbol fast because we don't have to look at all the other files in the solution to perform the rename. (At least in VS where we look at this value, other editors might do something different.)
Unused detection
If such symbol is unused it will be correctly marked as unused, where previously it wouldn't be. Because of this we might need to put this under a feature flag (?)
The PR also contains updates to
SyntheticProject
generation to make it more convenient to use.