by PoignardAzur · 2y ago · 0 comments
That has nothing to do with LSP.
Rust Analyzer is similar in scope to a second implementation of the Rust compiler.
Very interesting is how Roslyn/Typescript does it: https://www.youtube.com/watch?v=qnyOHY7AiZk
I know. That’s really bad!
And there always is the possibility to stop in batch mode when the first error occured.
First of all, a compiler for a 100% correct program definitely has all the necessary information for robust intellisense. They don’t currently save all the data, but it should exist.
So the only real question is whether they can support the 0.01% of files that incomplete and changing?
I’ll readily admit I am not a compiler expert. So I’m open to being wrong. But I certainly don’t see why not. Compilers already need to support incorrect code so they can print helpful error messages. Including different errors spread through out a single file.
It may be that current compilers are badly architected for incremental intellisense generation. But I don’t think that’s an intrinsic difference. I see no reason that the tasks require “completely different architectures”.
It doesn't. Intellisense is supposed to work on 100% incorrect and incomplete programs. To the point that it should work in syntactically invalid code.
There is recording of a talk on YouTube from Niko Matsakis that goes into the motivation.
In conclusion, you don't really want to optimize for the batch use case, even outside of IDE support.