File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
ql/integration-tests/macro-expansion Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -29,11 +29,18 @@ macro_rules! pre_emit {
29
29
return Some ( label) ;
30
30
}
31
31
} ;
32
+ ( Meta , $self: ident, $node: ident) => {
33
+ // rust-analyzer doesn't expand macros in this context
34
+ $self. macro_context_depth += 1 ;
35
+ } ;
32
36
( $( $_: tt) * ) => { } ;
33
37
}
34
38
35
39
#[ macro_export]
36
40
macro_rules! post_emit {
41
+ ( Meta , $self: ident, $node: ident, $label: ident) => {
42
+ $self. macro_context_depth -= 1 ;
43
+ } ;
37
44
( MacroCall , $self: ident, $node: ident, $label: ident) => {
38
45
$self. extract_macro_call_expanded( $node, $label) ;
39
46
} ;
@@ -122,7 +129,7 @@ pub struct Translator<'a> {
122
129
pub semantics : Option < & ' a Semantics < ' a , RootDatabase > > ,
123
130
resolve_paths : bool ,
124
131
source_kind : SourceKind ,
125
- macro_context_depth : usize ,
132
+ pub ( crate ) macro_context_depth : usize ,
126
133
}
127
134
128
135
const UNKNOWN_LOCATION : ( LineCol , LineCol ) =
Original file line number Diff line number Diff line change @@ -40,4 +40,3 @@ unexpanded_macro_calls
40
40
warnings
41
41
| calls/src/included.rs:2:9:2:39 | macro expansion failed: could not resolve macro 'concat' |
42
42
| calls/src/lib.rs:22:9:22:31 | macro expansion failed: could not resolve macro 'concat' |
43
- | calls/src/lib.rs:29:9:29:32 | macro expansion failed: could not resolve macro 'include_str' |
You can’t perform that action at this time.
0 commit comments