Why building a Rust LSP is hard
28 points by wofo
28 points by wofo
This is a case where tagging [vibecoding] will hide the article from some people who might have liked to see it. It's an interesting blog post about the complexities of LSP implementation, informative (I wish I'd known some of this when writing an lsp some years back), and entirely human-written. Doesn't mention LLMs once. But the project it's about has a AGENTS.md, so we must apply the scarlet letter.
Sad thing, IMO. I wish people had the sense to distinguish between low-effort slop and projects like this.
Slop is slop. I stopped muting the vibecoding tag because I'm trying to get over the fact I hate it, but most of the vibecoding content is not stuff I would want to see at this time.
One thing that annoys me about the word "slop" is that it doesn't have an agreed meaning. Some use it to refer to code completely generated by an LLM without a human ever being involved, others use it to refer to projects that don't have a sufficiently antagonistic policy against LLM usage (open slopware includes projects whose sin is telling people its OK to use LLMs for translations from their mother tongue). Yet others use it to mean "bad code". Whenever I see "slop", it forces me to try to identify which of the myriad meanings they meant, which is annoying. Vibe coding at least is closer to having a generally accepted shared meaning. This is completely independent on whether I think using LLMs is good or bad for any of the thousand reasons people like them and dislike them. So no, I disagree with "slop is slop". That's a thought terminating cliché of the likes or "brexit is brexit".
If it helps, I don't think any words have an agreed meaning, just degrees of mutual intelligibility given a context.
It's very possible that the users suggesting the tag change were the ones filtering on "vibecoding" and were annoyed it got through the filter...
Truly. I enjoy the lobsters community’s takes on a a lot of things but the longer the LLMs are here the more grating these takes get.
Don’t worry, the people filtering vibecoding have made it quite clear that they would not have liked to see it.
And I do empathize with the underlying attitude, though I draw different red lines. E.g., now that Cursor works for Elon, I no longer want to hear anything about it.
Yeah, I am sad that folks are not writing more for https://rust-analyzer.github.io/blog. Surely something interesting has been learned in this time? And there's incredible value in just writing down what you've learned, especially if it concerns a relatively niche topic!
I am glad that rust-glancer exists, and doubly glad that it exists not only in code, but in prose as well.
such as workspace/inlayHint/refresh server request.
Yeas, as I always complain, dart-analyzer has it all figured out, with subscriptions and event ordering guarantees, and then LSP is just strictly worse, despite coming later!
You could still work on AST/CST level, but it won't be convenient. Likely you want to have an item tree, your own representation of items defined in each file.
As a rather critical clarification, the reason why item tree/def map exist isn't for convenience, but for incrementally. The invariant is that changes confined to a single function's body don't change the containing file's item tree. Which means that anything that depends only on item tree doesn't have to be recomputed.
The intuition here is that 90% of the code is bodies, and 90% of changes are bodies, but, at the same time, it is reasonable to assume that you don't actually care about bodies of files other than the one on the screen. Though, one of the things that make building LSP for Rust hard is that that are some local constructs inside bodies that can cause global effects (impls, macro_exported macro definitions, and mod declarations).
I'm building Rust Glancer
No mention of this?
Seems rather level-headed. AI code really depends on how you use it.
A disclaimer such as this could've probably be used for a lot of things before but we never bothered. "This website is being written with extensive use of Stack Overflow". People still considered it their code.