From 68961c0f3a3df9e3f2aa3cf1092bad961a47f414 Mon Sep 17 00:00:00 2001 From: Billie Cleek Date: Wed, 2 Aug 2023 13:07:57 -0700 Subject: [PATCH 1/3] lsp: set clientInfo in Initialize Set clientInfo to allow telemetry to be used. Relates to https://github.com/golang/go/issues/61038. ref: https://go-review.googlesource.com/c/tools/+/506635 --- autoload/go/lsp/message.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/go/lsp/message.vim b/autoload/go/lsp/message.vim index ff21ebffd0..aae6623a82 100644 --- a/autoload/go/lsp/message.vim +++ b/autoload/go/lsp/message.vim @@ -8,6 +8,9 @@ function! go#lsp#message#Initialize(wd) abort \ 'method': 'initialize', \ 'params': { \ 'processId': getpid(), + \ 'clientInfo': { + \ 'name': 'vim-go', + \ }, \ 'rootUri': go#path#ToURI(a:wd), \ 'capabilities': { \ 'workspace': { From 6896dae964e5f4c4d378d1db0e89f3a21ef4faec Mon Sep 17 00:00:00 2001 From: Billie Cleek Date: Thu, 3 Aug 2023 19:46:59 -0700 Subject: [PATCH 2/3] lint: update golangci-lint tests Apparently golangci-lint has changed yet again. --- autoload/go/lint_test.vim | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoload/go/lint_test.vim b/autoload/go/lint_test.vim index 74ce284b74..768ab8da5e 100644 --- a/autoload/go/lint_test.vim +++ b/autoload/go/lint_test.vim @@ -314,8 +314,9 @@ func! s:gometaautosave_multiple(metalinter) abort let l:goversion = split(l:goversion, "\n")[0] if l:goversion < 'go1.20' let expected = [ - \ {'lnum': 4, 'bufnr': bufnr('%'), 'col': 2, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': '"time" imported but not used (typecheck)'}, - \ {'lnum': 8, 'bufnr': bufnr('%'), 'col': 7, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': 'time.Sleep undefined (type int has no field or method Sleep) (typecheck)'}, + \ {'lnum': 4, 'bufnr': bufnr('%'), 'col': 2, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': 'imported and not used: "time"'}, + \ {'lnum': 8, 'bufnr': bufnr('%'), 'col': 24, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': 'time.Millisecond undefined (type int has no field or method Millisecond) (typecheck)'}, + \ {'lnum': 8, 'bufnr': bufnr('%'), 'col': 7, 'pattern': '', 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'module': '', 'text': 'time.Sleep undefined (type int has no field or method Sleep)'}, \ ] endif From 6bfe33b36db6d544335f63f639e1c55089c47829 Mon Sep 17 00:00:00 2001 From: Billie Cleek Date: Thu, 3 Aug 2023 23:12:09 -0700 Subject: [PATCH 3/3] debug: update expected test output --- autoload/go/debug_test.vim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autoload/go/debug_test.vim b/autoload/go/debug_test.vim index b177943d67..102c225073 100644 --- a/autoload/go/debug_test.vim +++ b/autoload/go/debug_test.vim @@ -35,13 +35,13 @@ function! Test_GoDebugStart_Errors() abort \] let [l:goversion, l:err] = go#util#Exec(['go', 'env', 'GOVERSION']) let l:goversion = split(l:goversion, "\n")[0] - if l:goversion < 'go1.20' - let expected = [ - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': '# vim-go.test/debug/compilerror'}, - \ {'lnum': 6, 'bufnr': bufnr('%'), 'col': 22, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': ' syntax error: unexpected newline in argument list; possibly missing comma or )'}, - \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'exit status 2'} - \ ] - endif +" if l:goversion < 'go1.20' +" let expected = [ +" \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': '# vim-go.test/debug/compilerror'}, +" \ {'lnum': 6, 'bufnr': bufnr('%'), 'col': 22, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': ' syntax error: unexpected newline in argument list; possibly missing comma or )'}, +" \ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 0, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'exit status 2'} +" \ ] +" endif call setqflist([], 'r') call assert_false(exists(':GoDebugStop'))