Making an LSP for great good

19 points by polywolf


snej

This whole series looks great! There’s a dearth of tutorials on building a statically-typed language.

rbalicki

shameless plug alert I gave a talk at a recent RustNYC about building a language server atop of a query-based compiler. It focuses on Pico, which is our replacement for Rust Analyzer's salsa. (A small and simple salsa, if you will.) https://drive.google.com/file/d/1qoJidpwT3gb2exQX18vlSjxZNzb2VRfT/view?usp=sharing&t=5091

Anyway, an advantage of query based compilers that the author misses is that it lets you respond to queries, even if your code is in a broken state. Consider let x: bool = 123; let y: bool = true. We don't need to validate the let x statement when we (say) hovering on y, and displaying its type. But (and especially for complicated situations), it's hard to imagine how one would write a batch compiler and yet be able to do this.

Great post!