slow-lsp-demo
In the past time, the neovim builtin-lsp and Lua based completion plugin slows down when using the old typescript-language-server.
This problem was caused by the following reasons...
1. The previous version of typescript-language-server behavior
The previous version of typescript-language-server returns toooooo many completion items.
-> Now, typescript-language-server uses isIncomplete=true
and the payload is small as enough.
vim.fn.json_decode
to parse LSP payloads.
2. The previous version of nvim built-in lsp was using It may take a time near 100ms if the payload toooo large.
-> Now, nvim built-in lsp uses cjson
as the JSON parser. It quit faster than old one.
vim.NIL
as nil
via recursive processing.
3. The previous version of nvim built-in lsp convert It may take a time near 100ms if the payload toooo large.
-> Now, nvim built-in lsp converts vim.NIL
to nil
when parsing that is avoiding extra recursive processing.
NOTE: The completion plugin was the slowness reason too (but it isn't the core reason).
How can I reproduce the slowness with this repo?
- Downgrade the nvim.
- Downgrade the typescript-language-server as
0.4.0
- Run
npm install
- Invoke completion with
<|>
onsrc/index.ts