Add ExternCrateDecl to HIR

This commit is contained in:
Lukas Wirth 2023-08-02 11:52:55 +02:00
parent 151c750dac
commit bcff166b3a
39 changed files with 585 additions and 167 deletions

View file

@ -1616,6 +1616,9 @@ fn test_hover_extern_crate() {
check(
r#"
//- /main.rs crate:main deps:std
//! Crate docs
/// Decl docs!
extern crate st$0d;
//- /std/lib.rs crate:std
//! Standard library for this test
@ -1624,23 +1627,32 @@ extern crate st$0d;
//! abc123
"#,
expect![[r#"
*std*
*std*
```rust
extern crate std
```
```rust
main
```
---
```rust
extern crate std
```
Standard library for this test
---
Printed?
abc123
"#]],
Decl docs!
Standard library for this test
Printed?
abc123
"#]],
);
check(
r#"
//- /main.rs crate:main deps:std
//! Crate docs
/// Decl docs!
extern crate std as ab$0c;
//- /std/lib.rs crate:std
//! Standard library for this test
@ -1649,19 +1661,25 @@ extern crate std as ab$0c;
//! abc123
"#,
expect![[r#"
*abc*
*abc*
```rust
extern crate std
```
```rust
main
```
---
```rust
extern crate std as abc
```
Standard library for this test
---
Printed?
abc123
"#]],
Decl docs!
Standard library for this test
Printed?
abc123
"#]],
);
}