zzarchive-VisualFSharpPowerTools
zzarchive-VisualFSharpPowerTools copied to clipboard
[Find all references] It considers nested functions / APs as public
let f x =
let (|PA|_|) x = Some x
x
- Execute "Find all refs" on '(|PA|_|)`
- It searches in current and all dependent projects
As it should work: it searches inside current file only.
I've investigated the issue and it's turned out it's impossible to determine whether an active pattern is defined on module level or inside a function/method. When user launches Find all refs on a active pattern, type of the Symbol is FSharpActivePatternCase which does not have any information in which scope/context it's defined.
Could it be done via .Group.EnclosingEntity? Then one can check the kind of entity it is (module or function, etc.) or check accessibility of the enclosing entity.
Yeah, I also thought so, but EnclosingEntity is null :(
...for a local PA. will check if it exists for module level ones.
Checked it - no, EncrosingEntity is null even for module level PAs :(
The situation sounds familiar :). I think it might work for APs at declarations but not at call sites, which is not adequate.