We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2cc89f commit b5baf71Copy full SHA for b5baf71
1 file changed
crates/ide-db/src/syntax_helpers/node_ext.rs
@@ -1,6 +1,7 @@
1
//! Various helper functions to work with SyntaxNodes.
2
use std::ops::ControlFlow;
3
4
+use either::Either;
5
use itertools::Itertools;
6
use parser::T;
7
use span::Edition;
@@ -546,7 +547,11 @@ pub fn macro_call_for_string_token(string: &ast::String) -> Option<MacroCall> {
546
547
}
548
549
pub fn is_in_macro_matcher(token: &SyntaxToken) -> bool {
- 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 {
555
return false;
556
};
557
let range = token.text_range();
0 commit comments