aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_highlighting/format.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-09 13:09:15 +0000
committerGitHub <[email protected]>2021-01-09 13:09:15 +0000
commit939ca83b34f9a5648d196f85e5cc7d844ba22604 (patch)
treea007952a8870e4d8c0b5fa1e0e0a088b399a8c8d /crates/ide/src/syntax_highlighting/format.rs
parent625ec9e1ae69168f194cbc5bf20846870f03e149 (diff)
parent4a8d2c098d88da6f36f3cf95f424b471987c5daa (diff)
Merge #7216
7216: Highlighting improvements r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide/src/syntax_highlighting/format.rs')
-rw-r--r--crates/ide/src/syntax_highlighting/format.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ide/src/syntax_highlighting/format.rs b/crates/ide/src/syntax_highlighting/format.rs
index ab66b406c..d807ad0ad 100644
--- a/crates/ide/src/syntax_highlighting/format.rs
+++ b/crates/ide/src/syntax_highlighting/format.rs
@@ -4,7 +4,7 @@ use syntax::{
4 AstNode, AstToken, SyntaxElement, SyntaxKind, SyntaxNode, TextRange, 4 AstNode, AstToken, SyntaxElement, SyntaxKind, SyntaxNode, TextRange,
5}; 5};
6 6
7use crate::{HighlightTag, HighlightedRange, SymbolKind}; 7use crate::{HlRange, HlTag, SymbolKind};
8 8
9use super::highlights::Highlights; 9use super::highlights::Highlights;
10 10
@@ -46,7 +46,7 @@ impl FormatStringHighlighter {
46 if self.format_string.as_ref() == Some(&SyntaxElement::from(string.syntax().clone())) { 46 if self.format_string.as_ref() == Some(&SyntaxElement::from(string.syntax().clone())) {
47 string.lex_format_specifier(|piece_range, kind| { 47 string.lex_format_specifier(|piece_range, kind| {
48 if let Some(highlight) = highlight_format_specifier(kind) { 48 if let Some(highlight) = highlight_format_specifier(kind) {
49 stack.add(HighlightedRange { 49 stack.add(HlRange {
50 range: piece_range + range.start(), 50 range: piece_range + range.start(),
51 highlight: highlight.into(), 51 highlight: highlight.into(),
52 binding_hash: None, 52 binding_hash: None,
@@ -57,7 +57,7 @@ impl FormatStringHighlighter {
57 } 57 }
58} 58}
59 59
60fn highlight_format_specifier(kind: FormatSpecifier) -> Option<HighlightTag> { 60fn highlight_format_specifier(kind: FormatSpecifier) -> Option<HlTag> {
61 Some(match kind { 61 Some(match kind {
62 FormatSpecifier::Open 62 FormatSpecifier::Open
63 | FormatSpecifier::Close 63 | FormatSpecifier::Close
@@ -69,8 +69,8 @@ fn highlight_format_specifier(kind: FormatSpecifier) -> Option<HighlightTag> {
69 | FormatSpecifier::DollarSign 69 | FormatSpecifier::DollarSign
70 | FormatSpecifier::Dot 70 | FormatSpecifier::Dot
71 | FormatSpecifier::Asterisk 71 | FormatSpecifier::Asterisk
72 | FormatSpecifier::QuestionMark => HighlightTag::FormatSpecifier, 72 | FormatSpecifier::QuestionMark => HlTag::FormatSpecifier,
73 FormatSpecifier::Integer | FormatSpecifier::Zero => HighlightTag::NumericLiteral, 73 FormatSpecifier::Integer | FormatSpecifier::Zero => HlTag::NumericLiteral,
74 FormatSpecifier::Identifier => HighlightTag::Symbol(SymbolKind::Local), 74 FormatSpecifier::Identifier => HlTag::Symbol(SymbolKind::Local),
75 }) 75 })
76} 76}