summaryrefslogtreecommitdiff
path: root/helix-term/src/application.rs
diff options
context:
space:
mode:
authorPascal Kuthe2023-03-12 00:01:15 +0000
committerBlaž Hrastnik2023-03-16 06:45:49 +0000
commitb6a4927f00cba3d55a6bad93bfd93346a876ca74 (patch)
treed1879c38e9a79c7ad31930bf4356e1590c47ce2e /helix-term/src/application.rs
parent3c9d5d02153ca2d81e2780e1f6daeefc40de2706 (diff)
discard outdated workspace edits recived from the LS
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r--helix-term/src/application.rs11
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,
&params.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) => {