aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_lsp_server')
-rw-r--r--crates/ra_lsp_server/src/conv.rs2
-rw-r--r--crates/ra_lsp_server/src/main_loop.rs7
2 files changed, 4 insertions, 5 deletions
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs
index c8128f55b..32e67838e 100644
--- a/crates/ra_lsp_server/src/conv.rs
+++ b/crates/ra_lsp_server/src/conv.rs
@@ -171,7 +171,7 @@ impl Conv for ra_ide_api::Documentation {
171 fn conv(self) -> Documentation { 171 fn conv(self) -> Documentation {
172 Documentation::MarkupContent(MarkupContent { 172 Documentation::MarkupContent(MarkupContent {
173 kind: MarkupKind::Markdown, 173 kind: MarkupKind::Markdown,
174 value: crate::markdown::mark_fenced_blocks_as_rust(self.as_str()).into(), 174 value: crate::markdown::mark_fenced_blocks_as_rust(self.as_str()),
175 }) 175 })
176 } 176 }
177} 177}
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 }