aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-06-01 08:31:40 +0100
committerAleksey Kladov <[email protected]>2019-06-01 08:31:40 +0100
commitbf801953a3d41e781c136b74815244d07c6cad03 (patch)
tree70c84d2f02e5aaace9bdb9ed6c5d5cab8b9a6fed /crates/ra_lsp_server/src/main_loop.rs
parent678a458543bdc2d6a94098fd38658d0827ff3438 (diff)
rename
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop.rs')
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index e6a7dc641..6080a3a4e 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -24,7 +24,7 @@ use crate::{
24 }, 24 },
25 project_model::workspace_loader, 25 project_model::workspace_loader,
26 req, 26 req,
27 server_world::{ServerWorld, ServerWorldState}, 27 world::{WorldSnapshot, WorldState},
28 Result, 28 Result,
29 InitializationOptions, 29 InitializationOptions,
30}; 30};
@@ -73,7 +73,7 @@ pub fn main_loop(
73 loaded_workspaces 73 loaded_workspaces
74 }; 74 };
75 75
76 let mut state = ServerWorldState::new(ws_roots, workspaces); 76 let mut state = WorldState::new(ws_roots, workspaces);
77 77
78 let pool = ThreadPool::new(THREADPOOL_SIZE); 78 let pool = ThreadPool::new(THREADPOOL_SIZE);
79 let (task_sender, task_receiver) = unbounded::<Task>(); 79 let (task_sender, task_receiver) = unbounded::<Task>();
@@ -161,7 +161,7 @@ fn main_loop_inner(
161 msg_receiver: &Receiver<RawMessage>, 161 msg_receiver: &Receiver<RawMessage>,
162 task_sender: Sender<Task>, 162 task_sender: Sender<Task>,
163 task_receiver: Receiver<Task>, 163 task_receiver: Receiver<Task>,
164 state: &mut ServerWorldState, 164 state: &mut WorldState,
165 pending_requests: &mut PendingRequests, 165 pending_requests: &mut PendingRequests,
166) -> Result<()> { 166) -> Result<()> {
167 let mut subs = Subscriptions::default(); 167 let mut subs = Subscriptions::default();
@@ -278,7 +278,7 @@ fn on_task(
278 task: Task, 278 task: Task,
279 msg_sender: &Sender<RawMessage>, 279 msg_sender: &Sender<RawMessage>,
280 pending_requests: &mut PendingRequests, 280 pending_requests: &mut PendingRequests,
281 state: &mut ServerWorldState, 281 state: &mut WorldState,
282) { 282) {
283 match task { 283 match task {
284 Task::Respond(response) => { 284 Task::Respond(response) => {
@@ -295,7 +295,7 @@ fn on_task(
295} 295}
296 296
297fn on_request( 297fn on_request(
298 world: &mut ServerWorldState, 298 world: &mut WorldState,
299 pending_requests: &mut PendingRequests, 299 pending_requests: &mut PendingRequests,
300 pool: &ThreadPool, 300 pool: &ThreadPool,
301 sender: &Sender<Task>, 301 sender: &Sender<Task>,
@@ -352,7 +352,7 @@ fn on_request(
352 352
353fn on_notification( 353fn on_notification(
354 msg_sender: &Sender<RawMessage>, 354 msg_sender: &Sender<RawMessage>,
355 state: &mut ServerWorldState, 355 state: &mut WorldState,
356 pending_requests: &mut PendingRequests, 356 pending_requests: &mut PendingRequests,
357 subs: &mut Subscriptions, 357 subs: &mut Subscriptions,
358 not: RawNotification, 358 not: RawNotification,
@@ -422,7 +422,7 @@ fn on_notification(
422struct PoolDispatcher<'a> { 422struct PoolDispatcher<'a> {
423 req: Option<RawRequest>, 423 req: Option<RawRequest>,
424 pool: &'a ThreadPool, 424 pool: &'a ThreadPool,
425 world: &'a mut ServerWorldState, 425 world: &'a mut WorldState,
426 pending_requests: &'a mut PendingRequests, 426 pending_requests: &'a mut PendingRequests,
427 msg_sender: &'a Sender<RawMessage>, 427 msg_sender: &'a Sender<RawMessage>,
428 sender: &'a Sender<Task>, 428 sender: &'a Sender<Task>,
@@ -433,7 +433,7 @@ impl<'a> PoolDispatcher<'a> {
433 /// Dispatches the request onto the current thread 433 /// Dispatches the request onto the current thread
434 fn on_sync<R>( 434 fn on_sync<R>(
435 &mut self, 435 &mut self,
436 f: fn(&mut ServerWorldState, R::Params) -> Result<R::Result>, 436 f: fn(&mut WorldState, R::Params) -> Result<R::Result>,
437 ) -> Result<&mut Self> 437 ) -> Result<&mut Self>
438 where 438 where
439 R: req::Request + 'static, 439 R: req::Request + 'static,
@@ -453,7 +453,7 @@ impl<'a> PoolDispatcher<'a> {
453 } 453 }
454 454
455 /// Dispatches the request onto thread pool 455 /// Dispatches the request onto thread pool
456 fn on<R>(&mut self, f: fn(ServerWorld, R::Params) -> Result<R::Result>) -> Result<&mut Self> 456 fn on<R>(&mut self, f: fn(WorldSnapshot, R::Params) -> Result<R::Result>) -> Result<&mut Self>
457 where 457 where
458 R: req::Request + 'static, 458 R: req::Request + 'static,
459 R::Params: DeserializeOwned + Send + 'static, 459 R::Params: DeserializeOwned + Send + 'static,
@@ -557,7 +557,7 @@ where
557 557
558fn update_file_notifications_on_threadpool( 558fn update_file_notifications_on_threadpool(
559 pool: &ThreadPool, 559 pool: &ThreadPool,
560 world: ServerWorld, 560 world: WorldSnapshot,
561 publish_decorations: bool, 561 publish_decorations: bool,
562 sender: Sender<Task>, 562 sender: Sender<Task>,
563 subscriptions: Vec<FileId>, 563 subscriptions: Vec<FileId>,