Skip to content
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

Implement support for textDocument/linkedEditingRange #3166

Merged
merged 1 commit into from
Oct 23, 2021

Conversation

yyoncho
Copy link
Member

@yyoncho yyoncho commented Oct 22, 2021

Fixes #2449

@github-actions github-actions bot added the client One or more of lsp-mode language clients label Oct 22, 2021
@ericdallo
Copy link
Member

Awesome! do you have any gif or anything of some server that already implements it?

@yyoncho
Copy link
Member Author

yyoncho commented Oct 22, 2021

xmlls implements it, I will post gif later. IMHO it will be more useful for scenarios like this eclipse-jdtls/eclipse.jdt.ls#1919

@ericdallo
Copy link
Member

Cool, I may implement this on clojure-lsp, I just want a little spolier on the UX first :p

@yyoncho
Copy link
Member Author

yyoncho commented Oct 22, 2021

ranges

IMHO it will look very nice for clj locals, much better experience than rename in a box. For xml we already have the tools in emacs for what you see in the gif, so it is not that special.

@ericdallo
Copy link
Member

I always wanted that @yyoncho, I'll for sure implement that on clojure-lsp :) thank you!

@ericdallo
Copy link
Member

just implemented on clojure-lsp, tested and worked perfectly @yyoncho :)
lsp-linked-editing-ranges

lsp-iedit.el Outdated
Comment on lines 91 to 94
(->> (lsp--text-document-position-params)
(lsp-request "textDocument/linkedEditingRange")
(lsp:linked-editing-ranges-ranges)
(lsp-iedit--on-ranges)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should show some feedback to user when server returns null? For example for clojure-lsp, if the element is referenced in another file, clojure-lsp returns null

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that makes sense. I though that server is supposed to throw an error(which by the way will lead to a better UE because the user will know why it does not work).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericdallo
Copy link
Member

ericdallo commented Oct 23, 2021

FYI, the function doesn't entirely work on doom-emacs: hlissner/evil-multiedit#39 (comment) because of iedit-lib-start not be available on doom-emacs yet.

@yyoncho
Copy link
Member Author

yyoncho commented Oct 23, 2021

FYI, the function doesn't entirely work on doom-emacs: hlissner/evil-multiedit#39 (comment) because of iedit-lib-start not be available on doom-emacs yet.

thank you for that - now linked editing feature on lsp-mode has some value.

@yyoncho yyoncho merged commit d72c3fe into emacs-lsp:master Oct 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client One or more of lsp-mode language clients documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[3.16] Support Linked Editing Range
2 participants