Skip to content

Fix incorrect linkedEditingRange triggers #1364

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

Merged
merged 1 commit into from
Mar 29, 2025

Conversation

kantuni
Copy link
Contributor

@kantuni kantuni commented Feb 28, 2025

This fixes #1311.

  1. Changes to either (1) the line before the type annotation or (2) the line between the type annotation and value declaration no longer trigger incorrect actions.
  2. The new implementation also works for multiline type annotations.

The only problem I've encountered so far is that when I type a bit faster, the two lines go out of sync. I'm assuming this is a limitation of the LSP, but I might be mistaken.

P.S. I believe there is a way to make linked editing even better. Instead of just linking the type annotation and the value declaration, we could use references to modify all the instances of the identifier in the document at once. This might be slow, though. WDYT?

@razzeee
Copy link
Member

razzeee commented Feb 28, 2025

This might be slow, though. WDYT?

Should be fast enough IMO.

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_linkedEditingRange

also makes it sound, like that should be expected - I usually end up using rename in vscode, so I'm unsure, what's expected here/what other lsps do

@razzeee razzeee merged commit c2bfa43 into elm-tooling:main Mar 29, 2025
15 of 16 checks passed
SomeoneToIgnore pushed a commit to zed-industries/zed that referenced this pull request Apr 24, 2025
The known issue with `linked_edits` seems to be fixed in this PR:
elm-tooling/elm-language-server#1364. This PR
removes the section from Zeds documentation to avoid confusion.

Release Notes:

- Remove known issues section from Elm documentation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

linkedEditing mode incorrectly triggered
2 participants