kitamstudios / rust-analyzer.vs

Rust language support for Visual Studio 2022
https://marketplace.visualstudio.com/items?itemName=kitamstudios.RustAnalyzer
Other
147 stars 11 forks source link

"Key 'program' is not set to launch configuration and /or is not a string" #29

Open erenturkm opened 1 year ago

erenturkm commented 1 year ago

Hi,

I am using Visual Studio 2022 (Windows) Version 17.6.3 with rust-analyzer.vs v2.0.154.

I open one of the rust files, click on run or debug I get this error.

parthopdas commented 1 year ago

thanks. which error?

please use https://www.screentogif.com/ to show the repro.

erenturkm commented 1 year ago

VS2022Error I had a similar problem with vscode and it added the launch configuration automatically.

parthopdas commented 1 year ago

thank you for the repro. it makes sense now.

so i'll have to disable setting anything other than cargo.toml or an example rs from the "currently selected document list". mainly because a rust project may have multiple .rs files and those are not really "startup projects".

in this case do you need to select main.rs for any specific reason? could you not select the contain toml file or the containing project from the select target drop down.

erenturkm commented 1 year ago

VS2022Error2 cargo.toml file is not on this list, selecting Exe works or selecting cargo.toml from solution explorer, right click/debug will work but these are not the default behaviors, In c# projects we are used to start debuging from the startup project file.

Probably customizing the error message to hint on what to do, instead of a cryptic message would help a lot.

parthopdas commented 1 year ago

customizing the error message is a good idea. it will be in the next release

Guan-love-Ling commented 1 month ago

Hi,

I am using Visual Studio 2022 (Windows) Version 17.6.3 with rust-analyzer.vs v2.0.154.

I open one of the rust files, click on run or debug I get this error.

hey, guys, I get the right way to run rust-Project ,look at my picture image Everything is OK image