-
Notifications
You must be signed in to change notification settings - Fork 2
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
Can't launch executable in a workspace #7
Comments
Side-note: thanks for creating this. I wanted this for a while and was mentally preparing myself for making a wrapper myself 😅 |
Thanks for the issue! Sorry for the late response, was on vacation getting some sun :) Yes, this is due to workspaces, which I haven't programmed support in for yet. The existence of a basic workspace changes the target directory, which breaks the path resolution. However, to support workspaces, I also have to support navigating up the directories to resolve to a single workspace, as well as virtual workspace identification. Not too difficult, just have to put some effort into it. As for #5 - if it provides the output information necessary, it would fix this. However, I do believe (and I have to check again) that that happens to be the missing information preventing me from relying on it. |
Briefly looking at https://github.com/rust-lang/rust-analyzer/blob/master/crates/project-model/src/cargo_workspace.rs, it appears rust-analyzer itself relies on Although, going one step further, since rust-analyzer already collects all this info, maybe there's a way to get this info out of rust-analyzer server itself, without repeating same steps in VS extension? |
Oh, interesting! I'll have some free time this weekend and next week to look into this. I like the idea of seeing what we can extract from rust-analyzer. That does mean dipping into intercepting / sending our own language server requests, which I haven't done so far and is undiscovered territory. I do like the idea of not having to manage our own TOML code, so #5 applying to this would be nice. |
I have a project structure like the following:
mylib/Cargo.toml
includesmyapp
as a workspace member:Visual Studio correctly shows
myapp.exe
as a target, and, via Rust Analyzer, invokes cargo to compile it, but then fails to launch saying that it's unable to start.../mylib/myapp/target/debug/myapp.exe
. The reason, of course, is that in a workspace the target was produced under.../mylib/target/debug/myapp.exe
, aka at the root of the project.I suspect this is something that would be fixed by #5, but meanwhile perhaps a simple fix would be to always look for
target
folder at the root.The text was updated successfully, but these errors were encountered: