mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-26 19:33:30 +04:00
completion: Use the language server bound to the document.
This commit is contained in:
parent
9132c6a591
commit
5096bdad33
@ -900,15 +900,13 @@ pub fn save(cx: &mut Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn completion(cx: &mut Context) {
|
pub fn completion(cx: &mut Context) {
|
||||||
let language_server = cx
|
|
||||||
.editor
|
|
||||||
.language_servers
|
|
||||||
.get("source.rust", &cx.executor)
|
|
||||||
.unwrap();
|
|
||||||
use log::info;
|
|
||||||
|
|
||||||
let doc = cx.doc();
|
let doc = cx.doc();
|
||||||
|
|
||||||
|
let language_server = match doc.language_server.as_ref() {
|
||||||
|
Some(language_server) => language_server,
|
||||||
|
None => return,
|
||||||
|
};
|
||||||
|
|
||||||
// TODO: blocking here is not ideal
|
// TODO: blocking here is not ideal
|
||||||
let pos = helix_lsp::util::pos_to_lsp_pos(doc.text().slice(..), doc.selection().cursor());
|
let pos = helix_lsp::util::pos_to_lsp_pos(doc.text().slice(..), doc.selection().cursor());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user