-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Use correct working directory for non-workspace proc-macro execution #19151
base: master
Are you sure you want to change the base?
Use correct working directory for non-workspace proc-macro execution #19151
Conversation
45799a1
to
88f4e24
Compare
The workspace root of the crate for which we are expanding macros should be used as current_dir. For dependencies from crates.io this matches the directory of the dependency itself. And same for local dependencies outside of the workspace I think. |
Hi @bjorn3 Isnt this the case when we use
Unless I am missing something please correct me! Additonally, I was trying to figure how I can change the |
|
@Veykril I agree with you for not using env, I was playing around with the snippet here rust-analyzer/crates/rust-analyzer/src/reload.rs however I haven't had any luck extracting the current_dir for the crates when being set in the mapping based on the current implementation, what do you think should be done here? |
Assuming bjorn's comment is correct we'll have to move the |
This comment has been minimized.
This comment has been minimized.
aa1a1ba
to
ec9d202
Compare
c1a9c43
to
a4771a2
Compare
@@ -362,6 +364,8 @@ struct CrateData { | |||
repository: Option<String>, | |||
#[serde(default)] | |||
build: Option<BuildData>, | |||
#[serde(default)] | |||
cwd: Option<Utf8PathBuf>, |
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.
cwd: Option<Utf8PathBuf>, | |
proc_macro_cwd: Option<Utf8PathBuf>, |
@davidbarsky for input here, unsure if we need to model this in the project json payload or not but I don't think we can derive the correct one from the data.
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.
I think for rust-project.json payloads, we should be conservative and mimic what Cargo does, but I'm not 100% sure.
7ad8987
to
94cf6fa
Compare
test outputs need updating |
8bd4bc7
to
4b0895e
Compare
4b0895e
to
3a31741
Compare
@Veykril updated, lmk if theres anything else missing! |
No description provided.