Re:Lapce – Fast and Powerful Code Editor written in Rust
by IshKebab on Tuesday December 14, 2021 @06:23AM
(#29550482)
Well, sort of. The problem is it's difficult to implement a lot of extension functionality in efficient ways, and sometimes they make it too easy to do it in really really inefficient ways. Examples:
* LSP uses JSON. Even worse, VSCode uses UTF-16 internally (because Javascript does, more or less). But JSON uses UTF-8. So for correct operation VSCode converts the UTF-16 to UTF-8, and then your language server has to convert it back to UTF-16 to figure out the row/col positions (which are in UTF-16 units).
* LSP has an "easy mode" where the entire document is sent to the language server on every keypress!
* Some functions like `provideDocumentLinks()` operate on the entire document, so on every keypress (maybe it batches them I don't know), all linkifier extensions will run a load of regexes over the whole document.
There's definitely scope for a text editor with an extension API that encourages speed.
* LSP uses JSON. Even worse, VSCode uses UTF-16 internally (because Javascript does, more or less). But JSON uses UTF-8. So for correct operation VSCode converts the UTF-16 to UTF-8, and then your language server has to convert it back to UTF-16 to figure out the row/col positions (which are in UTF-16 units).
* LSP has an "easy mode" where the entire document is sent to the language server on every keypress!
* Some functions like `provideDocumentLinks()` operate on the entire document, so on every keypress (maybe it batches them I don't know), all linkifier extensions will run a load of regexes over the whole document.
There's definitely scope for a text editor with an extension API that encourages speed.