4 ms·
Interesting article, but the approach still seems like the opposite of how language server sync usually works. Typically, the LSP is notified on any file chang
by morgante 2y ago
Interesting article, but the approach still seems like the opposite of how language server sync usually works.
Typically, the LSP is notified on any file change and is responsible for keeping its own copy of the files. This way it doesn't need to request the "latest" files - on a keystroke, it just needs to update the actual file being edited.
It seems like the Deno LSP doesn't follow this push model for some reason, which is going to make it inherently unscalable in very large projects. I'm curious why.
- kylewlacy 2y agoI believe Deno's LSP does use this push model, the missing ingredient is that the LSP server itself is implemented in Rust, but bridges to TypeScript's Language Service API in JavaScript/TypeScript. The TypeScript side calls functions like `readFile()` that Deno then needs to provide, so they need to get the in-memory file contents from the Rust side to the JS side.