News for hackers. Stuff that matters.
Re:Rust-Analyzer Architecture by zbowling on Thursday February 04, 2021 @11:57AM (#26027191)
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.

Re:Rust-Analyzer Architecture by monadic3 on Thursday February 04, 2021 @12:06PM (#26027310)
Still 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.
Re:Rust-Analyzer Architecture by ibraheemdev on Thursday February 04, 2021 @12:28PM (#26027562)
It 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...

Re:Rust-Analyzer Architecture by matklad on Thursday February 04, 2021 @05:14PM (#26030415)
FWIW, this should be relatively easy to implement. Looking at all the pieces which implement https://github.com/rust-analyzer/rust-analyzer/blob/master/d... should given enough knowledge to do this.
Re:Rust-Analyzer Architecture by Nullabillity on Thursday February 04, 2021 @01:48PM (#26028491)
At least in Emacs, it shows the type as a tooltip if I hover over the closing paren of a function call.
Re:Rust-Analyzer Architecture by CryZe on Thursday February 04, 2021 @04:16PM (#26029900)
Works in VSCode too, not sure what specifically their problem is.
Re:Rust-Analyzer Architecture by the_duke on Thursday February 04, 2021 @12:47PM (#26027799)
With inline hints you can get something somewhat similar, although they can get very annoying with complex types. But extremely useful in long method chains.
Re:Rust-Analyzer Architecture by mths on Thursday February 04, 2021 @06:54PM (#26031222)
> It also updates in realtime as I code.

If anyone knows how to turn this off in vim/ale, I'd appreciate it.

Re:Rust-Analyzer Architecture by addcninblue on Thursday February 04, 2021 @08:45PM (#26032113)
Take 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 [1]: https://neovim.io/doc/user/lsp.html

Re:Rust-Analyzer Architecture by mths on Thursday February 04, 2021 @09:33PM (#26032393)
If you can please let me know how to turn this off in neovim with its native LSP support, I'd appreciate it.
Re:Rust-Analyzer Architecture by matklad on Friday February 05, 2021 @03:17AM (#26034187)
It 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.di...
Re:Rust-Analyzer Architecture by j-krieger on Thursday February 04, 2021 @07:02PM (#26031272)
There should be an option to turn on cargo check only on file save
Re:Rust-Analyzer Architecture by mths on Thursday February 04, 2021 @08:16PM (#26031913)
I use cargo as my linter now, but I'd like to use analyzer on file save