-
Notifications
You must be signed in to change notification settings - Fork 646
Code Lens issues #977
Comments
Thanks for reporting @hungys
Are you on 0.6.60 or 0.6.61? There was a perf issue we found in 0.6.60 which we fixed in 0.6.61. The issue was that the cache for references in codelens was being invalidated every time and so every scroll would re-calculate references again How is the performance when you run "Find all references" from the context menu? We use
I'd love to get a repro of this. Current running theory is that for some reason finding references fails in which case 0 is the default value shown. May be I can change it to "Couldn't find references" so that it is differentiated from the real case of 0 references.
#962 is tracking this one and we will have support for this in the next update |
I'm on VS Code 1.12.1 with Go extension 0.6.61. (macOS 10.12.4) For the Code Lens, will the cache be invalidated when re-opening or switching between different files? But the fact is that every time I open a file (75 LoC, and the whole project contains ~2000 LoC), it takes about 5 seconds to let the reference count show up. For "Find all references", it is also a little bit slow on my project, and I think it's also not cached?
I cannot reproduce it today, but I think it's a good idea to differentiate these two cases :)
Oh sorry, I didn't notice that. PS. The repo I tested with: https://github.com/hungys/swimring |
The cache is invalidated when there is a change in document or when you switch documents. Its how the VS Code Api works. The first case makes sense, but the second doesn't. "Find all references" in itself is never cached. If that itself is slow, then am afraid, there is nothing much we can do for the codelens. Unless of course there is a better solution to find references other than using |
@hungys The method support has been out since a month. Were you able to repro the If there is nothing else to do here, then can we close the issue? |
0 reference issue still occurs randomly. I've checked that the method support just works, but sometimes it also report 0 reference (which is incorrect). BTW, is it possible to calculate all the reference counts at once, but not wait until we scroll to them? |
Yeah they dont use this now. https://github.com/Microsoft/vscode-go#go-language-server-experimental go get -v github.com/sourcegraph/go-langserver Settings.. |
@gedw99 The use of language server is optional, we still support the previous way of doing things. Also the codelens for references doesnt use the language server.
Yes, that's possible. But finding references is expensive. If all references count were found upfront, then it would take a while for them to appear. About the In the next update, instead of |
I found a repro for the
guru is called as
and reports
|
With the ongoing work on the language server, there will be less work on getting With this in mind, I am closing this issue as there is no actionable item from the extenion's side at the moment. Once the language server has the references feature, we will enable the codelens from it instead of calling Thanks for your patience and Happy Coding! |
I really appreciated that Code Lens finally arrived for Golang, but after trying for it, I found that there are many issues.
When using it in a "not so big" project, it always takes more than 5 seconds to calculate the reference counts.
Sometimes it just shows 0 reference, but that's not the fact. This cannot be reproduced every time.
(Related issue: sometimes function declaration itself is counted as 1 reference in Find All Reference?)
For methods (member functions), it always shows 0 reference. Doesn't Code Lens support for member functions?
The text was updated successfully, but these errors were encountered: