We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 036ea63 + 117c793 commit 2ff78cdCopy full SHA for 2ff78cd
crates/rust-analyzer/src/main_loop.rs
@@ -503,7 +503,13 @@ impl GlobalState {
503
})?
504
.on::<lsp_types::notification::DidChangeTextDocument>(|this, params| {
505
if let Ok(path) = from_proto::vfs_path(¶ms.text_document.uri) {
506
- let doc = this.mem_docs.get_mut(&path).unwrap();
+ let doc = match this.mem_docs.get_mut(&path) {
507
+ Some(doc) => doc,
508
+ None => {
509
+ log::error!("expected DidChangeTextDocument: {}", path);
510
+ return Ok(());
511
+ }
512
+ };
513
let vfs = &mut this.vfs.write().0;
514
let file_id = vfs.file_id(&path).unwrap();
515
let mut text = String::from_utf8(vfs.file_contents(file_id).to_vec()).unwrap();
0 commit comments