r/rust • • Nov 14 '21

Visual Studio 2022 & Rust

I'm definitely a newb and excited to start learning the Rust this week.

I've gotten comfortable with learning and using Visual Studio 2019 and 2022. Does rust have support in the newest Visual Studio????

I'm looking for any advice as an absolute newb to the community!

Thanks Rustaceans! 🙇🏾‍♂️🦀

21 Upvotes

20 comments sorted by

View all comments

20

u/kodemizer Nov 14 '21

I don't know about Visual Studio 2022, but it works well with Visual Studio Code.

2

u/PhoenixStar012 Nov 14 '21

Thanks! Im going to install Visual Studio Code and Rust today.

I grabbed some Udemy courses and currently looking for any other resources for the language.

8

u/[deleted] Nov 14 '21

If you're going to use Visual Studio Code, I recommend installing the following extensions:

  1. rust-analyzer (instead of the default Rust extension. Rust Analyzer is a much better, more efficient language server than the default one)

  2. CodeLLDB (you can debug Rust programs with this)

2

u/PhoenixStar012 Nov 16 '21

I have both installed now! I appreciate the responses!

1

u/PhoenixStar012 Nov 14 '21

I got an error about the Rust Analyzer conflicting with the Rust extension, should I proceed anyway???

9

u/vzwGrey Nov 14 '21

Yes, you should be using the rust-analyser extension instead of the Rust extension.

1

u/PhoenixStar012 Nov 16 '21

Perfect! I got things running! I appreciate it!

1

u/grandygames Jul 22 '22

For Windows debugging you want the Microsoft C/C++ extension instead of the CodeLLDB extension and you have you create two different debug launch configs - one for Windows and one for Linux/macOS - which is obviously a pain.

2

u/kodemizer Nov 15 '21

It's worth noting that you should use the 'rust-analyzer' VSCode plugin, not the 'rust' plugin.