diff options
author | Igor Aleksanov <[email protected]> | 2020-08-14 05:34:07 +0100 |
---|---|---|
committer | Igor Aleksanov <[email protected]> | 2020-08-14 05:34:07 +0100 |
commit | c26c911ec1e6c2ad1dcb7d155a6a1d528839ad1a (patch) | |
tree | 7cff36c38234be0afb65273146d8247083a5cfeb /crates/rust-analyzer/src/main_loop.rs | |
parent | 3c018bf84de5c693b5ee1c6bec0fed3b201c2060 (diff) | |
parent | f1f73649a686dc6e6449afc35e0fa6fed00e225d (diff) |
Merge branch 'master' into add-disable-diagnostics
Diffstat (limited to 'crates/rust-analyzer/src/main_loop.rs')
-rw-r--r-- | crates/rust-analyzer/src/main_loop.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/crates/rust-analyzer/src/main_loop.rs b/crates/rust-analyzer/src/main_loop.rs index e6cf46df2..66e04653a 100644 --- a/crates/rust-analyzer/src/main_loop.rs +++ b/crates/rust-analyzer/src/main_loop.rs | |||
@@ -5,12 +5,11 @@ use std::{ | |||
5 | time::{Duration, Instant}, | 5 | time::{Duration, Instant}, |
6 | }; | 6 | }; |
7 | 7 | ||
8 | use base_db::VfsPath; | ||
8 | use crossbeam_channel::{select, Receiver}; | 9 | use crossbeam_channel::{select, Receiver}; |
10 | use ide::{Canceled, FileId}; | ||
9 | use lsp_server::{Connection, Notification, Request, Response}; | 11 | use lsp_server::{Connection, Notification, Request, Response}; |
10 | use lsp_types::notification::Notification as _; | 12 | use lsp_types::notification::Notification as _; |
11 | use ra_db::VfsPath; | ||
12 | use ra_ide::{Canceled, FileId}; | ||
13 | use ra_prof::profile; | ||
14 | 13 | ||
15 | use crate::{ | 14 | use crate::{ |
16 | config::Config, | 15 | config::Config, |
@@ -22,7 +21,7 @@ use crate::{ | |||
22 | lsp_utils::{apply_document_changes, is_canceled, notification_is, Progress}, | 21 | lsp_utils::{apply_document_changes, is_canceled, notification_is, Progress}, |
23 | Result, | 22 | Result, |
24 | }; | 23 | }; |
25 | use ra_project_model::ProjectWorkspace; | 24 | use project_model::ProjectWorkspace; |
26 | use vfs::ChangeKind; | 25 | use vfs::ChangeKind; |
27 | 26 | ||
28 | pub fn main_loop(config: Config, connection: Connection) -> Result<()> { | 27 | pub fn main_loop(config: Config, connection: Connection) -> Result<()> { |
@@ -173,7 +172,7 @@ impl GlobalState { | |||
173 | fn handle_event(&mut self, event: Event) -> Result<()> { | 172 | fn handle_event(&mut self, event: Event) -> Result<()> { |
174 | let loop_start = Instant::now(); | 173 | let loop_start = Instant::now(); |
175 | // NOTE: don't count blocking select! call as a loop-turn time | 174 | // NOTE: don't count blocking select! call as a loop-turn time |
176 | let _p = profile("GlobalState::handle_event"); | 175 | let _p = profile::span("GlobalState::handle_event"); |
177 | 176 | ||
178 | log::info!("handle_event({:?})", event); | 177 | log::info!("handle_event({:?})", event); |
179 | let queue_count = self.task_pool.handle.len(); | 178 | let queue_count = self.task_pool.handle.len(); |
@@ -204,7 +203,7 @@ impl GlobalState { | |||
204 | self.analysis_host.maybe_collect_garbage(); | 203 | self.analysis_host.maybe_collect_garbage(); |
205 | } | 204 | } |
206 | Event::Vfs(mut task) => { | 205 | Event::Vfs(mut task) => { |
207 | let _p = profile("GlobalState::handle_event/vfs"); | 206 | let _p = profile::span("GlobalState::handle_event/vfs"); |
208 | loop { | 207 | loop { |
209 | match task { | 208 | match task { |
210 | vfs::loader::Message::Loaded { files } => { | 209 | vfs::loader::Message::Loaded { files } => { |