Closed Vinzent03 closed 2 weeks ago
@Vinzent03 Thank you for your contribution! I just pushed a commit that changes from textDocument/references
to textDocument/documentHighlight
: https://github.com/mawkler/refjump.nvim/commit/b3f2cd76def28a58aa8b4fea5a66d506434f8951
I'm curious if textDocument/documentHighlight
has the same issue for the Dart language server. Could you please give my plugin a try with the new commit and see if you see the same issue? I'm guessing that you will, and if that's the case I'll gladly merge your PR 🙂
Ah good catch with the correct lsp method. It actually seems to be solved!
Just a small note on your implementation. I don't think that endpoint supports/needs any context like the current includeDeclaration = true
context. https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_documentHighlight So I think that can be removed.
You're absolutely right, thank you! I've removed includeDeclaration = true
in 3b52f5f2b4dc8ee03d7c79d28ce545c9cf91fd9d
When using the Dart lsp and querying the references, the declaration line is the last item in the references list and thus using the
[r
motion always goes to the declaration line. By ensuring the list is actually sorted by line, the issue is fixed.