3 ms·
> The paradox is that it was meant to avoid to write language support for each editor. Yet, if you want to support vscode you must create a specific extension f
by dualogy 2y ago
> The paradox is that it was meant to avoid to write language support for each editor. Yet, if you want to support vscode you must create a specific extension for it and can't just have a language client.
On the one hand, this has always bugged me slightly. But on the other hand, every time when it came down to it in practice, I realized two things: first, a VSC extension that does nothing but wire up the LSP language clienting library is a tiny project with no major maintenance burden; and secondly, more importantly you usually want additional language-extension client-side features that are editor-specific by nature and either couldn't or shouldn't be abstracted-inside / covered-by the language-server / lang intel / IntelliSense realm. Syntax-coloring and other grammar-describing meta-data come to mind, or custom Notebook, or rich & productive build or debug or pkg-mgmt etc. helpers & tooling UX, etc. Stuff that arguably belongs in one's "language extension" but is mostly editor-specific and thus at the same time doesn't truly belong in one's "language intelligence serving".
- ReleaseCandidat 2y ago> Syntax-coloring and [...] come to mind Semantic highlighting is part of LSP and supported by all "bigger" LSPs.
- legrangramgroum 2y agoLSP 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.
- ReleaseCandidat 2y agoI'm not sure if regex engine (or treesitter) + LSP really is faster than just using the LSP, as most of them check the source on typing anyways, so the overhead is sending the tags for the syntax highlighting. And there is no need to send the whole text, the client can send the current edited range only (if the server supports that). And at least the highlighting would actually be correct (or consistent with the compiler's AST ;).
- bryjnar 2y agoLSP syntax highlighting supports sending deltas, so it's not true that the whole source gets sent repeatedly.