diff options
Diffstat (limited to 'crates/rust-analyzer/src/conv.rs')
-rw-r--r-- | crates/rust-analyzer/src/conv.rs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/crates/rust-analyzer/src/conv.rs b/crates/rust-analyzer/src/conv.rs index a2d68c344..fd4657d7e 100644 --- a/crates/rust-analyzer/src/conv.rs +++ b/crates/rust-analyzer/src/conv.rs | |||
@@ -11,8 +11,8 @@ use lsp_types::{ | |||
11 | use ra_ide::{ | 11 | use ra_ide::{ |
12 | translate_offset_with_edit, CompletionItem, CompletionItemKind, FileId, FilePosition, | 12 | translate_offset_with_edit, CompletionItem, CompletionItemKind, FileId, FilePosition, |
13 | FileRange, FileSystemEdit, Fold, FoldKind, Highlight, HighlightModifier, HighlightTag, | 13 | FileRange, FileSystemEdit, Fold, FoldKind, Highlight, HighlightModifier, HighlightTag, |
14 | InsertTextFormat, LineCol, LineIndex, NavigationTarget, RangeInfo, ReferenceAccess, Severity, | 14 | InlayHint, InlayKind, InsertTextFormat, LineCol, LineIndex, NavigationTarget, RangeInfo, |
15 | SourceChange, SourceFileEdit, | 15 | ReferenceAccess, Severity, SourceChange, SourceFileEdit, |
16 | }; | 16 | }; |
17 | use ra_syntax::{SyntaxKind, TextRange, TextUnit}; | 17 | use ra_syntax::{SyntaxKind, TextRange, TextUnit}; |
18 | use ra_text_edit::{AtomTextEdit, TextEdit}; | 18 | use ra_text_edit::{AtomTextEdit, TextEdit}; |
@@ -323,6 +323,20 @@ impl ConvWith<&FoldConvCtx<'_>> for Fold { | |||
323 | } | 323 | } |
324 | } | 324 | } |
325 | 325 | ||
326 | impl ConvWith<&LineIndex> for InlayHint { | ||
327 | type Output = req::InlayHint; | ||
328 | fn conv_with(self, line_index: &LineIndex) -> Self::Output { | ||
329 | req::InlayHint { | ||
330 | label: self.label.to_string(), | ||
331 | range: self.range.conv_with(line_index), | ||
332 | kind: match self.kind { | ||
333 | InlayKind::ParameterHint => req::InlayKind::ParameterHint, | ||
334 | InlayKind::TypeHint => req::InlayKind::TypeHint, | ||
335 | }, | ||
336 | } | ||
337 | } | ||
338 | } | ||
339 | |||
326 | impl Conv for Highlight { | 340 | impl Conv for Highlight { |
327 | type Output = (u32, u32); | 341 | type Output = (u32, u32); |
328 | 342 | ||