Skip to content

Commit

Permalink
Fix bug with positional encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
MDeiml committed Feb 27, 2023
1 parent 98a3d46 commit b7cb7f3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions helix-term/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,14 @@ impl Application {
}
};

let offset_encoding = match self.editor.language_servers.get_by_id(server_id) {
Some(language_server) => language_server.offset_encoding(),
None => {
warn!("can't find language server with id `{}`", server_id);
return;
}
};

let reply = match call {
MethodCall::WorkDoneProgressCreate(params) => {
self.lsp_progress.create(server_id, params.token);
Expand All @@ -983,11 +991,7 @@ impl Application {
Ok(serde_json::Value::Null)
}
MethodCall::ApplyWorkspaceEdit(params) => {
apply_workspace_edit(
&mut self.editor,
helix_lsp::OffsetEncoding::Utf8,
&params.edit,
);
apply_workspace_edit(&mut self.editor, offset_encoding, &params.edit);

Ok(json!(lsp::ApplyWorkspaceEditResponse {
applied: true,
Expand Down

0 comments on commit b7cb7f3

Please sign in to comment.