-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: add proc-macro rebuild on save option #16011
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: add proc-macro rebuild on save option #16011
Conversation
Signed-off-by: ClSlaid <[email protected]>
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.
Regarding testing, we don't really have the infra for that yet. So manual testing that it works suffices. https://github.com/rust-lang/rust-analyzer/blob/0840038f02daec6ba3238f05d8caa037d28701a0/docs/dev/debugging.md
You will also need to run the rust-analyzer
crate tests to regenerate the config,json
if self.proc_macro_changed && self.config.script_rebuild_on_save() { | ||
self.fetch_build_data_queue | ||
.request_op(format!("proc-macro or build script source changed"), ()) | ||
} |
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.
Hmm, so there is a problem with this for us here. Currently we set the proc_macro_changed
flag whenever a change comes in for one of the sources, but those changes are not necessarily commited yet (saved), so with the current setup here we would ask for server rebuilds on every keystroke! We should instead move the op request to the DidSaveTextDocument
handler (and then also reset the proc_macro_changed
flag
Signed-off-by: 蔡略 <[email protected]>
Thanks! |
☀️ Test successful - checks-actions |
Related: #15033
I need some advice on how to test it.