aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/src/main_loop.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server/src/main_loop.rs')
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs
index cb73e6586..cd81e226a 100644
--- a/crates/ra_lsp_server/src/main_loop.rs
+++ b/crates/ra_lsp_server/src/main_loop.rs
@@ -5,9 +5,7 @@ pub(crate) mod pending_requests;
5use std::{error::Error, fmt, path::PathBuf, sync::Arc, time::Instant}; 5use std::{error::Error, fmt, path::PathBuf, sync::Arc, time::Instant};
6 6
7use crossbeam_channel::{select, unbounded, Receiver, RecvError, Sender}; 7use crossbeam_channel::{select, unbounded, Receiver, RecvError, Sender};
8use gen_lsp_server::{ 8use gen_lsp_server::{handle_shutdown, ErrorCode, RawMessage, RawNotification, RawRequest, RawResponse};
9 handle_shutdown, ErrorCode, RawMessage, RawNotification, RawRequest, RawResponse,
10};
11use lsp_types::NumberOrString; 9use lsp_types::NumberOrString;
12use ra_ide_api::{Canceled, FileId, LibraryData}; 10use ra_ide_api::{Canceled, FileId, LibraryData};
13use ra_prof::profile; 11use ra_prof::profile;
@@ -398,7 +396,8 @@ fn on_notification(
398 Ok(mut params) => { 396 Ok(mut params) => {
399 let uri = params.text_document.uri; 397 let uri = params.text_document.uri;
400 let path = uri.to_file_path().map_err(|()| format!("invalid uri: {}", uri))?; 398 let path = uri.to_file_path().map_err(|()| format!("invalid uri: {}", uri))?;
401 let text = params.content_changes.pop().ok_or_else(|| format!("empty changes"))?.text; 399 let text =
400 params.content_changes.pop().ok_or_else(|| "empty changes".to_string())?.text;
402 state.vfs.write().change_file_overlay(path.as_path(), text); 401 state.vfs.write().change_file_overlay(path.as_path(), text);
403 return Ok(()); 402 return Ok(());
404 } 403 }