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

Fixes #3683
This commit is contained in:
Blaž Hrastnik 2022-09-04 17:28:17 +09:00
parent cc4b71274a
commit 44b447947c
No known key found for this signature in database
GPG key ID: 1238B9C4AD889640

View file

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