diff options
Diffstat (limited to 'crates/ra_lsp_server/src')
-rw-r--r-- | crates/ra_lsp_server/src/main_loop.rs | 2 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 7 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/project_model/sysroot.rs | 8 |
3 files changed, 14 insertions, 3 deletions
diff --git a/crates/ra_lsp_server/src/main_loop.rs b/crates/ra_lsp_server/src/main_loop.rs index 726c758aa..03c834dbc 100644 --- a/crates/ra_lsp_server/src/main_loop.rs +++ b/crates/ra_lsp_server/src/main_loop.rs | |||
@@ -65,7 +65,7 @@ pub fn main_loop( | |||
65 | let workspaces = match ws_worker.recv().unwrap() { | 65 | let workspaces = match ws_worker.recv().unwrap() { |
66 | Ok(ws) => vec![ws], | 66 | Ok(ws) => vec![ws], |
67 | Err(e) => { | 67 | Err(e) => { |
68 | log::warn!("loading workspace failed: {}", e); | 68 | log::error!("loading workspace failed: {}", e); |
69 | Vec::new() | 69 | Vec::new() |
70 | } | 70 | } |
71 | }; | 71 | }; |
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index 7f6146b6c..a781df181 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -4,7 +4,7 @@ use gen_lsp_server::ErrorCode; | |||
4 | use languageserver_types::{ | 4 | use languageserver_types::{ |
5 | CodeActionResponse, Command, CodeLens, Diagnostic, DiagnosticSeverity, DocumentFormattingParams, | 5 | CodeActionResponse, Command, CodeLens, Diagnostic, DiagnosticSeverity, DocumentFormattingParams, |
6 | DocumentHighlight, DocumentSymbol, Documentation, FoldingRange, FoldingRangeKind, | 6 | DocumentHighlight, DocumentSymbol, Documentation, FoldingRange, FoldingRangeKind, |
7 | FoldingRangeParams, Hover, HoverContents, Location, MarkedString, MarkupContent, MarkupKind, | 7 | FoldingRangeParams, Hover, HoverContents, Location, MarkupContent, MarkupKind, |
8 | ParameterInformation, ParameterLabel, Position, PrepareRenameResponse, Range, RenameParams, | 8 | ParameterInformation, ParameterLabel, Position, PrepareRenameResponse, Range, RenameParams, |
9 | SignatureInformation, SymbolInformation, TextDocumentIdentifier, TextEdit, WorkspaceEdit, | 9 | SignatureInformation, SymbolInformation, TextDocumentIdentifier, TextEdit, WorkspaceEdit, |
10 | }; | 10 | }; |
@@ -422,7 +422,10 @@ pub fn handle_hover( | |||
422 | let line_index = world.analysis.file_line_index(position.file_id); | 422 | let line_index = world.analysis.file_line_index(position.file_id); |
423 | let range = info.range.conv_with(&line_index); | 423 | let range = info.range.conv_with(&line_index); |
424 | let res = Hover { | 424 | let res = Hover { |
425 | contents: HoverContents::Scalar(MarkedString::String(info.info)), | 425 | contents: HoverContents::Markup(MarkupContent { |
426 | kind: MarkupKind::Markdown, | ||
427 | value: info.info, | ||
428 | }), | ||
426 | range: Some(range), | 429 | range: Some(range), |
427 | }; | 430 | }; |
428 | Ok(Some(res)) | 431 | Ok(Some(res)) |
diff --git a/crates/ra_lsp_server/src/project_model/sysroot.rs b/crates/ra_lsp_server/src/project_model/sysroot.rs index 1dbab57f8..3b2fa070b 100644 --- a/crates/ra_lsp_server/src/project_model/sysroot.rs +++ b/crates/ra_lsp_server/src/project_model/sysroot.rs | |||
@@ -44,6 +44,14 @@ impl Sysroot { | |||
44 | let stdout = String::from_utf8(rustc_output.stdout)?; | 44 | let stdout = String::from_utf8(rustc_output.stdout)?; |
45 | let sysroot_path = Path::new(stdout.trim()); | 45 | let sysroot_path = Path::new(stdout.trim()); |
46 | let src = sysroot_path.join("lib/rustlib/src/rust/src"); | 46 | let src = sysroot_path.join("lib/rustlib/src/rust/src"); |
47 | if !src.exists() { | ||
48 | failure::bail!( | ||
49 | "can't load standard library from sysroot\n\ | ||
50 | {:?}\n\ | ||
51 | try running `rustup component add rust-src`", | ||
52 | src, | ||
53 | ); | ||
54 | } | ||
47 | 55 | ||
48 | let mut sysroot = Sysroot { | 56 | let mut sysroot = Sysroot { |
49 | crates: Arena::default(), | 57 | crates: Arena::default(), |