Generate `rust-project.json` in an arbitrary directory.
I want to place rust-project.json in an arbitrary directory instead of the project root, but simply moving it does not work because rust-project.json has relative paths to modules. Could you please suggest me any workaround?
Hi @reiyw
There is unfortunately no workaround. We did hear this feature request in the past, it does sound like an important use case to cover. We just have been occupied by other issues. If you have capacity to spend some time on a PR, I'm happy to guide you.
Hi @hlopko
Thank you for your reply! I'm not familiar with Bazel extensions, but I'm willing to contribute. I'll take a closer look at the implementation this weekend.
One note (that I didn't think about before :) - I use VSCode, and one reason to create a VSCode workspace in a subdirectory is so I don't see all the unrelated packages. But that can be achieved by exclude-ing unwanted packages in VSCode settings.json.
One think to be careful about - creating a workspace in a subdirectory can break debugging in VSCode.
One think to be careful about - creating a workspace in a subdirectory can break debugging in VSCode.
You can do debugging in vscode?! How?! 🙏 😄
Don't want to derail this thread but that'd be an awesome doc to have somewhere.
I agree there should be a doc. This is what I have in my notes:
Debugging with CodeLLDB, assuming your VSCode workspace is rooted at the workspace directory, you setup your launch.json as follows:
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug //foo/bar:yolo",
"program": "${workspaceFolder}/bazel-bin/foo/bar/yolo",
"args": [],
"sourceMap": {
".": "${workspaceFolder}/"
},
},
]
}