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: Implement a rust-analyzer span backed proc-macro server mode #16088

Merged
merged 12 commits into from
Dec 22, 2023

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Dec 11, 2023

This implements the basic span APIs. Basically anything that doesn't require talking back to the client for information access.

This also commits our syntax fixup marker to use an ErasedAstFileId of !0-1 aka 0xffff_fffe, instead of using a dummy FileId as a marker, as we need that for the SourceFile API to be implementable. The reason as to why the server needs to know about this at all is to prevent it from creating invalid fixup spans which could make r-a panic.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 11, 2023
@Veykril Veykril force-pushed the proc-macro-srv-2 branch 4 times, most recently from f3543fc to 9c66d9f Compare December 15, 2023 17:29
@bors
Copy link
Contributor

bors commented Dec 18, 2023

☔ The latest upstream changes (presumably #16144) made this pull request unmergeable. Please resolve the merge conflicts.

@Veykril Veykril marked this pull request as ready for review December 22, 2023 08:46
@@ -770,3 +771,15 @@ fn option_env_expand(

ExpandResult::ok(expanded)
}

fn quote_expand(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very interesting macro, it's a builtin macro that is actually backed by a proc-macro that rustc loads from the proc_macro library https://doc.rust-lang.org/proc_macro/fn.quote.html! Unsure how we can hook that up for now, but that might require this part to be nightly gated as well

@Veykril Veykril force-pushed the proc-macro-srv-2 branch 3 times, most recently from 0b02ea2 to cf68a95 Compare December 22, 2023 09:06
@Veykril
Copy link
Member Author

Veykril commented Dec 22, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Dec 22, 2023

📌 Commit 5761b50 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 22, 2023

⌛ Testing commit 5761b50 with merge 20e09c6...

@bors
Copy link
Contributor

bors commented Dec 22, 2023

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 20e09c6 to master...

@bors bors merged commit 20e09c6 into rust-lang:master Dec 22, 2023
10 checks passed
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