mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Default::default the highlighters
This commit is contained in:
parent
8c6dc5f28a
commit
bab29e65eb
3 changed files with 7 additions and 18 deletions
|
@ -74,7 +74,7 @@ pub(crate) fn highlight(
|
|||
|
||||
let mut current_macro_call: Option<ast::MacroCall> = None;
|
||||
let mut format_string_highlighter = FormatStringHighlighter::default();
|
||||
let mut macro_rules_highlighter = MacroRulesHighlighter::new();
|
||||
let mut macro_rules_highlighter = MacroRulesHighlighter::default();
|
||||
|
||||
// Walk all nodes, keeping track of whether we are inside a macro or not.
|
||||
// If in macro, expand it first and highlight the expanded code.
|
||||
|
@ -125,8 +125,8 @@ pub(crate) fn highlight(
|
|||
WalkEvent::Leave(Some(mc)) => {
|
||||
assert!(current_macro_call == Some(mc));
|
||||
current_macro_call = None;
|
||||
format_string_highlighter.reset();
|
||||
macro_rules_highlighter.reset();
|
||||
format_string_highlighter = FormatStringHighlighter::default();
|
||||
macro_rules_highlighter = MacroRulesHighlighter::default();
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue