mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
minor: Fix rustfmt failing on main_loop.rs
This commit is contained in:
parent
4f5c7aafff
commit
343562c54d
1 changed files with 10 additions and 6 deletions
|
@ -665,11 +665,11 @@ impl GlobalState {
|
||||||
})?
|
})?
|
||||||
.on::<lsp_types::notification::DidOpenTextDocument>(|this, params| {
|
.on::<lsp_types::notification::DidOpenTextDocument>(|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) {
|
||||||
if this
|
let already_exists = this
|
||||||
.mem_docs
|
.mem_docs
|
||||||
.insert(path.clone(), DocumentData::new(params.text_document.version))
|
.insert(path.clone(), DocumentData::new(params.text_document.version))
|
||||||
.is_err()
|
.is_err();
|
||||||
{
|
if already_exists {
|
||||||
tracing::error!("duplicate DidOpenTextDocument: {}", path)
|
tracing::error!("duplicate DidOpenTextDocument: {}", path)
|
||||||
}
|
}
|
||||||
this.vfs
|
this.vfs
|
||||||
|
@ -688,7 +688,7 @@ impl GlobalState {
|
||||||
doc.version = params.text_document.version;
|
doc.version = params.text_document.version;
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
tracing::error!("unexpected DidChangeTextDocument: {}; send DidOpenTextDocument first", path);
|
tracing::error!("unexpected DidChangeTextDocument: {}", path);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -722,7 +722,8 @@ impl GlobalState {
|
||||||
}
|
}
|
||||||
if let Ok(abs_path) = from_proto::abs_path(¶ms.text_document.uri) {
|
if let Ok(abs_path) = from_proto::abs_path(¶ms.text_document.uri) {
|
||||||
if reload::should_refresh_for_change(&abs_path, ChangeKind::Modify) {
|
if reload::should_refresh_for_change(&abs_path, ChangeKind::Modify) {
|
||||||
this.fetch_workspaces_queue.request_op(format!("DidSaveTextDocument {}", abs_path.display()));
|
this.fetch_workspaces_queue
|
||||||
|
.request_op(format!("DidSaveTextDocument {}", abs_path.display()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -751,7 +752,10 @@ impl GlobalState {
|
||||||
// provide a configuration. This is handled in Config::update below.
|
// provide a configuration. This is handled in Config::update below.
|
||||||
let mut config = Config::clone(&*this.config);
|
let mut config = Config::clone(&*this.config);
|
||||||
if let Err(error) = config.update(json.take()) {
|
if let Err(error) = config.update(json.take()) {
|
||||||
this.show_message(lsp_types::MessageType::WARNING, error.to_string());
|
this.show_message(
|
||||||
|
lsp_types::MessageType::WARNING,
|
||||||
|
error.to_string(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
this.update_configuration(config);
|
this.update_configuration(config);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue