-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autocompletion is instantaneous, but go to definition is very slow #236
Comments
I've found the overall behavior to be odd; it seems Solargraph (and/or the VSC plugin) gets "clogged" when "Go to definition" is issued. I'll describe a couple of examples. Base code (extreme simplification of the original): class Runtime
# @param location [TemporaryVariable, Fisk::Operand, Integer]
# @return [void]
def jump(location)
# blah
end
# @return [Fisk::Operand]
def return_value
# blah
end
end
rt = Runtime.new
rt.jump rt.return_value First case:
Second case:
Is there any way to debug vscode-solargraph and/or solargraph, to profile how the time is spent? |
I looked into this, and the the "go to defintion" request definitely seems slower than it should be. I'll keep this on the radar and look for a solution. |
Any update on this? Seems like this is still an issue even with latest released versions. |
Hello,
I'm working on a relatively small project (8k Ruby lines, according to cloc v1.90; only a few dependent gems). I've documented all the methods in the project (the vast majority with
@return [void]
, and some with actual param/return types).With this setup, autocompletion is essentially immediate. It fully works as intended: the plugin is aware of the given instance type, and shows the accessible methods list (in turn, each method shows a window with the reference to the class+method, and the method documentation).
The problem is that the "Go to defiition", for the very same instance, is instead very slow; it generally uses 100% of the CPU for several seconds each time, making it unsuitable for usage on a laptop, besides making it hardly usable in general.
Something I've also observed is that the time taken is actually - sometimes it jumps immediately, but after jumping to a few other methods, even if nothing in the project changed, it takes again a long time. It behaves like there was a sort of "hot methods cache" that is busted after going to a few method definitions.
Is such slowness expected? It's counterintuitive to me - without knowing the internals - that autocompletion shows complete (metadata) knowledge of a given method, but actually jumping to the method is extremely slow in comparison.
===
Regarding the configuration:
The text was updated successfully, but these errors were encountered: