From c45221907adde640208a9e52636f4845d4654994 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 18 Dec 2020 23:00:43 +0300 Subject: Deduplicate highlight tags and symbol kinds Curiously, LSP uses different enums for those, and unsurprising and annoyingly, there are things which exist in one but not in the other. Let's not repeat the mistake and unify the two things --- crates/ide/src/syntax_highlighting/format.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crates/ide/src/syntax_highlighting/format.rs') diff --git a/crates/ide/src/syntax_highlighting/format.rs b/crates/ide/src/syntax_highlighting/format.rs index 42f27df5d..26416022b 100644 --- a/crates/ide/src/syntax_highlighting/format.rs +++ b/crates/ide/src/syntax_highlighting/format.rs @@ -4,7 +4,9 @@ use syntax::{ AstNode, AstToken, SyntaxElement, SyntaxKind, SyntaxNode, TextRange, }; -use crate::{syntax_highlighting::HighlightedRangeStack, HighlightTag, HighlightedRange}; +use crate::{ + syntax_highlighting::HighlightedRangeStack, HighlightTag, HighlightedRange, SymbolKind, +}; #[derive(Default)] pub(super) struct FormatStringHighlighter { @@ -71,6 +73,6 @@ fn highlight_format_specifier(kind: FormatSpecifier) -> Option { | FormatSpecifier::Asterisk | FormatSpecifier::QuestionMark => HighlightTag::FormatSpecifier, FormatSpecifier::Integer | FormatSpecifier::Zero => HighlightTag::NumericLiteral, - FormatSpecifier::Identifier => HighlightTag::Local, + FormatSpecifier::Identifier => HighlightTag::Symbol(SymbolKind::Local), }) } -- cgit v1.2.3