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))
This commit is contained in:
Kirill Bulatov 2024-01-28 23:46:10 +02:00 committed by GitHub
parent 444f918e51
commit 7767062c09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {