Skip to content

Commit

Permalink
Add configuration option to suppress stderr (#80)
Browse files Browse the repository at this point in the history
Closes #78
  • Loading branch information
natebosch authored Apr 25, 2018
1 parent d7bfdd1 commit c0db766
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoload/lsc/server.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions doc/lsc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0db766

Please sign in to comment.