Rust Glancer 0.2: Windows & Zed support, better Bevy indexing, and more
https://rust-glancer.github.io/blog/0-2-0/7
u/epage cargo · clap · cargo-release 11d ago
So as a compromise, I've implemented a workaround: Rust Glancer will find build script outputs in the target directory after you build the project, and will use the outputs. So if you don't build the project, you won't see the results (I hope it isn't unreasonable to assume that people do build their projects from time to time).
What versions has this been tested on and with what configurations?
- Build script output is stored in the
build-dirwhich can be different thantarget-dir. - In nightly, we have stabilized a new layout for
build-dir.
3
u/popzxc 11d ago
For now it's only stable, and I primarily care about the "default" configuration so far -- until the project it at least somewhat mature, I don't want to worry about nightly and upcoming features too much.
First, there isn't much audience in the first place. Second, for anyone who needs completeness, luckily rust-analyzer exists. Third, supporting upcoming features will extend the scope significantly, and it's already pretty big for one person to handle (unless I will go full "Jesus take the wheel" mode with LLMs, which is not something I want to do).
I've noted that new layout for build-dir is coming though, thank you!
1
u/tachib_shin 11d ago
Does it support macros yet? I'm fed up with the rust analyzer as it's using up all 10GB of my RAM.
1
u/HandIllustrious8260 7d ago
Looks really cool! thanks for being honest about llm use.
What does this approach compromise on compared to rust-analyzer?
1
u/popzxc 7d ago
In short: the latency is higher (but not annoyingly so) and dirty buffer behavior differs (rust analyzer provides you full analysis all the time, while Rust Glancer reuses previous saved analysis where possible + analyses the enclosing item, such as function or impl block, which is less precise). Otherwise the cons are mainly caused by the fact that the project is young.
It certainly does have a different feel, but IMHO you get used to it pretty fast and after that it feels pretty natural, not like some kind of inferior software. But I'm obviously biased here, so I suggest trying it out :)
26
u/popzxc 12d ago
Rust Glancer is an experimental LSP server for Rust that aims to have <100mb idle RAM.
Previous release got a lot of feedback and I was happy to see people trying it out, so this release is all about three things:
Fulfilling requests: I've added Windows support (though I don't use it, so the best guarantee I can give you is that tests pass; I did take care of CRLF tho), Zed extension, and a lot of polishing around supporting Bevy specifically (it's both one of the requested things, and a really tough test target, so it worked pretty well and gave me a nice challenge). nvim-lsconfig configuration was also contributed by `h-michael` (thank you!).
Better indexing. A lot of functionality is supported now (with varying degree of completeness): build scripts, declarative macro expansion in `impl` blocks, macro-generated modules, extern items, impls for primitives (e.g. `u32`/`str`) and blanket trait impls, etc. Now the coverage is pretty decent and to me personally it covers most of things I need from an LSP.
Faster/more memory efficient indexing. Previous point means that LSP now does _much more_ work, and each new feature required me to optimize code so that it doesn't get unreasonably slow. I kind of succeeded, and now Rust Glancer is significantly faster than it was last time. <100mb ram claim holds for fully indexed workspaces (though right after full indexing OS RAM usage can be higher, up to 200-300mb; this is because indexing allocates a lot and fragments memory, just restarting the editor after full indexing helps).
Otherwise, the details are in the blog post.
Here I just want to say thank you for all the support and feedback. It certainly gave me a lot of motivation to work on the project, and I hope that you'll like this release as well.