-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support for GOTO def from *inside* files included with include! macro #16439
Conversation
Thanks for looking into this! I've played around with it a bit in a test project, where it's working fine, and also in my real project where Can you clarify what you mean by "Only one file which calls include! will be tracked."? Does this mean that we only track only track one In my test project it looks like this is working for multiple includes (e.g. If you're curious to see the original project that motivated this issue it's available https://github.com/googlefonts/fontations/; specifically both the |
@cmyr Thanks for your positive feedback! fn eat() {
apple();
} file fn apple() {
}
include!("A.rs"); file fn apple() {
}
include!("A.rs"); When we goto def in |
okay yes I think that is an intuitive and reasonable restriction that A) indicates that the user probably has more serious problems and B) I forget what I was going to say for B). For what it's worth I would probably phrase this as, "A given file can only be tracked via Ultimately unimportant nitpicking though, thank you for the patch, this will significantly improve our quality of life. :) |
Thanks! The mapping logic looks correct to me. The main issue here is that non-item level includes won't work with this, but this was known from the start given the lazy nature of rust-analyzer so that will most likely never work. @bors r+ |
☀️ Test successful - checks-actions |
internal: Remove unnecessary usages of ExpansionInfo And some follow up simplifications to #16439
close #14937
Try to implement goto def from inside files included with include! macro.
This implementation has two limitations: