4 ms·
Big fan of rust-analyzer and have been using it since early alpha. Much better than RLS and approaching all the features in the Rust plugin for Clion/JetBrains.
by zbowling 6y ago
Big fan of rust-analyzer and have been using it since early alpha. Much better than RLS and approaching all the features in the Rust plugin for Clion/JetBrains. Got me off Clion during WFH because of the massive memory/CPU requirements of using a big IDE on a laptop when developing.
Rust being a terse language with generics and macros, sometimes figuring out what type an object is is hard and can easily get lost. Rust analyzer + vscode instantly gives context visually in all my code and even names types better than when the compiler errors at you when you get it wrong. This is especially true when dealing with a lot of async rust and you need to know the exact fully declared type of an object so you can fully decl it's type for a pin/box to pass around. Game changer. Being able to use to jump to definition is a huge win. I can walk code so much easier now and understand issues without a lot of mental energy or digging. It also updates in realtime as I code.
Big productivity boost I know for a lot of devs on Fuchsia. It would take me at least twice as long to get up with a new crate and be productive with it. The same is true as my own code base grows and I can't keep it all in my memory and remember. Impossible to stay as productive as code grows in rust without something like this anymore.
Also a huge win for the fact that it works remotely with vscode's remote features so I can have my code + rust-analyzer on my big linux machine remotely but still edit that code and get the context locally on my dinky/slower/older macbook.
My only wish is that it eventually gains some of the deeper refactoring features in vscode you can still get in Rust + Clion/JetBrains. Almost there.
- monadic3 6y agoStill waiting on my favorite jetbrains feature—show type of selected expression. Probably the single most used IDE feature in my toolbox when I used scala.
- ibraheemdev 6y agoIt looks like this is blocked upstream by the language server protocol not passing the current selection for hover requests [0]. 0: https://github.com/microsoft/language-server-protocol/issues/377 https://github.com/microsoft/language-server-protocol/issues...
- the_duke 6y agoWith inline hints you can get something somewhat similar, although they can get very annoying with complex types. But extremely useful in long method chains.
- Nullabillity 6y agoAt least in Emacs, it shows the type as a tooltip if I hover over the closing paren of a function call.
- CryZe 6y agoWorks in VSCode too, not sure what specifically their problem is.
- matklad 6y agoFWIW, this should be relatively easy to implement. Looking at all the pieces which implement https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/dev/lsp-extensions.md#expand-macro https://github.com/rust-analyzer/rust-analyzer/blob/master/d... should given enough knowledge to do this.
- mths 6y ago> It also updates in realtime as I code. If anyone knows how to turn this off in vim/ale, I'd appreciate it.
- j-krieger 6y agoThere should be an option to turn on cargo check only on file save
- mths 6y agoI use cargo as my linter now, but I'd like to use analyzer on file save
- addcninblue 6y agoTake a look at neovim 0.5 beta [0]. It has native support for LSP [1], and it's on par with other editors. [0]: https://github.com/neovim/neovim https://github.com/neovim/neovim [1]: https://neovim.io/doc/user/lsp.html https://neovim.io/doc/user/lsp.html
- mths 6y agoIf you can please let me know how to turn this off in neovim with its native LSP support, I'd appreciate it.
- matklad 6y agoIt is unclear what exactly you wish to turn off, but you might be looking for this option: https://rust-analyzer.github.io/manual.html#rust-analyzer.diagnostics.enable https://rust-analyzer.github.io/manual.html#rust-analyzer.di...