Feature Request: Codelens for references
The code to find all references is already in place. It would be great to leverage that to provide codelens for references as well
find references in general is not that fast. Is this a commonly used/requested feature in vscode-go?
Its not very popular mainly due to the reason guru is slow
I assumed that the find all references from the language server is much faster than guru, so was hoping to get that feature from here
@ramya-rao-a Unfortunately the language server's find all references is generally the same performance-wise as guru.
This mostly comes from the way it is implemented in the language server and in guru, which is through Go's https://godoc.org/golang.org/x/tools/go/loader package which does all the work as far as resolving types, etc. Currently, this package doesn't support serialization or anything like that so when you run guru or the language server's find references it must basically parse and resolve types from scratch (effectively the same as recompiling your program from scratch, except not emitting the actual machine code). The package doesn't support any type of serialization, so we can't e.g. cache any of the work that has already been done in the past. This is why guru and the language server's find references is a bit slow right now.
We do have someone who is looking into improving the performance of this, though (and I'm aware of multiple other people in the Go community who are trying to solve this issue with this package). But as it is quite a hard problem to solve, I can't give an ETA / certain answer of when exactly it will be fixed.
Our find references I believe is a bit faster, due to us limiting the scope to the workspace rather than the whole of GOPATH. But that is a fact in my head from a long time ago, so I have no idea if I a remembering that correctly.
Thats good to know, thanks @slimsag