mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
parent
48bb4bf228
commit
117c793e80
1 changed files with 7 additions and 1 deletions
|
@ -503,7 +503,13 @@ impl GlobalState {
|
||||||
})?
|
})?
|
||||||
.on::<lsp_types::notification::DidChangeTextDocument>(|this, params| {
|
.on::<lsp_types::notification::DidChangeTextDocument>(|this, params| {
|
||||||
if let Ok(path) = from_proto::vfs_path(¶ms.text_document.uri) {
|
if let Ok(path) = from_proto::vfs_path(¶ms.text_document.uri) {
|
||||||
let doc = this.mem_docs.get_mut(&path).unwrap();
|
let doc = match this.mem_docs.get_mut(&path) {
|
||||||
|
Some(doc) => doc,
|
||||||
|
None => {
|
||||||
|
log::error!("expected DidChangeTextDocument: {}", path);
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
};
|
||||||
let vfs = &mut this.vfs.write().0;
|
let vfs = &mut this.vfs.write().0;
|
||||||
let file_id = vfs.file_id(&path).unwrap();
|
let file_id = vfs.file_id(&path).unwrap();
|
||||||
let mut text = String::from_utf8(vfs.file_contents(file_id).to_vec()).unwrap();
|
let mut text = String::from_utf8(vfs.file_contents(file_id).to_vec()).unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue