From d993f329a01deb3cdc011c3eb1dfd859302fec04 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Sat, 4 Jan 2020 17:46:01 -0500 Subject: Basic DocumentHighlightKind support for assignments --- crates/ra_lsp_server/src/conv.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'crates/ra_lsp_server/src/conv.rs') 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::{ use ra_ide::{ translate_offset_with_edit, CompletionItem, CompletionItemKind, FileId, FilePosition, FileRange, FileSystemEdit, Fold, FoldKind, InsertTextFormat, LineCol, LineIndex, - NavigationTarget, RangeInfo, Severity, SourceChange, SourceFileEdit, + NavigationTarget, RangeInfo, ReferenceAccess, Severity, SourceChange, SourceFileEdit, }; use ra_syntax::{SyntaxKind, TextRange, TextUnit}; use ra_text_edit::{AtomTextEdit, TextEdit}; @@ -53,6 +53,18 @@ impl Conv for SyntaxKind { } } +impl Conv for ReferenceAccess { + type Output = ::lsp_types::DocumentHighlightKind; + + fn conv(self) -> Self::Output { + use lsp_types::DocumentHighlightKind::*; + match self { + ReferenceAccess::Read => Read, + ReferenceAccess::Write => Write, + } + } +} + impl Conv for CompletionItemKind { type Output = ::lsp_types::CompletionItemKind; -- cgit v1.2.3