diff options
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs index e5d2ff832..68865b755 100644 --- a/crates/ra_lsp_server/src/main_loop/handlers.rs +++ b/crates/ra_lsp_server/src/main_loop/handlers.rs | |||
@@ -685,14 +685,13 @@ pub fn handle_code_lens( | |||
685 | params: req::CodeLensParams, | 685 | params: req::CodeLensParams, |
686 | ) -> Result<Option<Vec<CodeLens>>> { | 686 | ) -> Result<Option<Vec<CodeLens>>> { |
687 | let file_id = params.text_document.try_conv_with(&world)?; | 687 | let file_id = params.text_document.try_conv_with(&world)?; |
688 | let analysis = world.analysis(); | 688 | let line_index = world.analysis().file_line_index(file_id); |
689 | let line_index = analysis.file_line_index(file_id); | ||
690 | 689 | ||
691 | let mut lenses: Vec<CodeLens> = Default::default(); | 690 | let mut lenses: Vec<CodeLens> = Default::default(); |
692 | let workspace_root = world.workspace_root_for(file_id); | 691 | let workspace_root = world.workspace_root_for(file_id); |
693 | 692 | ||
694 | // Gather runnables | 693 | // Gather runnables |
695 | for runnable in analysis.runnables(file_id)? { | 694 | for runnable in world.analysis().runnables(file_id)? { |
696 | let title = match &runnable.kind { | 695 | let title = match &runnable.kind { |
697 | RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => Some("▶️Run Test"), | 696 | RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => Some("▶️Run Test"), |
698 | RunnableKind::Bench { .. } => Some("Run Bench"), | 697 | RunnableKind::Bench { .. } => Some("Run Bench"), |
@@ -729,7 +728,8 @@ pub fn handle_code_lens( | |||
729 | 728 | ||
730 | // Handle impls | 729 | // Handle impls |
731 | lenses.extend( | 730 | lenses.extend( |
732 | analysis | 731 | world |
732 | .analysis() | ||
733 | .file_structure(file_id) | 733 | .file_structure(file_id) |
734 | .into_iter() | 734 | .into_iter() |
735 | .filter(|it| match it.kind { | 735 | .filter(|it| match it.kind { |
@@ -749,15 +749,6 @@ pub fn handle_code_lens( | |||
749 | }), | 749 | }), |
750 | ); | 750 | ); |
751 | 751 | ||
752 | lenses.extend(analysis.inlay_hints(file_id)?.into_iter().map(|inlay_hint| CodeLens { | ||
753 | range: inlay_hint.range.conv_with(&line_index), | ||
754 | command: Some(Command { | ||
755 | title: inlay_hint.inlay_type_string, | ||
756 | command: String::new(), | ||
757 | arguments: None, | ||
758 | }), | ||
759 | data: None, | ||
760 | })); | ||
761 | Ok(Some(lenses)) | 752 | Ok(Some(lenses)) |
762 | } | 753 | } |
763 | 754 | ||