Readit News logoReadit News
bryjnar commented on LSP: The good, the bad, and the ugly   michaelpj.com/blog/2024/0... · Posted by u/bryjnar
nyanpasu64 · a year ago
Not a LSP developer, but spitballing that perhaps you could address causality by tagging document updates/versions with numbers and messages/replies include the version of the document they correspond to.
bryjnar · a year ago
LSP does do this, but inconsistently. Document versions aren't always sent (e.g. nothing relating to diagnostics uses them).

It's also not enough to send the versions: you need to actually say what to do with them!

bryjnar commented on LSP: The good, the bad, and the ugly   michaelpj.com/blog/2024/0... · Posted by u/bryjnar
pie_flavor · a year ago
One of my favorite aspects of LSP being 'good enough' is that barebones support is incredibly simple to understand and implement. Old link since it was factored out at some point, but here is the entire LSP implementation for the Micro editor, in ~700 lines of Lua (+ utility functions): https://github.com/AndCake/micro-plugin-lsp/blob/dde90295f09...
bryjnar · a year ago
Admittedly my proposal to build everything off more powerful state synchronization primitives does raise the bar for getting _something_ working. Ideally you make it so you can progressively support more features, still. But sometimes you do have to choose between "easy at first, then gets progressively harder" vs "hard at first, then stays manageable".
bryjnar commented on LSP: The good, the bad, and the ugly   michaelpj.com/blog/2024/0... · Posted by u/bryjnar
blahgeek · a year ago
> Yet, if you want to support vscode you must create a specific extension for it and can't just have a language client.

It’s funny that you generally don’t need to do that for editors like vim or emacs - only need to add a single line in config to specify the command line argument

bryjnar · a year ago
It depends - the client modules for Emacs' `lsp-mode` generally need a fair bit of configuration. Not just how to launch the server, but also often defining a native-compatible way of setting the options. e.g. for Emacs they often get wired up as `defcustom`s.
bryjnar commented on LSP: The good, the bad, and the ugly   michaelpj.com/blog/2024/0... · Posted by u/bryjnar
legrangramgroum · a year ago
LSP syntax highlighting can be heavy weight the whole source is sent every few keystroke, and if many tokens get an annotation. It is common to use fast and simple JS frontend highlighting for simple things like literals, keyword and comments. For example, with Textmate via a VSCode extension. LSP is left to deal with the identifiers where a name resolver or a type system is needed.
bryjnar · a year ago
LSP syntax highlighting supports sending deltas, so it's not true that the whole source gets sent repeatedly.

u/bryjnar

KarmaCake day79September 3, 2024View Original