mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Resolve $crate
in HirDisplay
of Path
This commit is contained in:
parent
ab896e38e1
commit
a247fffdf6
2 changed files with 42 additions and 1 deletions
|
@ -4583,3 +4583,33 @@ pub struct Foo;
|
|||
"##]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_dollar_crate() {
|
||||
// $crate should be resolved to the right crate name.
|
||||
|
||||
check(
|
||||
r#"
|
||||
//- /main.rs crate:main deps:dep
|
||||
dep::m!(KONST$0);
|
||||
//- /dep.rs crate:dep
|
||||
#[macro_export]
|
||||
macro_rules! m {
|
||||
( $name:ident ) => { const $name: $crate::Type = $crate::Type; };
|
||||
}
|
||||
|
||||
pub struct Type;
|
||||
"#,
|
||||
expect![[r#"
|
||||
*KONST*
|
||||
|
||||
```rust
|
||||
main
|
||||
```
|
||||
|
||||
```rust
|
||||
const KONST: dep::Type = $crate::Type
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue