diff options
author | Blaž Hrastnik | 2021-03-16 07:13:41 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-03-16 07:13:41 +0000 |
commit | eca2a73ad0e829dbd83da8f42a8a2bd5c17bbf75 (patch) | |
tree | 8e3048121e58f0e475245383b0015d40aee202e9 /helix-view | |
parent | 143cfe13e05b17840a9f2c69417ed98bc3b8cb0e (diff) |
lsp: Pass through language_id on didOpenTextDocument.
Diffstat (limited to 'helix-view')
-rw-r--r-- | helix-view/src/editor.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs index f79eadad..0dd0592c 100644 --- a/helix-view/src/editor.rs +++ b/helix-view/src/editor.rs @@ -46,10 +46,17 @@ impl Editor { if let Some(language_server) = language_server { doc.set_language_server(Some(language_server.clone())); + let language_id = doc + .language() + .and_then(|s| s.split(".").last()) // source.rust + .map(ToOwned::to_owned) + .unwrap_or_default(); + smol::block_on(language_server.text_document_did_open( doc.url().unwrap(), doc.version(), doc.text(), + language_id, )) .unwrap(); } |