mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
Rudimentary name resolution for local items
This commit is contained in:
parent
7c405c0156
commit
e424545c0f
6 changed files with 145 additions and 49 deletions
|
@ -873,4 +873,41 @@ mod tests {
|
|||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn completes_local_item() {
|
||||
assert_debug_snapshot!(
|
||||
do_reference_completion(
|
||||
"
|
||||
//- /main.rs
|
||||
fn main() {
|
||||
return f<|>;
|
||||
fn frobnicate() {}
|
||||
}
|
||||
"
|
||||
),
|
||||
@r###"
|
||||
[
|
||||
CompletionItem {
|
||||
label: "frobnicate()",
|
||||
source_range: [23; 24),
|
||||
delete: [23; 24),
|
||||
insert: "frobnicate()$0",
|
||||
kind: Function,
|
||||
lookup: "frobnicate",
|
||||
detail: "fn frobnicate()",
|
||||
},
|
||||
CompletionItem {
|
||||
label: "main()",
|
||||
source_range: [23; 24),
|
||||
delete: [23; 24),
|
||||
insert: "main()$0",
|
||||
kind: Function,
|
||||
lookup: "main",
|
||||
detail: "fn main()",
|
||||
},
|
||||
]
|
||||
"###
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue