diff options
Diffstat (limited to 'crates/rust-analyzer/src/main_loop/handlers.rs')
-rw-r--r-- | crates/rust-analyzer/src/main_loop/handlers.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/crates/rust-analyzer/src/main_loop/handlers.rs b/crates/rust-analyzer/src/main_loop/handlers.rs index fcb40432d..6482f3b77 100644 --- a/crates/rust-analyzer/src/main_loop/handlers.rs +++ b/crates/rust-analyzer/src/main_loop/handlers.rs | |||
@@ -37,7 +37,7 @@ use crate::{ | |||
37 | }, | 37 | }, |
38 | diagnostics::DiagnosticTask, | 38 | diagnostics::DiagnosticTask, |
39 | from_json, | 39 | from_json, |
40 | req::{self, Decoration, InlayHint, InlayHintsParams, InlayKind}, | 40 | req::{self, Decoration, InlayHint, InlayHintsParams}, |
41 | semantic_tokens::SemanticTokensBuilder, | 41 | semantic_tokens::SemanticTokensBuilder, |
42 | world::WorldSnapshot, | 42 | world::WorldSnapshot, |
43 | LspError, Result, | 43 | LspError, Result, |
@@ -997,16 +997,9 @@ pub fn handle_inlay_hints( | |||
997 | let analysis = world.analysis(); | 997 | let analysis = world.analysis(); |
998 | let line_index = analysis.file_line_index(file_id)?; | 998 | let line_index = analysis.file_line_index(file_id)?; |
999 | Ok(analysis | 999 | Ok(analysis |
1000 | .inlay_hints(file_id, world.options.max_inlay_hint_length)? | 1000 | .inlay_hints(file_id, &world.options.inlay_hints)? |
1001 | .into_iter() | 1001 | .into_iter() |
1002 | .map(|api_type| InlayHint { | 1002 | .map_conv_with(&line_index) |
1003 | label: api_type.label.to_string(), | ||
1004 | range: api_type.range.conv_with(&line_index), | ||
1005 | kind: match api_type.kind { | ||
1006 | ra_ide::InlayKind::TypeHint => InlayKind::TypeHint, | ||
1007 | ra_ide::InlayKind::ParameterHint => InlayKind::ParameterHint, | ||
1008 | }, | ||
1009 | }) | ||
1010 | .collect()) | 1003 | .collect()) |
1011 | } | 1004 | } |
1012 | 1005 | ||