You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Poor GetAllUsesOfAllSymbolsInFile results (on bigger files?) #6583
After we've got chunking in #6089 I get truncated results on bigger files. E.g. GetAllUsesOfAllSymbolsInFile for TypeChecker.fs only returns symbol uses up to ~3400 line. Reverting this PR locally fixes it for me.
@auduchinok I tried using document highlights in that file today (and others), since that relies on that specific API. It was able to highlight all usages of what I needed, though it could be that what it "found" was small enough in scope that it didn't matter. Looking at the code I can't see why this would happen though, since the code processes each chunk...
@cartermp I've just tried to find usages of SynExpr type in Visual Studio 2019 (16.0.3). Results indeed missed lots of the references in TypeChecker.fs. In addition to that, highlighting usages of the symbol under caret stops working at some point when moving caret down in that file. It behaves in a somewhat similar way to what I get in Rider without reverting #6089, with the difference is it at least adds the semantic highlighting beyond the point where some features stop working..
Well, I did "Find all references" on "SynExpr" and got plenty of results all the way through TypeChcker.fs. The main problem is a large number of duplicates:
changed the title [-]GetAllUsesOfAllSymbolsInFile missing symbol uses on bigger files[/-][+]Poor GetAllUsesOfAllSymbolsInFile results (on bigger files?)[/+]on Sep 1, 2020
Duplicate data shouldn't shown anymore if you are using the latest dogfood (i.e., what will ship in 16.8). So if that's still the case in dogfood then there's a separate issue at play.
This one shouldn't be affected by Find Refs, since Find Refs doesn't call GetAllUsesOfAllSymbolsInFile in either the "symbol is declared in this file" or "symbol is declared elsewhere" cases in VS. Perhaps it's used by Rider?
The stable repro was bigger files like TypeChecker.fs and we still have #6089 reverted, otherwise it reproduces for us in Rider. I can try looking at it again when updating our repo for the next rider release. Though, we don't yet use the FCS symbols cache, so now there's even more difference compared to what VS does.
@cartermp@dsyme Does symbol usages under caret highlighting work reliably for you in TypeChecker.fs when invoked somewhere down the file (e.g. near the file end)? It's where I've seen it working bad in Visual Studio, as recorded in the gif above.
Activity
cartermp commentedon Apr 23, 2019
@auduchinok I tried using document highlights in that file today (and others), since that relies on that specific API. It was able to highlight all usages of what I needed, though it could be that what it "found" was small enough in scope that it didn't matter. Looking at the code I can't see why this would happen though, since the code processes each chunk...
auduchinok commentedon May 14, 2019
@cartermp I've just tried to find usages of
SynExprtype in Visual Studio 2019 (16.0.3). Results indeed missed lots of the references in TypeChecker.fs. In addition to that, highlighting usages of the symbol under caret stops working at some point when moving caret down in that file. It behaves in a somewhat similar way to what I get in Rider without reverting #6089, with the difference is it at least adds the semantic highlighting beyond the point where some features stop working..Rider (2019.1 dev):

Visual Studio 2019 (16.0.3)

cartermp commentedon Dec 17, 2019
@TIHan this might be a good one to look at while you're digging into the
TcSymbolUseDataissuesdsyme commentedon Sep 1, 2020
@auduchinok Do you know the status of this? Or a specific repro?
cartermp commentedon Sep 1, 2020
I've noticed this from time to time when selecting a symbol in Typechecker.fs. No other files though.
dsyme commentedon Sep 1, 2020
Well, I did "Find all references" on "SynExpr" and got plenty of results all the way through TypeChcker.fs. The main problem is a large number of duplicates:
[-]GetAllUsesOfAllSymbolsInFile missing symbol uses on bigger files[/-][+]Poor GetAllUsesOfAllSymbolsInFile results (on bigger files?)[/+]cartermp commentedon Sep 1, 2020
Duplicate data shouldn't shown anymore if you are using the latest dogfood (i.e., what will ship in 16.8). So if that's still the case in dogfood then there's a separate issue at play.
This one shouldn't be affected by Find Refs, since Find Refs doesn't call GetAllUsesOfAllSymbolsInFile in either the "symbol is declared in this file" or "symbol is declared elsewhere" cases in VS. Perhaps it's used by Rider?
Either way there is certainly an issue here.
auduchinok commentedon Sep 2, 2020
The stable repro was bigger files like
TypeChecker.fsand we still have #6089 reverted, otherwise it reproduces for us in Rider. I can try looking at it again when updating our repo for the next rider release. Though, we don't yet use the FCS symbols cache, so now there's even more difference compared to what VS does.auduchinok commentedon Sep 2, 2020
@cartermp @dsyme Does symbol usages under caret highlighting work reliably for you in TypeChecker.fs when invoked somewhere down the file (e.g. near the file end)? It's where I've seen it working bad in Visual Studio, as recorded in the gif above.
cartermp commentedon Sep 2, 2020
I have noticed symbol highlighting not necessarily getting kicked off in TypeChecker.fs. But it's hard to reproduce.
dsyme commentedon Apr 6, 2022
I'm closing this as we haven't seen this problem reported separately and I'm pretty sure it was either a performance or point-in-time problem.
dsyme commentedon Sep 26, 2022
@auduchinok your initial analysis was spot on - the chunking PR was just broken for large files. Presumably this caused the duplicates I saw as well.
Really annoying we let this slip for so long, especially since you'd reported it.