castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
425 stars 23 forks source link

Go to definition opens peek #114

Closed qortex closed 5 years ago

qortex commented 5 years ago

When I use "Go To Definition" on a class definition, it opens Peek because it finds 2 defintions of the class. But the two definitions actually are the same (located at the same line).

So the expected behavior is that it should find only one and go to definiton straight away.

Is there something I miss here? Example below:

image

castwide commented 5 years ago

I believe this was related to a bug in the gem that caused irregular map updates under some circumstances, especially when an external process changed the project's files. It should be fixed in gem version 0.32.2, which was released today. If you still experience the problem, please let me know.

qortex commented 5 years ago

Thanks for the response! Ah damn, I updated to 0.32.2 but still experience the issue. Is there any cache I should remove from the old version before trying again?

castwide commented 5 years ago

It shouldn't be a cache issue.

I haven't been able to reproduce the error. Here's a couple things that can help troubleshoot:

  1. Can you confirm that both definitions go to the same line? It's possible that the second one points to a different location that reopens the IdOperator class.

  2. Can you provide a minimal reproducible example?

yyyy7 commented 5 years ago

I got the same issue.

castwide commented 5 years ago

I was finally able to reproduce it by having Go To Definition enabled in two extensions. In my case, it was vscode-solargraph and vscode-ruby. Setting ruby.intellisense to false fixes the issue.

If you'd rather use vscode-ruby's version, you can set ruby.intellisense to rubyLocate and solargraph.definitions to false.

qortex commented 5 years ago

Thanks, great! Indeed, solves the issue for me. So I close this issue.

Feel free to comment below if you still have trouble though of course!