Skip to content

Instantly share code, notes, and snippets.

@sam0x17
Last active May 1, 2023 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sam0x17/29ab441615464e7033739f81c639e3a4 to your computer and use it in GitHub Desktop.
Save sam0x17/29ab441615464e7033739f81c639e3a4 to your computer and use it in GitHub Desktop.
new solution for getting separate workspace/project-specific build directory for rust-analyzer

The following will allow you to automatically have a workspace-specific separate build directory for rust-analyzer:

in userSettings.json (vscode):

"rust-analyzer.server.extraEnv": {
  "CARGO_TARGET_DIR": "target/analyzer"
},
"rust-analyzer.check.extraArgs": [
  "--target-dir=target/analyzer"
]

adapted from: rust-lang/rust-analyzer#6007 (comment) and rust-lang/rust-analyzer#6007 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment