diff options
author | Blaž Hrastnik | 2021-05-06 06:08:59 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-05-06 06:08:59 +0000 |
commit | d00414f81a49501277642868c2cf76eefeb0db6b (patch) | |
tree | 8a69627dec819bab1e8f7a7db78227c52bb5f4a8 /helix-view/src | |
parent | 1ad0581ddd2d1fc6eb8b96b495eb4e546d4bdd28 (diff) |
Start moving more LSP calls into callbacks/futures without capturing self
Diffstat (limited to 'helix-view/src')
-rw-r--r-- | helix-view/src/editor.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index 014364e0..44014e83 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -131,14 +131,12 @@ impl Editor { .map(ToOwned::to_owned) .unwrap_or_default(); - let rt = tokio::runtime::Handle::current(); - rt.block_on(language_server.text_document_did_open( + tokio::spawn(language_server.text_document_did_open( doc.url().unwrap(), doc.version(), doc.text(), language_id, - )) - .unwrap(); + )); } let id = self.documents.insert(doc); @@ -162,9 +160,7 @@ impl Editor { .and_then(|language| language_servers.get(language)); if let Some(language_server) = language_server { - let rt = tokio::runtime::Handle::current(); - rt.block_on(language_server.text_document_did_close(doc.identifier())) - .unwrap(); + tokio::spawn(language_server.text_document_did_close(doc.identifier())); } // remove selection |