-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: highlight / select symbol under cursor using LSP textDocument/documentHighlight #2738
feat: highlight / select symbol under cursor using LSP textDocument/documentHighlight #2738
Conversation
Changes made, thanks for the review ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome, thanks for working on it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
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 !