mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Move format specifier lexing from syntax to ide_db
This commit is contained in:
parent
82fccb971e
commit
91279db2b4
5 changed files with 301 additions and 315 deletions
|
@ -1,9 +1,9 @@
|
|||
//! Syntax highlighting for format macro strings.
|
||||
use ide_db::{helpers::format_string::is_format_string, SymbolKind};
|
||||
use syntax::{
|
||||
ast::{self, FormatSpecifier, HasFormatSpecifier},
|
||||
TextRange,
|
||||
use ide_db::{
|
||||
helpers::format_string::{is_format_string, lex_format_specifiers, FormatSpecifier},
|
||||
SymbolKind,
|
||||
};
|
||||
use syntax::{ast, TextRange};
|
||||
|
||||
use crate::{syntax_highlighting::highlights::Highlights, HlRange, HlTag};
|
||||
|
||||
|
@ -17,7 +17,7 @@ pub(super) fn highlight_format_string(
|
|||
return;
|
||||
}
|
||||
|
||||
string.lex_format_specifier(|piece_range, kind| {
|
||||
lex_format_specifiers(string, &mut |piece_range, kind| {
|
||||
if let Some(highlight) = highlight_format_specifier(kind) {
|
||||
stack.add(HlRange {
|
||||
range: piece_range + range.start(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue