neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.05k stars 68 forks source link

Feature Request: Add option to interact with LSP-server on write #281

Closed hissssst closed 3 years ago

hissssst commented 3 years ago

Current behaviour

coc.nvim displays all warning and errors while typing code

Desired behaviour

It would be nice to have an option which controls whether coc.nvim interacts with server while typing or only on writing (:w command)

Motivation

Development of big projects on low-ram laptop is a pain when coc.nvim calls LSP-server on every typed character. Neovim freezes for some time when typed character results in an error or a warning (which happens pretty often)

chemzqm commented 3 years ago

Nope

hissssst commented 3 years ago

@chemzqm Why? Isn't it possible?

You can point me the places I should take a look, and I'll try to implement it myself And I think that Can't reproduce tag is inappropriate, because it is feature request, not a bug

chemzqm commented 3 years ago

Neovim freezes for some time when typed character results in an error or a warning

Can't reproduce that, interact with tsserver should be async, so don't know how could that make your vim slow.

chemzqm commented 3 years ago

You can try hack https://github.com/neoclide/coc-tsserver/blob/master/src/server/features/bufferSyncSupport.ts#L221 this function, but your completion and many other features possible not work as expected.

hissssst commented 3 years ago

It is not slowing my vim, it is starting to analyze code before I finished writing it. And this uses a lot of CPU therefore slowing down everything