aboutsummaryrefslogtreecommitdiff
path: root/crates/server/src/main_loop
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-04 02:13:22 +0100
committerAleksey Kladov <[email protected]>2018-09-04 02:13:22 +0100
commit4df965a002b5296fc728f1bc2fb9312fe421ea5d (patch)
tree989dfb2bbc2751d97959b4ca320cc5301b2ec4f5 /crates/server/src/main_loop
parentc3e28f06463854e4711c4c49a49c77d1e136969f (diff)
work
Diffstat (limited to 'crates/server/src/main_loop')
-rw-r--r--crates/server/src/main_loop/mod.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/crates/server/src/main_loop/mod.rs b/crates/server/src/main_loop/mod.rs
index 58f6f88a7..52e3b661d 100644
--- a/crates/server/src/main_loop/mod.rs
+++ b/crates/server/src/main_loop/mod.rs
@@ -8,7 +8,7 @@ use std::{
8 8
9use threadpool::ThreadPool; 9use threadpool::ThreadPool;
10use serde::{Serialize, de::DeserializeOwned}; 10use serde::{Serialize, de::DeserializeOwned};
11use crossbeam_channel::{bounded, Sender, Receiver}; 11use crossbeam_channel::{unbounded, Sender, Receiver};
12use languageserver_types::{NumberOrString}; 12use languageserver_types::{NumberOrString};
13use libanalysis::{FileId, JobHandle, JobToken, LibraryData}; 13use libanalysis::{FileId, JobHandle, JobToken, LibraryData};
14use gen_lsp_server::{ 14use gen_lsp_server::{
@@ -38,7 +38,7 @@ pub fn main_loop(
38 msg_sender: &mut Sender<RawMessage>, 38 msg_sender: &mut Sender<RawMessage>,
39) -> Result<()> { 39) -> Result<()> {
40 let pool = ThreadPool::new(4); 40 let pool = ThreadPool::new(4);
41 let (task_sender, task_receiver) = bounded::<Task>(16); 41 let (task_sender, task_receiver) = unbounded::<Task>();
42 let (fs_sender, fs_receiver, fs_watcher) = vfs::roots_loader(); 42 let (fs_sender, fs_receiver, fs_watcher) = vfs::roots_loader();
43 let (ws_sender, ws_receiver, ws_watcher) = workspace_loader(); 43 let (ws_sender, ws_receiver, ws_watcher) = workspace_loader();
44 44
@@ -97,7 +97,7 @@ fn main_loop_inner(
97 pending_requests: &mut HashMap<u64, JobHandle>, 97 pending_requests: &mut HashMap<u64, JobHandle>,
98 subs: &mut Subscriptions, 98 subs: &mut Subscriptions,
99) -> Result<()> { 99) -> Result<()> {
100 let (libdata_sender, libdata_receiver) = bounded(1024); 100 let (libdata_sender, libdata_receiver) = unbounded();
101 ws_sender.send(ws_root.clone()); 101 ws_sender.send(ws_root.clone());
102 fs_sender.send(ws_root.clone()); 102 fs_sender.send(ws_root.clone());
103 loop { 103 loop {
@@ -137,7 +137,10 @@ fn main_loop_inner(
137 let files = state.events_to_files(events); 137 let files = state.events_to_files(events);
138 let sender = libdata_sender.clone(); 138 let sender = libdata_sender.clone();
139 pool.execute(move || { 139 pool.execute(move || {
140 let start = ::std::time::Instant::now();
141 info!("indexing {} ... ", root.display());
140 let data = LibraryData::prepare(files); 142 let data = LibraryData::prepare(files);
143 info!("indexed {:?} {}", start.elapsed(), root.display());
141 sender.send(data); 144 sender.send(data);
142 }); 145 });
143 } 146 }