redhat-developer / lsp4ij

LSP Client for IntelliJ
Eclipse Public License 2.0
100 stars 21 forks source link

Support for `textDocument/linkedEditingRange` #23

Open angelozerr opened 2 years ago

angelozerr commented 2 years ago

It should be nice to support textDocument/linkedEditingRange to support for instance https://github.com/redhat-developer/vscode-quarkus/blob/master/docs/qute/TemplateSupport.md#linked-editing

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

angelozerr commented 6 months ago

@fbricon I think linkedediting range should be used when user do a rename to provide inline rename.

When user process a rename, we should try to consume linked editing range at first (if language server have the proper capability) and if cannot we consume prepare rename.

What do you think about this idea?

fbricon commented 6 months ago

those 2 are triggered differently. So it's not a question of trying one before the other. We should not try to add a fallback mechanism IMO

angelozerr commented 6 months ago

vscode activate linked editing range on each cursor changes.

We could do that, but it means that we need to implement a debounce mechanism to avoid consuming linked editing range too many and have horrible performance.

For me linked editing range is the same thing as inline rename.