diff options
| author | Chayim Refael Friedman <chayimfr@gmail.com> | 2025-05-25 20:15:58 +0300 |
|---|---|---|
| committer | Chayim Refael Friedman <chayimfr@gmail.com> | 2025-05-25 20:15:58 +0300 |
| commit | 753c62c8899abe05abcb7bc3cde8535f925e35bb (patch) | |
| tree | 49af16e65a0b90664e99271f5533eea934934766 /src/tools/rust-analyzer/crates/ide-ssr | |
| parent | 2580d833a2f94ce448e91ef4cc91fcc78c0442c4 (diff) | |
| download | rust-753c62c8899abe05abcb7bc3cde8535f925e35bb.tar.gz rust-753c62c8899abe05abcb7bc3cde8535f925e35bb.zip | |
Properly implement `might_be_inside_macro_call()` using semantic information instead of syntactical hacks
And rename it to `is_inside_macro_call()` accordingly.
Diffstat (limited to 'src/tools/rust-analyzer/crates/ide-ssr')
| -rw-r--r-- | src/tools/rust-analyzer/crates/ide-ssr/src/lib.rs | 2 | ||||
| -rw-r--r-- | src/tools/rust-analyzer/crates/ide-ssr/src/search.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/crates/ide-ssr/src/lib.rs b/src/tools/rust-analyzer/crates/ide-ssr/src/lib.rs index 339c199ec29..43c56ac8bec 100644 --- a/src/tools/rust-analyzer/crates/ide-ssr/src/lib.rs +++ b/src/tools/rust-analyzer/crates/ide-ssr/src/lib.rs @@ -287,7 +287,7 @@ impl<'db> MatchFinder<'db> { if let Some(expanded) = self.sema.expand_macro_call(¯o_call) { if let Some(tt) = macro_call.token_tree() { self.output_debug_for_nodes_at_range( - &expanded, + &expanded.value, range, &Some(self.sema.original_range(tt.syntax())), out, diff --git a/src/tools/rust-analyzer/crates/ide-ssr/src/search.rs b/src/tools/rust-analyzer/crates/ide-ssr/src/search.rs index d89911fca40..9afbedbb1ab 100644 --- a/src/tools/rust-analyzer/crates/ide-ssr/src/search.rs +++ b/src/tools/rust-analyzer/crates/ide-ssr/src/search.rs @@ -194,7 +194,7 @@ impl MatchFinder<'_> { // nodes that originated entirely from within the token tree of the macro call. // i.e. we don't want to match something that came from the macro itself. if let Some(range) = self.sema.original_range_opt(tt.syntax()) { - self.slow_scan_node(&expanded, rule, &Some(range), matches_out); + self.slow_scan_node(&expanded.value, rule, &Some(range), matches_out); } } } |
