From ba76017d2eb1b7606106c15478ac658dc32b6dbd Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sun, 21 Jul 2019 23:48:54 +0300 Subject: Do not show the lens with type hints --- crates/ra_lsp_server/src/main_loop/handlers.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'crates') 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( params: req::CodeLensParams, ) -> Result>> { let file_id = params.text_document.try_conv_with(&world)?; - let analysis = world.analysis(); - let line_index = analysis.file_line_index(file_id); + let line_index = world.analysis().file_line_index(file_id); let mut lenses: Vec = Default::default(); let workspace_root = world.workspace_root_for(file_id); // Gather runnables - for runnable in analysis.runnables(file_id)? { + for runnable in world.analysis().runnables(file_id)? { let title = match &runnable.kind { RunnableKind::Test { .. } | RunnableKind::TestMod { .. } => Some("▶️Run Test"), RunnableKind::Bench { .. } => Some("Run Bench"), @@ -729,7 +728,8 @@ pub fn handle_code_lens( // Handle impls lenses.extend( - analysis + world + .analysis() .file_structure(file_id) .into_iter() .filter(|it| match it.kind { @@ -749,15 +749,6 @@ pub fn handle_code_lens( }), ); - lenses.extend(analysis.inlay_hints(file_id)?.into_iter().map(|inlay_hint| CodeLens { - range: inlay_hint.range.conv_with(&line_index), - command: Some(Command { - title: inlay_hint.inlay_type_string, - command: String::new(), - arguments: None, - }), - data: None, - })); Ok(Some(lenses)) } -- cgit v1.2.3