From 44b447947c810b7fc6a13383b4379f0f48501c17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Hrastnik?= Date: Sun, 4 Sep 2022 17:28:17 +0900 Subject: [PATCH] fix: lsp: Don't send didOpen events for documents with no URL Fixes #3683 --- helix-term/src/application.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 1461c68834fe..9653b3733b59 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -505,8 +505,13 @@ impl Application { let language_id = doc.language_id().map(ToOwned::to_owned).unwrap_or_default(); + let url = match doc.url() { + Some(url) => url, + None => continue, // skip documents with no path + }; + tokio::spawn(language_server.text_document_did_open( - doc.url().unwrap(), + url, doc.version(), doc.text(), language_id,