neoclide/coc.nvim

LSP Server Autostart Configuration Option

Closed this issue · 1 comments

In certain use cases, we may want to prevent the LSP server from starting automatically. I'd like to propose adding an autostart option to the LSP configuration, similar to Neovim's LSP implementation.

For reference, Neovim LSP supports this functionality:

:LspStart <config_name> Start the requested server name. Will only successfully start if the command detects a root directory matching the current config. Pass autostart = false to your .setup{} call for a language server if you would like to launch clients solely with this command. Defaults to all servers matching current buffer filetype.

Expected behavior:

  • Users could set autostart: false to disable automatic startup
  • LSP servers could then be manually started using CocList service when needed

This would give users more control over when LSP services are initialized

  1. :h g:coc_start_at_startup, to disable automatic startup
  2. use :CocStart to start server.