From 7767062c094db07a04a452bcb0bc25ef0dec1e49 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 28 Jan 2024 23:46:10 +0200 Subject: [PATCH] Add missing workspace edit capabilities (#6950) Closes https://github.com/zed-industries/zed/issues/6916 Specification: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspaceEdit Adds a safe minimum of the capabilities that Zed supports already, allowing rust-analyzer to send file edits on rename. Release Notes: - Fixed rust module rename from editor not renaming the FS entries ([6916](https://github.com/zed-industries/zed/issues/6916)) --- crates/lsp/src/lsp.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/lsp/src/lsp.rs b/crates/lsp/src/lsp.rs index bf7c3e7911..65da2bc7dc 100644 --- a/crates/lsp/src/lsp.rs +++ b/crates/lsp/src/lsp.rs @@ -479,6 +479,15 @@ impl LanguageServer { diagnostic: Some(DiagnosticWorkspaceClientCapabilities { refresh_support: None, }), + workspace_edit: Some(WorkspaceEditClientCapabilities { + resource_operations: Some(vec![ + ResourceOperationKind::Create, + ResourceOperationKind::Rename, + ResourceOperationKind::Delete, + ]), + document_changes: Some(true), + ..WorkspaceEditClientCapabilities::default() + }), ..Default::default() }), text_document: Some(TextDocumentClientCapabilities {