mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Draft the qualifier import resolution
This commit is contained in:
parent
c395c3311d
commit
309421c117
4 changed files with 224 additions and 43 deletions
|
@ -775,18 +775,92 @@ fn main() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn unresolved_qualifiers() {
|
||||
fn unresolved_qualifier() {
|
||||
check_edit(
|
||||
"Item",
|
||||
r#"
|
||||
mod foo {
|
||||
pub mod bar {
|
||||
pub mod baz {
|
||||
pub struct Item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
bar::baz::Ite$0
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
use foo::bar;
|
||||
|
||||
mod foo {
|
||||
pub mod bar {
|
||||
pub mod baz {
|
||||
pub struct Item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
bar::baz::Item
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unresolved_assoc_item_container() {
|
||||
check_edit(
|
||||
"Item",
|
||||
r#"
|
||||
mod foo {
|
||||
pub struct Item;
|
||||
|
||||
impl Item {
|
||||
pub const TEST_ASSOC: usize = 3;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
Item::TEST_A$0;
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
use foo::Item;
|
||||
|
||||
mod foo {
|
||||
pub struct Item;
|
||||
|
||||
impl Item {
|
||||
pub const TEST_ASSOC: usize = 3;
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
Item::TEST_ASSOC
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unresolved_assoc_item_container_with_path() {
|
||||
check_edit(
|
||||
"Item",
|
||||
r#"
|
||||
mod foo {
|
||||
pub mod bar {
|
||||
pub struct Item;
|
||||
|
||||
impl Item {
|
||||
pub const TEST_ASSOC: usize = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
bar::Ite$0
|
||||
bar::Item::TEST_A$0;
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
|
@ -795,11 +869,15 @@ use foo::bar;
|
|||
mod foo {
|
||||
pub mod bar {
|
||||
pub struct Item;
|
||||
|
||||
impl Item {
|
||||
pub const TEST_ASSOC: usize = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
bar::Item
|
||||
bar::Item::TEST_ASSOC
|
||||
}
|
||||
"#,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue