about summary refs log tree commit diff
path: root/crates/proc-macro-api/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-06 11:47:46 +0000
committerbors <bors@rust-lang.org>2023-12-06 11:47:46 +0000
commitcc8faa697c9b2963886bcf035ac0e98d70bd2b18 (patch)
treef2e452958747cd4f724557c9f6274a5701a55bd1 /crates/proc-macro-api/src
parent05df6c52cac9f5ce37a543a0b81d3bd6a1ec9d6d (diff)
parent9cb13b6efb2578dedb8521cf9442c56df50f8d0b (diff)
Auto merge of #16034 - Veykril:ide-macro-improvements, r=Veykril
feat: Allow navigation targets to be duplicated when the focus range lies in the macro definition site

![Code_KI1EfbAHRZ](https://github.com/rust-lang/rust-analyzer/assets/3757771/2cc82e5c-320f-4de2-9d55-fe975d180f2a)

Basically if a name of an item originates from the macro definition we now point to that as well as the creating macro call.

Big diff because I also made `FileId`s field private due to some debugging I had to do (having a searchable constructor makes things easier).
Diffstat (limited to 'crates/proc-macro-api/src')
-rw-r--r--crates/proc-macro-api/src/msg.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/proc-macro-api/src/msg.rs b/crates/proc-macro-api/src/msg.rs
index dd882d82fb6..1d3e45aff38 100644
--- a/crates/proc-macro-api/src/msg.rs
+++ b/crates/proc-macro-api/src/msg.rs
@@ -147,8 +147,10 @@ mod tests {
     use super::*;
 
     fn fixture_token_tree() -> Subtree<SpanData> {
-        let anchor =
-            SpanAnchor { file_id: FileId(0), ast_id: ErasedFileAstId::from_raw(RawIdx::from(0)) };
+        let anchor = SpanAnchor {
+            file_id: FileId::from_raw(0),
+            ast_id: ErasedFileAstId::from_raw(RawIdx::from(0)),
+        };
         let mut subtree = Subtree {
             delimiter: Delimiter {
                 open: SpanData {