diff options
Diffstat (limited to 'crates/ide/src/syntax_highlighting/format.rs')
-rw-r--r-- | crates/ide/src/syntax_highlighting/format.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ide/src/syntax_highlighting/format.rs b/crates/ide/src/syntax_highlighting/format.rs index a74ca844b..8c67a0863 100644 --- a/crates/ide/src/syntax_highlighting/format.rs +++ b/crates/ide/src/syntax_highlighting/format.rs | |||
@@ -1,10 +1,11 @@ | |||
1 | //! Syntax highlighting for format macro strings. | 1 | //! Syntax highlighting for format macro strings. |
2 | use ide_db::SymbolKind; | ||
2 | use syntax::{ | 3 | use syntax::{ |
3 | ast::{self, FormatSpecifier, HasFormatSpecifier}, | 4 | ast::{self, FormatSpecifier, HasFormatSpecifier}, |
4 | AstNode, AstToken, TextRange, | 5 | AstNode, AstToken, TextRange, |
5 | }; | 6 | }; |
6 | 7 | ||
7 | use crate::{syntax_highlighting::highlights::Highlights, HlRange, HlTag, SymbolKind}; | 8 | use crate::{syntax_highlighting::highlights::Highlights, HlRange, HlTag}; |
8 | 9 | ||
9 | pub(super) fn highlight_format_string( | 10 | pub(super) fn highlight_format_string( |
10 | stack: &mut Highlights, | 11 | stack: &mut Highlights, |
@@ -30,7 +31,7 @@ fn is_format_string(string: &ast::String) -> Option<()> { | |||
30 | let parent = string.syntax().parent(); | 31 | let parent = string.syntax().parent(); |
31 | 32 | ||
32 | let name = parent.parent().and_then(ast::MacroCall::cast)?.path()?.segment()?.name_ref()?; | 33 | let name = parent.parent().and_then(ast::MacroCall::cast)?.path()?.segment()?.name_ref()?; |
33 | if !matches!(name.text().as_str(), "format_args" | "format_args_nl") { | 34 | if !matches!(name.text(), "format_args" | "format_args_nl") { |
34 | return None; | 35 | return None; |
35 | } | 36 | } |
36 | 37 | ||