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

Fix incorrect linkedEditingRange triggers #1364

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kantuni
Copy link

@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

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