diff options
author | Jeremy Kolb <[email protected]> | 2020-01-04 22:46:01 +0000 |
---|---|---|
committer | kjeremy <[email protected]> | 2020-01-10 20:14:19 +0000 |
commit | d993f329a01deb3cdc011c3eb1dfd859302fec04 (patch) | |
tree | 4ee64d1bd29b793cf5d9cff1f712cc02077b490a /crates/ra_lsp_server/src/conv.rs | |
parent | 19eb7fa1db7da8417314ddfafe7addbbd9c3b46a (diff) |
Basic DocumentHighlightKind support for assignments
Diffstat (limited to 'crates/ra_lsp_server/src/conv.rs')
-rw-r--r-- | crates/ra_lsp_server/src/conv.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/ra_lsp_server/src/conv.rs b/crates/ra_lsp_server/src/conv.rs index c260b51c4..1b93195d7 100644 --- a/crates/ra_lsp_server/src/conv.rs +++ b/crates/ra_lsp_server/src/conv.rs | |||
@@ -9,7 +9,7 @@ use lsp_types::{ | |||
9 | use ra_ide::{ | 9 | use ra_ide::{ |
10 | translate_offset_with_edit, CompletionItem, CompletionItemKind, FileId, FilePosition, | 10 | translate_offset_with_edit, CompletionItem, CompletionItemKind, FileId, FilePosition, |
11 | FileRange, FileSystemEdit, Fold, FoldKind, InsertTextFormat, LineCol, LineIndex, | 11 | FileRange, FileSystemEdit, Fold, FoldKind, InsertTextFormat, LineCol, LineIndex, |
12 | NavigationTarget, RangeInfo, Severity, SourceChange, SourceFileEdit, | 12 | NavigationTarget, RangeInfo, ReferenceAccess, Severity, SourceChange, SourceFileEdit, |
13 | }; | 13 | }; |
14 | use ra_syntax::{SyntaxKind, TextRange, TextUnit}; | 14 | use ra_syntax::{SyntaxKind, TextRange, TextUnit}; |
15 | use ra_text_edit::{AtomTextEdit, TextEdit}; | 15 | use ra_text_edit::{AtomTextEdit, TextEdit}; |
@@ -53,6 +53,18 @@ impl Conv for SyntaxKind { | |||
53 | } | 53 | } |
54 | } | 54 | } |
55 | 55 | ||
56 | impl Conv for ReferenceAccess { | ||
57 | type Output = ::lsp_types::DocumentHighlightKind; | ||
58 | |||
59 | fn conv(self) -> Self::Output { | ||
60 | use lsp_types::DocumentHighlightKind::*; | ||
61 | match self { | ||
62 | ReferenceAccess::Read => Read, | ||
63 | ReferenceAccess::Write => Write, | ||
64 | } | ||
65 | } | ||
66 | } | ||
67 | |||
56 | impl Conv for CompletionItemKind { | 68 | impl Conv for CompletionItemKind { |
57 | type Output = ::lsp_types::CompletionItemKind; | 69 | type Output = ::lsp_types::CompletionItemKind; |
58 | 70 | ||