From 99050db4483fe3bef199fe3c5d93a75c3c1d1a5d Mon Sep 17 00:00:00 2001 From: Billie Cleek Date: Thu, 1 Oct 2020 18:22:18 -0700 Subject: [PATCH 1/2] lsp: show messages to users --- autoload/go/lsp.vim | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/autoload/go/lsp.vim b/autoload/go/lsp.vim index 9c6380cd4f..aefc23cf33 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,20 @@ 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 + endif + " TODO(bc): check the type and call the correct function + endfunction + " TODO(bc): process the queue asynchronously function! l:lsp.updateDiagnostics() dict abort let l:level = go#config#DiagnosticsLevel() From 05b1cfd9c0017e7832794afb3e10ca9d1c2a7f5b Mon Sep 17 00:00:00 2001 From: Billie Cleek Date: Sun, 17 Jan 2021 08:25:01 -0800 Subject: [PATCH 2/2] lsp: remove completed TODO item --- autoload/go/lsp.vim | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/autoload/go/lsp.vim b/autoload/go/lsp.vim index aefc23cf33..5c58b78114 100644 --- a/autoload/go/lsp.vim +++ b/autoload/go/lsp.vim @@ -242,9 +242,8 @@ function! s:newlsp() abort elseif a:data.type == 3 call go#util#EchoInfo(l:msg) elseif a:data.type == 4 - " do nothing + " do nothing for Log messages endif - " TODO(bc): check the type and call the correct function endfunction " TODO(bc): process the queue asynchronously