Skip to content

Commit b5baf71

Browse files
committed
Minor fixup
1 parent d2cc89f commit b5baf71

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

crates/ide-db/src/syntax_helpers/node_ext.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! Various helper functions to work with SyntaxNodes.
22
use std::ops::ControlFlow;
33

4+
use either::Either;
45
use itertools::Itertools;
56
use parser::T;
67
use span::Edition;
@@ -546,7 +547,11 @@ pub fn macro_call_for_string_token(string: &ast::String) -> Option<MacroCall> {
546547
}
547548

548549
pub fn is_in_macro_matcher(token: &SyntaxToken) -> bool {
549-
let Some(macro_def) = token.parent_ancestors().find_map(ast::Macro::cast) else {
550+
let Some(macro_def) = token
551+
.parent_ancestors()
552+
.map_while(Either::<ast::TokenTree, ast::Macro>::cast)
553+
.find_map(Either::right)
554+
else {
550555
return false;
551556
};
552557
let range = token.text_range();

0 commit comments

Comments
 (0)