feat: highlight / select symbol under cursor using LSP textDocument/documentHighlight - #2738
Conversation
|
Changes made, thanks for the review ! |
|
As for the keybind, wouldn't |
|
Now that you mention it, indeed it does look like a match command. I chose 'h' for highlight because the call to LSP is |
|
Maybe |
|
I don't think changing |
|
@the-mikedavis any opinions on keymaps here?
I think this is a smart way of doing it, especially since it makes it easy to rename all occurrences (if the lsp doesn't support the rename code action) |
|
I didn't mind |
|
Okay, should we go back to |
|
Yeah let's go for |
c615788 to
2c205cc
Compare
|
Alright, done ! |
2c205cc to
33461ba
Compare
the-mikedavis
left a comment
There was a problem hiding this comment.
This is awesome, thanks for working on it!
Hi !
This PR implements the LSP textDocument/documentHighlight request. The command asks the LSP server for the ranges of references to current symbol, and select them (using multiple cursors).
I initially just wanted to have these symbols highlighted (like in nvim or vscode), but using multi-cursors is more convenient because the user can navigate between the references using
(and), and also because it reuses already existing components :I have set the
Space + h(for highlight) mapping to use this.Have a good day !