Closed rossoha closed 5 years ago
👍 on this. @olafurpg proposed exactly the same thing in an offline discussion some time ago.
We can't properly fall back to a different request (i.e. convert textDocument/definition
to textDocument/references
) because LSP doesn't have a mechanism to do it.
However, it should be possible to implement this by responding to the textDocument/definition
request with an array of Location
which represent the references instead of the actual definition.
Since this is a bit of a stretch over the LSP spec, my only concern would be to make sure editors handle the array of Location
correctly (e.g., make sure no editors take shortcuts like showing the first result or something like that)
Thank you for reporting! @tanishiking, @tgodzik and me looked into implementing this feature at the Spree in Lausanne today and we should be able to support this feature in the near future :)
Is your feature request related to a problem? Please describe. It's not related to a problem.
Describe the solution you'd like Simply feature is a "fallback" for "go to" in cases when you click root definition itself. Instead of ignoring this request (cause it's a definition but not a reference), it would be nice to show a list of usages/references ("peek references" in VSCode is an example).
Describe alternatives you've considered no, so far
Additional context![](https://www.jetbrains.com/help/img/idea/2019.1/show_usages.png)
Search terms: "find usages", "show usages", "peek references"