diff options
author | kjeremy <[email protected]> | 2020-11-16 20:10:13 +0000 |
---|---|---|
committer | kjeremy <[email protected]> | 2020-11-16 20:10:13 +0000 |
commit | 233fdb12cee6aa160579cfded171fa4c2f82b29c (patch) | |
tree | e8a71e22de514f268501b62694aeb0343f355eb8 /crates/rust-analyzer/src/main_loop.rs | |
parent | 0a658c4a973d934d622957a6fb03916271496385 (diff) |
Latest LSP 3.16 protocol
Pulls in https://github.com/gluon-lang/lsp-types/pull/186
Diffstat (limited to 'crates/rust-analyzer/src/main_loop.rs')
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 68a53bbcb..6ea08adce 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -368,7 +368,7 @@ impl GlobalState { | |||
368 | let url = file_id_to_url(&self.vfs.read().0, file_id); | 368 | let url = file_id_to_url(&self.vfs.read().0, file_id); |
369 | let diagnostics = self.diagnostics.diagnostics_for(file_id).cloned().collect(); | 369 | let diagnostics = self.diagnostics.diagnostics_for(file_id).cloned().collect(); |
370 | let version = from_proto::vfs_path(&url) | 370 | let version = from_proto::vfs_path(&url) |
371 | .map(|path| self.mem_docs.get(&path)?.version) | 371 | .map(|path| self.mem_docs.get(&path).map(|it| it.version)) |
372 | .unwrap_or_default(); | 372 | .unwrap_or_default(); |
373 | 373 | ||
374 | self.send_notification::<lsp_types::notification::PublishDiagnostics>( | 374 | self.send_notification::<lsp_types::notification::PublishDiagnostics>( |
@@ -521,7 +521,7 @@ impl GlobalState { | |||
521 | let mut version = None; | 521 | let mut version = None; |
522 | if let Ok(path) = from_proto::vfs_path(¶ms.text_document.uri) { | 522 | if let Ok(path) = from_proto::vfs_path(¶ms.text_document.uri) { |
523 | match this.mem_docs.remove(&path) { | 523 | match this.mem_docs.remove(&path) { |
524 | Some(doc) => version = doc.version, | 524 | Some(doc) => version = Some(doc.version), |
525 | None => log::error!("orphan DidCloseTextDocument: {}", path), | 525 | None => log::error!("orphan DidCloseTextDocument: {}", path), |
526 | } | 526 | } |
527 | 527 | ||