-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Conversation
f3543fc
to
9c66d9f
Compare
☔ The latest upstream changes (presumably #16144) made this pull request unmergeable. Please resolve the merge conflicts. |
9c66d9f
to
81928c9
Compare
@@ -770,3 +771,15 @@ fn option_env_expand( | |||
|
|||
ExpandResult::ok(expanded) | |||
} | |||
|
|||
fn quote_expand( |
There was a problem hiding this comment.
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
0b02ea2
to
cf68a95
Compare
cf68a95
to
9e8e124
Compare
@bors r+ |
☀️ Test successful - checks-actions |
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
aka0xffff_fffe
, instead of using a dummy FileId as a marker, as we need that for theSourceFile
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.