fix: lsp: Don't send didOpen events for documents with no URL

Fixes #3683
pull/3684/head
Blaž Hrastnik 2 years ago
parent cc4b71274a
commit 44b447947c
No known key found for this signature in database
GPG Key ID: 1238B9C4AD889640

@ -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,

Loading…
Cancel
Save