aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/main_loop.rs
diff options
context:
space:
mode:
authorIgor Aleksanov <[email protected]>2020-08-14 05:34:07 +0100
committerIgor Aleksanov <[email protected]>2020-08-14 05:34:07 +0100
commitc26c911ec1e6c2ad1dcb7d155a6a1d528839ad1a (patch)
tree7cff36c38234be0afb65273146d8247083a5cfeb /crates/rust-analyzer/src/main_loop.rs
parent3c018bf84de5c693b5ee1c6bec0fed3b201c2060 (diff)
parentf1f73649a686dc6e6449afc35e0fa6fed00e225d (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.rs11
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
8use base_db::VfsPath;
8use crossbeam_channel::{select, Receiver}; 9use crossbeam_channel::{select, Receiver};
10use ide::{Canceled, FileId};
9use lsp_server::{Connection, Notification, Request, Response}; 11use lsp_server::{Connection, Notification, Request, Response};
10use lsp_types::notification::Notification as _; 12use lsp_types::notification::Notification as _;
11use ra_db::VfsPath;
12use ra_ide::{Canceled, FileId};
13use ra_prof::profile;
14 13
15use crate::{ 14use 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};
25use ra_project_model::ProjectWorkspace; 24use project_model::ProjectWorkspace;
26use vfs::ChangeKind; 25use vfs::ChangeKind;
27 26
28pub fn main_loop(config: Config, connection: Connection) -> Result<()> { 27pub 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 } => {