lsp: Add support for linked editing range edits (HTML tag autorenaming) (#12769)
This PR adds support for [linked editing of ranges](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_linkedEditingRange), which in short means that editing one part of a file can now change related parts in that same file. Think of automatically renaming HTML/TSX closing tags when the opening one is changed. TODO: - [x] proto changes - [x] Allow disabling linked editing ranges on a per language basis. Fixes #4535 Release Notes: - Added support for linked editing ranges LSP request. Editing opening tags in HTML/TSX files (with vtsls) performs the same edit on the closing tag as well (and vice versa). It can be turned off on a language-by-language basis with the following setting: ``` "languages": { "HTML": { "linked_edits": true }, } ``` --------- Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
parent
98659eabf1
commit
b6ea393d14
9 changed files with 574 additions and 8 deletions
|
@ -336,6 +336,8 @@ messages!(
|
|||
(RenameDevServer, Foreground),
|
||||
(OpenNewBuffer, Foreground),
|
||||
(RestartLanguageServers, Foreground),
|
||||
(LinkedEditingRange, Background),
|
||||
(LinkedEditingRangeResponse, Background)
|
||||
);
|
||||
|
||||
request_messages!(
|
||||
|
@ -376,6 +378,7 @@ request_messages!(
|
|||
(GetReferences, GetReferencesResponse),
|
||||
(GetSupermavenApiKey, GetSupermavenApiKeyResponse),
|
||||
(GetTypeDefinition, GetTypeDefinitionResponse),
|
||||
(LinkedEditingRange, LinkedEditingRangeResponse),
|
||||
(GetUsers, UsersResponse),
|
||||
(IncomingCall, Ack),
|
||||
(InlayHints, InlayHintsResponse),
|
||||
|
@ -475,6 +478,7 @@ entity_messages!(
|
|||
InlayHints,
|
||||
JoinProject,
|
||||
LeaveProject,
|
||||
LinkedEditingRange,
|
||||
MultiLspQuery,
|
||||
RestartLanguageServers,
|
||||
OnTypeFormatting,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue