diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-09 13:09:15 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-09 13:09:15 +0000 |
commit | 939ca83b34f9a5648d196f85e5cc7d844ba22604 (patch) | |
tree | a007952a8870e4d8c0b5fa1e0e0a088b399a8c8d /crates/ide/src/syntax_highlighting/format.rs | |
parent | 625ec9e1ae69168f194cbc5bf20846870f03e149 (diff) | |
parent | 4a8d2c098d88da6f36f3cf95f424b471987c5daa (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.rs | 12 |
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 | ||
7 | use crate::{HighlightTag, HighlightedRange, SymbolKind}; | 7 | use crate::{HlRange, HlTag, SymbolKind}; |
8 | 8 | ||
9 | use super::highlights::Highlights; | 9 | use 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 | ||
60 | fn highlight_format_specifier(kind: FormatSpecifier) -> Option<HighlightTag> { | 60 | fn 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 | } |