Coc.nvim: Add ":CocStop" command

Created on 5 Oct 2020  路  14Comments  路  Source: neoclide/coc.nvim

Is your feature request related to a problem? Please describe.

coc.nvim spawns processes that can take several GB of ram. The only way to completely shut such process down is closing the entire editor and losing my work or killing the process manually, which is error prone and bad UI.

Describe the solution you'd like

A command :CocStop, the opposite of :CocStart.

Additional context

https://github.com/neoclide/coc.nvim/issues/1606

I am not using additional extensions.

All 14 comments

Try CocRestart.

@fannheyward how is that related? I want to stop the server indefinitely, when I'm done coding. Not restart it. Please reopen.

Agreed that CocRestart won't help for that.

Use coc#rpc#stop function

Use coc#rpc#stop function

Then it should be easy to add this as a dedicated command. So would someone reopen this ticket?

No, you have to create that command.

No, you have to create that command.

Aha, so why have CocStart command then?? It took me 2 days to get an answer to this question. This isn't good UI.

Because user could disable coc.nvim auto start, I don't think CocStop is needed

What an awful reasoning. This plugin may eat multiple GB of memory and the authors think the user shouldn't have an easy way to stop all processes if needed.

@hasufell it's not the plugin that eat GBs though, it's the servers.

@hasufell in all these years of coc.nvim, I've rarely seen a need for this personally, or a request by others. If you got into the situation that you want the servers to terminate, you most likely will wish an emergency mapping for that instead of going about to execute a command. Given that and that Coc won't provide built-in mappings, you'll have to write one anyways, so just write one and simply call coc#rpc#stop. Having a command here isn't much relevant. A <Plug> mapping seems more relevant to have.

@chemzqm

Because user could disable coc.nvim auto start

A <Plug> mapping seems more relevant to have and there's no such risk, see above.

You should use CocRestart

That command is useless since user would receive errors all the time when they have autocmds

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hackingcat picture hackingcat  路  3Comments

andys8 picture andys8  路  3Comments

lanox picture lanox  路  3Comments

LinArcX picture LinArcX  路  4Comments

rkulla picture rkulla  路  3Comments