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

@ -30,8 +30,7 @@ impl StatefulRequest for RenameRequest {
validate_renaming_definition(&lnk)?;
let def_use = ctx.def_use(source.clone())?;
let references = find_references(ctx, def_use, deref_target)?;
let references = find_references(ctx, source.clone(), doc.as_ref(), deref_target)?;
let mut editions = HashMap::new();