mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
Add test for completion of unresolved items
This commit is contained in:
parent
2f9f409538
commit
9297f4d991
@ -867,4 +867,38 @@ mod tests {
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completes_unresolved_uses() {
|
||||
assert_debug_snapshot!(
|
||||
do_reference_completion(
|
||||
r"
|
||||
use spam::Quux;
|
||||
|
||||
fn main() {
|
||||
<|>
|
||||
}
|
||||
"
|
||||
),
|
||||
@r###"
|
||||
[
|
||||
CompletionItem {
|
||||
label: "Quux",
|
||||
source_range: [82; 82),
|
||||
delete: [82; 82),
|
||||
insert: "Quux",
|
||||
},
|
||||
CompletionItem {
|
||||
label: "main()",
|
||||
source_range: [82; 82),
|
||||
delete: [82; 82),
|
||||
insert: "main()$0",
|
||||
kind: Function,
|
||||
lookup: "main",
|
||||
detail: "fn main()",
|
||||
},
|
||||
]
|
||||
"###
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user