Skip to content

Commit

Permalink
Merge pull request #3567 from bhcleek/lsp/clientInfo
Browse files Browse the repository at this point in the history
lsp: set clientInfo in Initialize
  • Loading branch information
bhcleek authored Aug 10, 2023
2 parents 12de6c0 + 6bfe33b commit 63ca6f6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
14 changes: 7 additions & 7 deletions autoload/go/debug_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
5 changes: 3 additions & 2 deletions autoload/go/lint_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions autoload/go/lsp/message.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down

0 comments on commit 63ca6f6

Please sign in to comment.