42 ms·
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 sim
by legrangramgroum 2y 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.
- 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.