aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2019-07-21 21:48:54 +0100
committerKirill Bulatov <[email protected]>2019-07-21 21:48:54 +0100
commitba76017d2eb1b7606106c15478ac658dc32b6dbd (patch)
tree78161b533b73d030007e8e050da1a15308da9105 /crates
parent09c7c86696eb8289c9a8ab30bdbb824824c51eb1 (diff)
Do not show the lens with type hints
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs17
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