X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=crates%2Frust-analyzer%2Fsrc%2Fmain_loop.rs;h=fa5fc6fbfdb54c89593f5243778ac16a80adc9e0;hb=c9b4ac5be4daaabc062ab1ee663eba8594750003;hp=4e07916113d54587abe37a904bd14d16b5aab030;hpb=49a5d6a8d4a5da296ead4c44ac43090b9b0e8034;p=rust.git diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index 4e07916113d..fa5fc6fbfdb 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs @@ -22,7 +22,7 @@ from_proto, global_state::{file_id_to_url, url_to_file_id, GlobalState}, handlers, lsp_ext, - lsp_utils::{apply_document_changes, is_canceled, notification_is, Progress}, + lsp_utils::{apply_document_changes, is_cancelled, notification_is, Progress}, reload::{BuildDataProgress, ProjectWorkspaceProgress}, Result, }; @@ -103,6 +103,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { impl GlobalState { fn run(mut self, inbox: Receiver) -> Result<()> { if self.config.linked_projects().is_empty() + && self.config.detached_files().is_empty() && self.config.notifications().cargo_toml_not_found { self.show_message( @@ -514,6 +515,7 @@ fn on_request(&mut self, request_received: Instant, req: Request) -> Result<()> .on::(handlers::handle_syntax_tree) .on::(handlers::handle_view_hir) .on::(handlers::handle_view_crate_graph) + .on::(handlers::handle_view_item_tree) .on::(handlers::handle_expand_macro) .on::(handlers::handle_parent_module) .on::(handlers::handle_runnables) @@ -541,6 +543,7 @@ fn on_request(&mut self, request_received: Instant, req: Request) -> Result<()> .on::(handlers::handle_rename) .on::(handlers::handle_references) .on::(handlers::handle_formatting) + .on::(handlers::handle_range_formatting) .on::(handlers::handle_document_highlight) .on::(handlers::handle_call_hierarchy_prepare) .on::( @@ -737,7 +740,7 @@ fn maybe_update_diagnostics(&mut self) { let subscriptions = self .mem_docs .keys() - .map(|path| self.vfs.read().0.file_id(&path).unwrap()) + .map(|path| self.vfs.read().0.file_id(path).unwrap()) .collect::>(); log::trace!("updating notifications for {:?}", subscriptions); @@ -749,7 +752,7 @@ fn maybe_update_diagnostics(&mut self) { .filter_map(|file_id| { handlers::publish_diagnostics(&snapshot, file_id) .map_err(|err| { - if !is_canceled(&*err) { + if !is_cancelled(&*err) { log::error!("failed to compute diagnostics: {:?}", err); } ()