IDE Setup For Rust Development

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024
  • Today I'm going over my IDE setup for Rust development!

Комментарии • 124

  • @letsgetrusty
    @letsgetrusty  2 года назад +12

    📝 Get your *FREE Rust cheat sheet* : www.letsgetrusty.com/cheatsheet

    • @lowlevelvirtualman8006
      @lowlevelvirtualman8006 2 года назад +3

      To be honest it looks quite suspicious how you want to get our emails ;0

    • @letsgetrusty
      @letsgetrusty  2 года назад +6

      @@lowlevelvirtualman8006 I only use your email to send out valuable information and eventually share courses that I'm in the process of building. Your data will never be sold or shared with advertisers.

    • @user-jt7wb3zc1m
      @user-jt7wb3zc1m 2 года назад +1

      @@lowlevelvirtualman8006 Yeah Im also doubt tit, because this mailing may contain the Rust lang virus! 🤔

    • @babuOOabc
      @babuOOabc Год назад +1

      and what its for crate search's?

  • @cruz9617
    @cruz9617 2 года назад +76

    You're basically my Rust mentor. Thanks for everything fren, keep it up!

    • @sydpao2224
      @sydpao2224 2 года назад +4

      lol, i agree

    • @MikeAnSean
      @MikeAnSean 2 года назад +4

      agreed, bogdon is a legend

  • @BrianMelancon
    @BrianMelancon Год назад +11

    Updates for one year later: 1. Rust-analyzer has in now officially become the official plugin (officially). 2. Better TOML is depreciated, replaced with Even Better TOML.

  • @exoticcoder5365
    @exoticcoder5365 2 года назад +6

    3:51 Crates extension is very handy ! Also , Error Lens and Tabnine ! Thanks so much 🙏🏻👍🏻 !

  • @WarrenMarshallBiz
    @WarrenMarshallBiz 2 года назад +3

    Absolutely fantastic, thank you! I'm teaching myself Rust and now I feel like I have a great environment to do that in.

    • @esparafucio
      @esparafucio Год назад +1

      Fancy seeing you here. Miss your videos.

  • @_jdfx
    @_jdfx 2 года назад +4

    or Neovim with tree-sitter, rust-analyzer, rust-tools, cmp, you get completion, type annotations, and it's easy to add key bindings for rustfmt and "cargo build" or "cargo run"

  • @Akshit59018
    @Akshit59018 2 месяца назад

    I am new Rust. Thank you for the VSCode Setup, I really needed something like this!

  • @DrIngo1980
    @DrIngo1980 2 года назад +2

    Damn, nice overview. Didn't know about the last two extensions: TabNine AI and Error Lens. Installed right away! Good stuff. Good stuff. Thank you.

  • @TreeLuvBurdpu
    @TreeLuvBurdpu 2 года назад +16

    cargo-edit also seems like a good idea for adding/removing crates from the CLI. Not quite an IDE enhancement, but sort of.
    cargo install cargo-edit
    Then: cargo add

  • @zuggrr
    @zuggrr Год назад +3

    I would just add: Activate "format on save" in VS code. For automatic formatting by the rust-analyser. Thanks I use your video for when i change machines

  • @saivishnu725
    @saivishnu725 2 года назад +2

    Great timing, just made a fresh install of my OS and was downloading vscode when i got this notification 🔥👍

  • @user-lg7td1he3s
    @user-lg7td1he3s Год назад

    i like how slow you are and how you take time to explain i really like that thank you

  • @anthonytobin7
    @anthonytobin7 2 года назад

    Thanks for showing specific tools, and showing what they do!

  • @user-lg7td1he3s
    @user-lg7td1he3s Год назад

    thanks i am getting started with rust from C/C++ and this helped me a lot thank you

  • @dionysis_
    @dionysis_ 2 года назад +1

    Man, you are being extremely helpful. Well done 👏

  • @mindmaster064
    @mindmaster064 2 года назад +6

    These days I'm neovim with a bunch of plugins that do basically everything vscode does. I still like code for debugging more, however, debugging is often something you can just avoid if you're programming carefully. So, once in a great while when I get too creative for myself, lol.

    • @vorrnth8734
      @vorrnth8734 2 года назад

      Is there something Like the crate extension for neovim?

    • @mindmaster064
      @mindmaster064 2 года назад +2

      @@vorrnth8734 Nope. But, while this is convenient, you can do something like this in your Cargo.toml:
      [dependencies]
      rand = "~0" // any version < 1.0.0
      rand = "~0.7" // any version < 0.8 that is > 0.7.0
      rand = "0.*" // any version < 1.0.0
      rand = "1.*" // any version less than 1.0.0 < 2.0.0
      * by itself doesn't work, so don't do that. :D These will resolve to the highest update that your code supports, and is much better than hardcoding numbers in. (You should NEVER do that. The minor revisions are often security fixes and you want them.)

    • @vorrnth8734
      @vorrnth8734 2 года назад

      @@mindmaster064 thanks for the info

  • @somhrsh
    @somhrsh Год назад

    finally, i couldn't find the answer to why i need visual studio code and what should i do if i don't need it.... also thanks for being on point. (i just started with Rust, lets get rusty)

  • @diegof4083
    @diegof4083 2 года назад +2

    Even better toml

  • @gillesashley9314
    @gillesashley9314 4 месяца назад

    I just started Rust yesterday(12/04/2024). I'm optimistic about Rust and want to learn more about it, however my other self is thinking about job availability.

  • @_celebi90
    @_celebi90 5 месяцев назад

    jeez dude, your eyes better 2 years ago
    in your recent video you look like Neo without any sleep

  • @stephenmcconnell7868
    @stephenmcconnell7868 2 года назад +5

    Thank you for this. I was a Java developer for over 20 years. Before that COBOL, FORTRAN, Jovial (an Algol derivative), C/C++ and AS/400 RPG (with some Perl and other scripting languages mixed in as needed). I retired from development in 2017 and have been playing guitar in bars and restaurants for fun. However, I have recently been missing programming and have gotten back into it by learning Rust. I used IntelliJ for years and loved it, but looking at VSCode and your tutorial, it seems as though Rust is a VERY interesting language. The tutorial on VSCode is fairly complete, however what extension (if any) do you use for git? In IntelliJ you could see in the IDE what files were added, changed or committed. I used the command line git for the most part, but it might be nice to do it from within VSCode....
    Again, thanks. I'm going through your RUclips Tutorials and more and your references on cool projects and some of the Euclid project exercises are next. Hope to have them out on git as I progress.

    • @stevenlace7902
      @stevenlace7902 2 года назад

      VS Code has Git baked in, but you may want to install the GitLens Extension or GitKraken

    • @hv1461
      @hv1461 Год назад +2

      Funny how that works. I retired from tech, played bass in bar bands, it's fun but have missed tech and am learning rust now as a hobby.

    • @jaromor8808
      @jaromor8808 Год назад

      why not use Idea or CLion?

    • @stephenmcconnell7868
      @stephenmcconnell7868 Год назад

      @@jaromor8808 I used IntelliJ for 15 years and still maintain a Subscription to all of them. Currently, Rust is not as well supported with its plugin in IntelliJ as it is in VSCode. I think it is a little kludgy…. BUT if it gets better, I will probably switch back. I am very used to IntelliJ, but VSCode is something new to me and I’m enjoying working with it.

    • @JXQU3
      @JXQU3 10 месяцев назад

      Now RustRover released which is a fully featured Rust IDE from JetBrains. Its free for now too@@stephenmcconnell7868

  • @Soulis98
    @Soulis98 2 года назад +1

    I installed rust-analyzer in my vsc but I can see the type annotations?
    Help.

  • @turygin
    @turygin Год назад

    Thank you! Very useful 👍

  • @cariyaputta
    @cariyaputta 2 года назад

    Error Lens is a live saver. Thanks!

  • @daque1960
    @daque1960 2 года назад +7

    I am really interested in the Tabnine plugin and will probably install it before I restart learning Rust yet again.
    One thing I have been thinking about lately is if it would be good to start learning testing immediately after getting to the "Hello world!" stage and follow more of a test driven method from the start to make it my normal way to approach Rust. The same for Doc comments with example tests as soon as possible in the process. Anyone know of a test driven design tutorial that would be good for someone who still fights the borrow checker and lifetimes often?

    • @babatona
      @babatona 2 года назад

      Tabnine is really good and useful, and theres a video about visual representation of rust lifetime and borrow checker: ruclips.net/video/8M0QfLUDaaA/видео.html

    • @kevinmcfarlane2752
      @kevinmcfarlane2752 2 года назад

      Had most of those extensions. Didn't know about crates and Tabnine though.
      The Microsoft Learn - "Take your first steps with Rust" course has a module on automated tests, including documentation tests. But the course as a whole is not test driven. Still, you might find it useful.

  • @nerdbot4446
    @nerdbot4446 Год назад +1

    If you're on Linux and get a bootstrap error for rust-analyzer, saying it can't execute "rust-analyzer-x86_64-unknown-linux-gnu --version", make sure the binary has the executable flag set. This wasn't the case for me after installing the vscode plugin and I had to manually run chmod +x on the file. The exact path (and error) you can find in the output window of vscode

  • @AkosuaBiggles
    @AkosuaBiggles Год назад

    Thanks so much
    was very helpful

  • @BohdanTrotsenko
    @BohdanTrotsenko 2 года назад

    it's awesome to have that.
    I learned to write rust without a debugger )))
    Now I know what ext to install

  • @fenandamilanda2032
    @fenandamilanda2032 2 года назад +1

    my problem with rust analyzer is that even on good hardware it gets too slow on large projects, like taking 5 seconds after saving to get auto completion and other things

  • @AJ-et3vf
    @AJ-et3vf Год назад

    Great video! Thank you

  • @jimshtepa5423
    @jimshtepa5423 2 года назад +1

    спасибо большое, Богдан

  • @9SMTM6
    @9SMTM6 2 года назад +4

    I have the same setup except for Tabnine.
    How well does your setup work for you? For me it's not always the most stable experience, sometimes rust-analyzer just gives up or breaks in some other way.
    But that's not my main issue. That is reserved for code completion just breaking down for what feels like every other thing I write. And I often can't tell the reasons.
    Like, if I don't end my line with a semicolon it breaks the completion quite reliably. But even with that semicolon if often breaks. Sometimes it can complete attributes, sometime that dot breaks the analysis of the entire file.
    It doesn't just fail for attributes, it also often fails to complete plain variables in my code.
    The moment I finished what I was writing the analysis says it chdcks all out, but it doesn't offer any help along the way because in that moment it's hopelessly broken.
    I'd really love to know the reasons this happens, if I can do something against it. I wonder if Tabnine helps there, I guess I'll try. Because that is QUITE annoying for me, it means I have to consult the official documentation far more often than I'm used to, which breaks my flow.
    I guess one part of it is the general complexity of Rust code interpretation. Which I'm not ALWAYS a fan of.
    I LOVE type inference, but I'm not sure it's a good idea to have a later push into a vector determine the type of the elements. Type-inference should be limited to the statement and the stuff above (and with "statement" I include method chaining and closure argument inference, that's great).
    Maybe I am just too used to how Typescript does it, but I have thought about it, and I don't think I am strongly biased by that. To have a directed "flow of type information" makes things just a whole lot more predictable. The way it is one can have partially circular dependencies, thats super hard to reason about. And when the compiler decides it's too much for it, the things are already at a complexity that most coders are hopelessly lost.
    If you have a system that isn't perfect, and may require manual help, one should think strongly where one makes the system stops. Looking eg at Lifetimes. In that case the Rust designers were much more careful how far they were willing to go. They could've done more, but they didn't, it wasn't worth it, because it would've made for a very hard curve of understanding.
    I think when it comes to type inference the Rust designers overdid it a bit.
    It's not that hard to write Vec::::new() instead of Vec::new() every now and then but it makes things much easier both for the reader of that code, as well as the Rust compiler.

  • @flaviucomanese6322
    @flaviucomanese6322 2 года назад

    Thanks for the tips! Awesome job ❤

  • @AcidiFy574
    @AcidiFy574 Год назад +1

    What's the difference between:
    > RUST-analyzer vs Cross-RUST-Analyzer
    > Better-TOML vs Even-better-TOML
    ?????

  • @DataPastor
    @DataPastor 2 года назад

    Great video again, thanks for the tabnine idea.

  • @user-gl9yo8rz8k
    @user-gl9yo8rz8k 2 года назад +3

    Borrow checker + lifetimes + unittest = no debugger needed.

    • @user-gl9yo8rz8k
      @user-gl9yo8rz8k 2 года назад +1

      @pm4rcin If you need to debug tests or write tests for tests, then you are doing something wrong.

    • @CarrotCakeMake
      @CarrotCakeMake 2 года назад

      @@user-gl9yo8rz8k I think he means, when your test fails, how do you plan to find the reason without debugging? Short of formal verification, debugging is essential for complex code, btrees for example.

  • @bbenson59
    @bbenson59 2 года назад

    Extremely helpful. Thanks

  • @RicardoSilvaTripcall
    @RicardoSilvaTripcall 2 года назад

    Amazing tips, thank you !!!

  • @dev_jeongdaeri
    @dev_jeongdaeri 2 года назад

    great thanks for super awesome content!

  • @GhostRat__
    @GhostRat__ Год назад

    Me sits down to set up and ide on steam deck forgets keyboard.
    In another state

  • @philstubblefield
    @philstubblefield 2 года назад

    Thank you! So helpful.

  • @SUDSUDHIRKUMAR
    @SUDSUDHIRKUMAR 2 года назад

    It is helpful video for rusty.
    Thank you.

  • @lisovyy
    @lisovyy 2 года назад +1

    let’s go for vim setup 😉

    • @philstubblefield
      @philstubblefield 2 года назад

      Are you kidding? Emacs all the way! ;)

    • @peacemekka
      @peacemekka 2 года назад

      I use it. Its nice. I don't know if there is ai completion tho.

    • @lisovyy
      @lisovyy 2 года назад

      @@philstubblefield ahah, don’t go that way 🤣🤣

  • @datoubi
    @datoubi 2 года назад

    Binge watching all your videos right now. This one was especially useful. What's the song at the end called? I like it

  • @jayheikt
    @jayheikt 2 года назад

    Love your content!

  • @supremedeity9003
    @supremedeity9003 2 года назад

    I had the exact same plugins except for error lense and tabnine. I use Copilot usually.

  • @krome305
    @krome305 2 года назад

    Thanks bro!

  • @midewestmond9442
    @midewestmond9442 2 года назад

    Please can you create a video on rust and wasm we need to get into web development so bad

  • @danielgarcia1484
    @danielgarcia1484 2 года назад

    Very useful thanks

  • @SimonClarkstone
    @SimonClarkstone 2 года назад +1

    Unfortunately rust-analyser gives me the following error (so I will currently switch back to the other VSCode Rust extension that was working better - "rust-lang.rust"):
    ---
    rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file r:\workspace\aoc-2021\aoc-2021-18a\Cargo.toml
    Caused by:
    0: Failed to parse edition 2021
    1: invalid edition: "2021"

    • @philstubblefield
      @philstubblefield 2 года назад +1

      I've seen rust-analyzer display the same message via the Corrosion plugin for Eclipse. Very annoying, but closing and reopening the editor window has always worked for me.

  • @saaddahmani1870
    @saaddahmani1870 2 года назад

    I will try this... thanks.

  • @Robin-ws9fg
    @Robin-ws9fg 2 года назад

    Please make a serde and/or serde-json tutorial! After that you could do protobuff !!

  • @icaroamorim3123
    @icaroamorim3123 Год назад

    I use Rider Plugin for Rust.

  • @jonathanmoore5619
    @jonathanmoore5619 2 года назад +1

    muy bueno, gracias

  • @nacxxj7184
    @nacxxj7184 2 года назад +2

    Learned C/C++, now learning JS for frontend, will it a good choice for Backend to pick up Rust and webassembly?

    • @Elduque40
      @Elduque40 2 года назад +1

      Can use JavaScript/Ts for the backend as well or Java

    • @ChumX100
      @ChumX100 2 года назад +3

      Rust is one of the best languages for targeting Wasm imo. Now, Wasm itself is great in the browser if you have a use for more low-level code in your app. But if your app is more server-focused, you could probably simplify things by sticking to JS on the client. On the server-side you can go with pretty much anything and the choice will be domain/integration-specific, but Rust is a great choice there as well, very fast, very safe, and great dev-exp.

    • @MaryamMaqdisi
      @MaryamMaqdisi 2 года назад +1

      Which one feels the most comfortable to you? I second using JS or TS, or Java if you want a syntax closer to C.

  • @dev-rachid
    @dev-rachid 10 месяцев назад

    i have problem with rust-analyzer, it shows me this : [ERROR rust_analyzer::main_loop] FetchWorkspaceError:
    rust-analyzer failed to load workspace: Failed to load the project at ...
    Thank you

  • @leighwanstead3254
    @leighwanstead3254 2 года назад

    I use Linux vim which works everywhere.

  • @CoinBR
    @CoinBR Год назад

    I can't find rust-analyzer on the plugin marketplace. Is it still a thing?

  • @dibyojyotibhattacherjee4279
    @dibyojyotibhattacherjee4279 2 года назад

    Hello bogdan, for a beginner in rust, what type of setup would you recommend, vscode or clion one?

  • @juaneiros2100
    @juaneiros2100 2 года назад

    Could you do a video on how you debug Rust programs with CodeLLDB in VS Code?

  • @user-vm7we6bm7x
    @user-vm7we6bm7x 2 года назад

    after using extension you described I for some time found them all good except for last extension, tabnine. I wouldnt recommend it. there are times when it is useful but not for me

  • @rafaelcisnerosgomez7295
    @rafaelcisnerosgomez7295 2 года назад +1

    You 🤟🏽😎🎸!

  • @nickshv8727
    @nickshv8727 Год назад

    N E O V I M - all what you need

  • @skyy_xx
    @skyy_xx 2 года назад

    0:40 - I was suprised you left intellij IDE for probably whole night to hide indexing prompt

  • @rino19ny
    @rino19ny Год назад

    vscode - rust-analyzer, codeLLDB, better toml, crates, error lense, tabnine

  • @SiontheRapadant
    @SiontheRapadant Год назад

    I came here hoping for how to setup for visual studio, instead I got visual studio code. really let me down man

  • @bombrman1994
    @bombrman1994 Год назад

    can tabnine and copilot work together or I have to choose one ?

  • @KonflictYT
    @KonflictYT Год назад

    I had been using rust-analzyer and it was working perfectly and all of a sudden it no longer infers any types even if I explicitly type. Everything is represented by unknown and I cant find a fix for the life of me. Any suggestions are greatly appreciated. Ive restarted vscode, uninstalled and reinstalled rust-analyzer, switched to the pre-release and more. I havent been able to find the answer through the rust discord either

  • @VitaliySapronenko
    @VitaliySapronenko 2 года назад

    Is that last version of rust cheat sheet, or you gona improve it?

  • @sebsefyu
    @sebsefyu 2 года назад

    What do you think of Rust Syntax extension in VScode?

  • @kampkrieger
    @kampkrieger 2 года назад

    is there any way to get the DEBUG/RUN buttons from vs code to work? I find it uncomfortable that I have to go to the main file and main function every time I want to start debugging

  • @thurston04
    @thurston04 2 года назад

    How is rust-analyzer so fast for you? There is at least. 1-2 second delay on my system for suggestions to show up

  • @guilherme5094
    @guilherme5094 Год назад

    👍

  • @bartez8018
    @bartez8018 Год назад

    rust-analyzer or intellij rust?

  • @jnkconsultbv8274
    @jnkconsultbv8274 2 года назад

    Hello, I had the most of the extensions but can you give more explanations about tabnine ?

    • @letsgetrusty
      @letsgetrusty  2 года назад

      It’s AI powered auto complete. Check out the extension page for more details.

  • @blackmass4925
    @blackmass4925 Год назад

    I use neovim

  • @gogasos
    @gogasos 2 года назад

    BING BONG!

  • @krzyhoo
    @krzyhoo 2 года назад

    I installed the rust-analyzer plugin and sadly, the inlay type annotations are not visible. They are enabled in the config though... Am I missing something?

    • @letsgetrusty
      @letsgetrusty  2 года назад

      After installing rust-analyzer you will be prompted to install the language server. Did you do that? Do you see the Run/Debug annotations?

    • @krzyhoo
      @krzyhoo 2 года назад

      @@letsgetrusty no :( no debug|run and no prompt as well:-( can I trigger it manually?

    • @krzyhoo
      @krzyhoo 2 года назад

      @Ziad Ghalleb just wondering if you’re also on a macOS ?

    • @atinyflame265
      @atinyflame265 2 года назад

      By default it only works on Cargo projects.

  • @saab_9
    @saab_9 2 года назад

    What about sublime text editor with tabnine with rust addon ?

    • @letsgetrusty
      @letsgetrusty  2 года назад

      Sure that's another options. I'm not familiar with sublime.

  • @thanatosor
    @thanatosor 2 года назад

    Tabnine is like a joke.
    Which consume all your memory.

  • @gustavojoaquin_arch
    @gustavojoaquin_arch Год назад

    Neo vim is better btw

  • @friend7120
    @friend7120 2 года назад

    1. vim

  • @provokator-provocateur7603
    @provokator-provocateur7603 2 года назад

    Imagine being taught about Rust by a person named Bogdan.

  • @Elduque40
    @Elduque40 2 года назад

    Copilot 😎

  • @SpuxyYEZ
    @SpuxyYEZ 2 года назад +1

    1. i clicked because of title
    2. i see rust
    3. i see vscode
    4. im trying to see if its joke to show up vim
    5. i do not see vim
    6. i close this vid
    :(

  • @youtubeshortss.01
    @youtubeshortss.01 Год назад

    🤮🤢