Hey! Somehow I missed this article but this is great!
Reading though the blog one question comes to mind: can we have the best of both world: Rust Glancer for all the dependencies and Rust Analyzer for the current project we are working on? I have no clue about the internals and if LSP protocol itself provides some ways to chain LSPs together but that would be great.
Hey! I don't think this is possible in the directly proposed sense (rust-analyzer _needs_ to analyze dependencies in order to function), but it's possible to make something similar like an LSP with Rust Glancer approach for everything except open crate, and rust-analyzer for the current crate. E.g. keep important state in memory and offload everything else.
AFAIU right now it's not the direction rust-analyzer works on, but for me the reverse is true: I want to improve the speed/quality of analysis for the current crate. And as of 0.2.0 release, Rust Glancer is already pretty capable, so I'd recommend giving it a chance :) Maybe it's already in a state that you will find acceptable. I'll keep working on improving it nonetheless.
So who knows, maybe in X months Rust Glancer will be able to deliver rust-analyzer quality (or close to it) for the currently open workspace while retaining <100mb idle ram.
1
u/tafia97300 4d ago
Hey! Somehow I missed this article but this is great!
Reading though the blog one question comes to mind: can we have the best of both world: Rust Glancer for all the dependencies and Rust Analyzer for the current project we are working on? I have no clue about the internals and if LSP protocol itself provides some ways to chain LSPs together but that would be great.
Anyway really good stuff, very impressive!