Skip to content
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 macro calls in eager macros for IDE features #16834

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Mar 14, 2024

Basically hovering concat and env in include!(concat!(env!("OUT_DIR"), "/foo.rs")) now works and highlights as expected.

This also fixes a few bugs/problems to make it work. Prior we set the call site span to the entire macro call which is kind of wrong, typing inside the call would invalidate the span causing us to leak MacroCallLocs whenever that happened. The same happened for attributes both of which now define their path as the call site.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 14, 2024
@Veykril
Copy link
Member Author

Veykril commented Mar 14, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 14, 2024

📌 Commit fad6104 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Mar 14, 2024

⌛ Testing commit fad6104 with merge 12eba1b...

bors added a commit that referenced this pull request Mar 14, 2024
feat: Support macro calls in eager macros for IDE features

Basically hovering `concat` and `env` in `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` now works and highlights as expected.

This also fixes a few bugs/problems to make it work. Prior we set the call site span to the entire macro call which is kind of wrong, typing inside the call would invalidate the span causing us to leak `MacroCallLoc`s whenever that happened. The same happened for attributes both of which now define their path as the call site. The def site spans of macros are also wrong, but I'll fix that in a follow up as that could have incrementality issues (as we need to parse the files).
@bors
Copy link
Contributor

bors commented Mar 14, 2024

💔 Test failed - checks-actions

@Veykril
Copy link
Member Author

Veykril commented Mar 14, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Mar 14, 2024

📌 Commit d085ade has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Mar 14, 2024

⌛ Testing commit d085ade with merge 14558af...

@bors
Copy link
Contributor

bors commented Mar 14, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 14558af to master...

@bors bors merged commit 14558af into rust-lang:master Mar 14, 2024
11 checks passed
@Veykril Veykril deleted the macarons branch March 14, 2024 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants