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/main_loop/handlers.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index b5792f3b8..705d1360f 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -525,6 +525,18 @@ pub fn handle_hover(
525 contents: HoverContents::Scalar(MarkedString::String(result.join("\n\n---\n"))), 525 contents: HoverContents::Scalar(MarkedString::String(result.join("\n\n---\n"))),
526 range: Some(range), 526 range: Some(range),
527 })); 527 }));
528 } else {
529 let file_id = params.text_document.try_conv_with(&world)?;
530 let file_range = FileRange {
531 file_id,
532 range: rr.reference_range,
533 };
534 if let Some(type_name) = world.analysis().type_of(file_range)? {
535 return Ok(Some(Hover {
536 contents: HoverContents::Scalar(MarkedString::String(type_name)),
537 range: Some(range),
538 }));
539 }
528 } 540 }
529 Ok(None) 541 Ok(None)
530} 542}