[Self-Solved] Is there any workaround? In VSCode, "rust-analyzer.linkedProjects" doesn't support relattive path and ${workspaceFolder}

By default, A repository that doesn't have Cargo.toml in the top-level can't be detected by rust-analyzer in vscode.

I know rust-analyzer can detect Cargo.toml if I set "rust-analyzer.linkedProjects" in settings.json

Like this

  "rust-analyzer.linkedProjects": [
     // Must be specified absolute path.

NOTE: My Cargo.toml is in ${workspaceFolder}/subdir/Cargo.toml

"rust-analyzer.linkedProjects" doesn't support relative path and ${workspaceFolder}


  • I'm using the repository with a team member. Moreover, I'm using the repository from some of my computers.
  • We're sharing common .vscode/settings.json as our minimum default setting.

Is there any workaround to share the "rust-analyzer.linkedProjects" with teammates?

I solved this problem by myself.

"rust-analyzer.linkedProjects" should be set the path to Cargo.toml
But I added path to my project directory.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.