aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-12-25 08:20:09 +0000
committerBlaž Hrastnik2020-12-25 08:20:09 +0000
commit2ab069bb3fc815394cccca50378b62932f3146f5 (patch)
treeac0b3d13198d0a9c5b49a11d3c1f2555a30418b7 /helix-term/src/commands.rs
parentcd16df19c1f951e1ef0c560ae5e084b18bd2c713 (diff)
lsp: Work on syncing the state with the language server.
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 862cf312..59490864 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -841,9 +841,13 @@ pub fn completion(cx: &mut Context) {
use std::time::Duration;
// TODO: blocking here is not ideal
+ let pos = helix_lsp::util::pos_to_lsp_pos(
+ &cx.view.doc.text().slice(..),
+ cx.view.doc.selection().cursor(),
+ );
let res = smol::block_on(
language_server
- .completion(&cx.view.doc)
+ .completion(cx.view.doc.identifier(), pos)
.timeout(Duration::from_secs(2)),
)
.expect("completion failed!")