Within the .vscode folder is a launch.json file which I would like to use as a generic file for all of my Rustlang folders.
Each folder has the src folder where the Rustlang source file is, and also a target folder with the usual debug, release and doc folders.
I have my vscodeworkspace set to ~/code/rust and I would like to set up my launch.json with the necessary macros to expand generically according to which source file is open at the time.
I am aware that I can get the full path of the source using the ${file} macro but of cource the debug folder is in a parallel structure to the src folder. How can I build a generic reference to the debug folder?
If the worst comes to the worst, I'll keep a separate launch.json for each Rustlang project and hard code the paths therein, but obviously I would prefer to use the shared launch.json file.
[package]
name = "guessing_game"
version = "0.1.0"
authors = ["carlca <carl.caulkett@gmail.com>"]
[dependencies]
rand = "0.3.14"
[[bin]]
name = "guessing_game"
path = "src/guessing_game.rs"
The only manual change I have to make is to rename the default main.rs that the cargo new <name> produces, and to add the [[bin]] section to the cargo.toml file. Both these tasks can and will be done by a shell script which I will do tomorrow, as it is getting late here!
I've called it rs_new.sh and I have an alias rs_new pointing to it. All I have to do now is to run rs_new <name> and it makes a <name>.rs which can be built and debugged in VSCode. Anyone wanting to use this may have to change the path names to suit, and I'm sure that because of my lack of experience in Rustlang matters, I will no doubt come up against a glaring deficiancy in this little project. But, it will do for me for now!
Thanks, but my solution has the distinct advavantage of actually working with the directory structure described in the tweet, while the suggestion above fails!
This is excatly what I was looking for. By specifying the manifest path as shown, I am able to compile projects that are subprojects of a larger git tree.