diff --git a/autoload/lsc/server.vim b/autoload/lsc/server.vim index 3ee32516..8810b654 100644 --- a/autoload/lsc/server.vim +++ b/autoload/lsc/server.vim @@ -256,7 +256,11 @@ function! lsc#server#register(filetype, config) abort call lsc#protocol#consumeMessage(self) endfunction function server.err_callback(message) abort - call lsc#message#error('StdErr from '.self.config.name.': '.a:message) + if self.status == 'starting' + \ || !has_key(self.config, 'suppress_stderr') + \ || !self.config.suppress_stderr + call lsc#message#error('StdErr from '.self.config.name.': '.a:message) + endif endfunction function server.on_exit() abort unlet self.channel diff --git a/doc/lsc.txt b/doc/lsc.txt index d6a27110..0f4760ac 100644 --- a/doc/lsc.txt +++ b/doc/lsc.txt @@ -297,6 +297,12 @@ are configured with the same name use the same server. `'enabled'`: Set to `v:false` to avoid starting the server until |:LSClientEnable| is called. + *lsc-server-suppress_stderr* +`'suppress_stderr'`: Set to `v:true` to suppress stderr output which is +received after the server has been initialized. Stderr output before +initialization still is shown in an error message. Use this if the server uses +stderr for noisy status or logging. + *lsc-server-message_hooks* `'message_hooks'`: Set to a dictionary where the keys are LSP method names and the values are either |funcref|s which may modify '`params`' for the call, or