diff options
author | Pascal Kuthe | 2023-03-12 00:01:15 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2023-03-16 06:45:49 +0000 |
commit | b6a4927f00cba3d55a6bad93bfd93346a876ca74 (patch) | |
tree | d1879c38e9a79c7ad31930bf4356e1590c47ce2e /helix-term/src/application.rs | |
parent | 3c9d5d02153ca2d81e2780e1f6daeefc40de2706 (diff) |
discard outdated workspace edits recived from the LS
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r-- | helix-term/src/application.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 8803792a..95faa01b 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -999,16 +999,19 @@ impl Application { Ok(serde_json::Value::Null) } Ok(MethodCall::ApplyWorkspaceEdit(params)) => { - apply_workspace_edit( + let res = apply_workspace_edit( &mut self.editor, helix_lsp::OffsetEncoding::Utf8, ¶ms.edit, ); Ok(json!(lsp::ApplyWorkspaceEditResponse { - applied: true, - failure_reason: None, - failed_change: None, + applied: res.is_ok(), + failure_reason: res.as_ref().err().map(|err| err.kind.to_string()), + failed_change: res + .as_ref() + .err() + .map(|err| err.failed_change_idx as u32), })) } Ok(MethodCall::WorkspaceFolders) => { |