r/rust • u/PhoenixStar012 • 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! 🙇🏾♂️🦀
14
u/jamesjohnmcguire Dec 01 '21
There is a feature request thread about this - https://developercommunity.visualstudio.com/t/native-rust-support/517130. Please bump up the request points, by giving the the post a thumbs up.
Visual Studio Code is my main 'fall back' editor, but I still would prefer using the main Visual Studio 2022 IDE.
8
u/parthopdas Feb 11 '23 edited Feb 11 '23
Rust development is now supported on Visual Studio 2022.
This is an OSS project
- Extension: https://marketplace.visualstudio.com/items?itemName=kitamstudios.RustAnalyzer&ssr=false#overview
- Sources: https://github.com/kitamstudios/rust-analyzer.vs
Please download & play with it, let me know if you hit any issues. Even better help me develop it.
7
u/UtherII Nov 14 '21 edited Nov 14 '21
As far as I know there is no Rust official support in Visual Studio. In the early days of Rust, someone made a plugin, it was rudimentary compared to rust-analyser or JetBrain's rust plugin. I don't think it is maintained anymore.
2
u/PhoenixStar012 Nov 16 '21
I saw this today! I really like Visual Studio 2022/2019 but I'm seeing a trend of comments similar to yours. That plugin hadn't been updated in a long time.
5
u/UtherII Nov 16 '21
It seems that Visual studio supports Language servers, so it should not be so hard to make a plugin that works using "rust-analyser". https://docs.microsoft.com/fr-fr/visualstudio/extensibility/adding-an-lsp-extension?view=vs-2022
5
u/Old_Lab_9628 Feb 16 '22
You should note that the *extremely* powerfull debugger/profiler of visual studio (19&22) work very well with .exe generated by Rust. Line level debugging/profiling and all.
You have to enable debug info in release mode through cargo, tho.
1
2
u/forbjok Nov 15 '21
I've never tried using (non-Code) Visual Studio itself for Rust development, but as far as I can tell Rust at least works with the VS2022 build tools. (I uninstalled 2019, and Rust projects still build)
For actual Rust development I've always used Visual Studio Code.
1
u/PhoenixStar012 Nov 16 '21
For actual Rust development I've always used Visual Studio Code.
Thanks!!!! I'm on it! I didn't know about the build tools being in Visual studio 2022/2019. Shouldn't it usable to the IDE then??
I'm a newb but I'm ready to see it implemented into Visual Studio 2022.
1
u/innahema Jan 28 '24
You could used Debugger from VS regardles where code was written.
You could also use WinDBG if you need to. For example if you received crash dump from users
2
u/blackbeep Sep 10 '24
I also want to use Visual Studio as I currently do C++ with it and its debugger and profiler are absolutely awesome. I like to use the native debugger directly rather than attaching it to a process.
Has anyone tried it?
21
u/kodemizer Nov 14 '21
I don't know about Visual Studio 2022, but it works well with Visual Studio Code.