diff --git a/autoload/go/lsp.vim b/autoload/go/lsp.vim index 9c6380cd4f..5c58b78114 100644 --- a/autoload/go/lsp.vim +++ b/autoload/go/lsp.vim @@ -223,6 +223,8 @@ function! s:newlsp() abort " TODO(bc): handle more notifications (e.g. window/showMessage). if a:req.method == 'textDocument/publishDiagnostics' call self.handleDiagnostics(a:req.params) + elseif a:req.method == 'window/showMessage' + call self.showMessage(a:req.params) endif endfunction @@ -231,6 +233,19 @@ function! s:newlsp() abort call self.updateDiagnostics() endfunction + function! l:lsp.showMessage(data) dict abort + let l:msg = a:data.message + if a:data.type == 1 + call go#util#EchoError(l:msg) + elseif a:data.type == 2 + call go#util#EchoWarning(l:msg) + elseif a:data.type == 3 + call go#util#EchoInfo(l:msg) + elseif a:data.type == 4 + " do nothing for Log messages + endif + endfunction + " TODO(bc): process the queue asynchronously function! l:lsp.updateDiagnostics() dict abort let l:level = go#config#DiagnosticsLevel()