Skip to content

ProcMacroSrv executed outside of workspace directory #11518

Closed
@mattsse

Description

@mattsse

rust-analyzer version: (eg. output of "Rust Analyzer: Show RA Version" command)
rust-analyzer version: 02904e9 2022-02-14 stable

rustc version: (eg. output of rustc -V)
rustc 1.58.1 (db9d1b20b 2022-01-20)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTUP_HOME or CARGO_HOME)

It seems like during proc-macro expansion in ProcMacroSrv::expand the task's current dir is not the workspace directory.
I'm not sure how to debug this properly but what I suspect is happening is that the cwd and env vars of the ExpandMacro are not the workspace and workspace env vars. so that, if a proc-macro that expands depending on CARGO_MANIFEST_DIR and expects this path to point to the current workspace, it can generate different token trees for RA inside ProcMacroSrv.

Metadata

Metadata

Assignees

Labels

C-supportCategory: support questionsS-unactionableIssue requires feedback, design decisions or is blocked on other work

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions