feat: find references for Ref and Label (#527)

* add test for `goto_definition` with label reference

* simplify test for `goto_definition` with reference

* abstract compile doc for test

* add snap for goto_definition label reference

* basic goto_reference with simple test

* basic find_reference for Ref

* fix: a bug in linked def

* Remove unwanted compile directive compile: true

* simply compile and get depended files fail for corss_file_ref_label

* update ref reference but still fail to get source from path

* fix: reuse find definition effort and handle undefined references for labels

* dev: update test case

* fix: label reference analysis

* fix: rust analyzer doing bad

* dev: update snapshot

* dev: lift common pattern

* fix: unstable snapshot

---------

Co-authored-by: Myriad-Dreamin <camiyoru@gmail.com>
This commit is contained in:
Yifan Song 2024-08-14 03:21:44 +02:00 committed by GitHub
parent 0fce237d57
commit 1295c8754a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 249 additions and 169 deletions

View file

@ -320,12 +320,7 @@ mod tests {
let mut includes = HashSet::new();
let mut excludes = HashSet::new();
let must_compile = has_test_property(&properties, "compile");
let doc = if must_compile {
compile_doc_for_test(ctx)
} else {
None
};
let doc = compile_doc_for_test(ctx, &properties);
for kk in properties.get("contains").iter().flat_map(|v| v.split(',')) {
// split first char