aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/format.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-12-18 20:00:43 +0000
committerAleksey Kladov <[email protected]>2020-12-18 20:04:26 +0000
commitc45221907adde640208a9e52636f4845d4654994 (patch)
tree7f64801f5d8fb520196b8a69f74078d408579a62 /crates/ide/src/syntax_highlighting/format.rs
parent25185c1418022868e2f7ec1599e32a34d63e8314 (diff)
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
Diffstat (limited to 'crates/ide/src/syntax_highlighting/format.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/format.rs6
1 files changed, 4 insertions, 2 deletions
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::{
4 AstNode, AstToken, SyntaxElement, SyntaxKind, SyntaxNode, TextRange, 4 AstNode, AstToken, SyntaxElement, SyntaxKind, SyntaxNode, TextRange,
5}; 5};
6 6
7use crate::{syntax_highlighting::HighlightedRangeStack, HighlightTag, HighlightedRange}; 7use crate::{
8 syntax_highlighting::HighlightedRangeStack, HighlightTag, HighlightedRange, SymbolKind,
9};
8 10
9#[derive(Default)] 11#[derive(Default)]
10pub(super) struct FormatStringHighlighter { 12pub(super) struct FormatStringHighlighter {
@@ -71,6 +73,6 @@ fn highlight_format_specifier(kind: FormatSpecifier) -> Option<HighlightTag> {
71 | FormatSpecifier::Asterisk 73 | FormatSpecifier::Asterisk
72 | FormatSpecifier::QuestionMark => HighlightTag::FormatSpecifier, 74 | FormatSpecifier::QuestionMark => HighlightTag::FormatSpecifier,
73 FormatSpecifier::Integer | FormatSpecifier::Zero => HighlightTag::NumericLiteral, 75 FormatSpecifier::Integer | FormatSpecifier::Zero => HighlightTag::NumericLiteral,
74 FormatSpecifier::Identifier => HighlightTag::Local, 76 FormatSpecifier::Identifier => HighlightTag::Symbol(SymbolKind::Local),
75 }) 77 })
76} 78}