Some checks failed
		
		
	
	Detach Plugins / check (FlyGrep.vim) (push) Has been cancelled
				
			Detach Plugins / check (GitHub.vim) (push) Has been cancelled
				
			Detach Plugins / check (JavaUnit.vim) (push) Has been cancelled
				
			Detach Plugins / check (SourceCounter.vim) (push) Has been cancelled
				
			Detach Plugins / check (cpicker.nvim) (push) Has been cancelled
				
			Detach Plugins / check (dein-ui.vim) (push) Has been cancelled
				
			Detach Plugins / check (git.vim) (push) Has been cancelled
				
			Detach Plugins / check (iedit.vim) (push) Has been cancelled
				
			Detach Plugins / check (scrollbar.vim) (push) Has been cancelled
				
			Detach Plugins / check (vim-chat) (push) Has been cancelled
				
			Detach Plugins / check (vim-cheat) (push) Has been cancelled
				
			Detach Plugins / check (vim-todo) (push) Has been cancelled
				
			Detach Plugins / check (xmake.vim) (push) Has been cancelled
				
			test / Linux (nvim, nightly) (push) Has been cancelled
				
			test / Linux (nvim, v0.3.8) (push) Has been cancelled
				
			test / Linux (nvim, v0.4.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.4.2) (push) Has been cancelled
				
			test / Linux (nvim, v0.4.3) (push) Has been cancelled
				
			test / Linux (nvim, v0.4.4) (push) Has been cancelled
				
			test / Linux (nvim, v0.5.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.5.1) (push) Has been cancelled
				
			test / Linux (nvim, v0.6.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.6.1) (push) Has been cancelled
				
			test / Linux (nvim, v0.7.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.7.2) (push) Has been cancelled
				
			test / Linux (nvim, v0.8.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.8.1) (push) Has been cancelled
				
			test / Linux (nvim, v0.8.2) (push) Has been cancelled
				
			test / Linux (nvim, v0.8.3) (push) Has been cancelled
				
			test / Linux (nvim, v0.9.0) (push) Has been cancelled
				
			test / Linux (nvim, v0.9.1) (push) Has been cancelled
				
			test / Linux (true, vim, v7.4.052) (push) Has been cancelled
				
			test / Linux (true, vim, v7.4.1689) (push) Has been cancelled
				
			test / Linux (true, vim, v7.4.629) (push) Has been cancelled
				
			test / Linux (true, vim, v8.0.0027) (push) Has been cancelled
				
			test / Linux (true, vim, v8.0.0183) (push) Has been cancelled
				
			test / Linux (vim, nightly) (push) Has been cancelled
				
			test / Linux (vim, v8.0.0184) (push) Has been cancelled
				
			test / Linux (vim, v8.0.1453) (push) Has been cancelled
				
			test / Linux (vim, v8.1.2269) (push) Has been cancelled
				
			test / Linux (vim, v8.2.2434) (push) Has been cancelled
				
			test / Linux (vim, v8.2.3995) (push) Has been cancelled
				
			test / Windows (nvim, nightly) (push) Has been cancelled
				
			test / Windows (nvim, v0.3.8) (push) Has been cancelled
				
			test / Windows (nvim, v0.4.2) (push) Has been cancelled
				
			test / Windows (nvim, v0.4.3) (push) Has been cancelled
				
			test / Windows (nvim, v0.4.4) (push) Has been cancelled
				
			test / Windows (nvim, v0.5.0) (push) Has been cancelled
				
			test / Windows (nvim, v0.5.1) (push) Has been cancelled
				
			test / Windows (nvim, v0.6.0) (push) Has been cancelled
				
			test / Windows (nvim, v0.6.1) (push) Has been cancelled
				
			test / Windows (nvim, v0.7.0) (push) Has been cancelled
				
			test / Windows (nvim, v0.7.2) (push) Has been cancelled
				
			test / Windows (nvim, v0.8.0) (push) Has been cancelled
				
			test / Windows (nvim, v0.8.1) (push) Has been cancelled
				
			test / Windows (nvim, v0.8.2) (push) Has been cancelled
				
			test / Windows (nvim, v0.8.3) (push) Has been cancelled
				
			test / Windows (nvim, v0.9.0) (push) Has been cancelled
				
			test / Windows (nvim, v0.9.1) (push) Has been cancelled
				
			test / Windows (vim, nightly) (push) Has been cancelled
				
			test / Windows (vim, v7.4.1185) (push) Has been cancelled
				
			test / Windows (vim, v7.4.1689) (push) Has been cancelled
				
			test / Windows (vim, v8.0.0027) (push) Has been cancelled
				
			test / Windows (vim, v8.0.1453) (push) Has been cancelled
				
			test / Windows (vim, v8.1.2269) (push) Has been cancelled
				
			test / Windows (vim, v8.2.2434) (push) Has been cancelled
				
			test / Windows (vim, v8.2.3995) (push) Has been cancelled
				
			docker / docker (push) Has been cancelled
				
			mirror / check (coding) (push) Has been cancelled
				
			mirror / check (gitee) (push) Has been cancelled
				
			mirror / check (gitlab) (push) Has been cancelled
				
			
		
			
				
	
	
		
			157 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			VimL
		
	
	
	
	
	
			
		
		
	
	
			157 lines
		
	
	
		
			4.4 KiB
		
	
	
	
		
			VimL
		
	
	
	
	
	
" don't spam the user when Vim is started in Vi compatibility mode
 | 
						|
let s:cpo_save = &cpo
 | 
						|
set cpo&vim
 | 
						|
 | 
						|
" From "go list -h".
 | 
						|
function! go#tool#ValidFiles(...)
 | 
						|
  let l:list = ["GoFiles", "CgoFiles", "IgnoredGoFiles", "CFiles", "CXXFiles",
 | 
						|
    \ "MFiles", "HFiles", "FFiles", "SFiles", "SwigFiles", "SwigCXXFiles",
 | 
						|
    \ "SysoFiles", "TestGoFiles", "XTestGoFiles"]
 | 
						|
 | 
						|
  " Used as completion
 | 
						|
  if len(a:000) > 0
 | 
						|
    let l:list = filter(l:list, 'strpart(v:val, 0, len(a:1)) == a:1')
 | 
						|
  endif
 | 
						|
 | 
						|
  return l:list
 | 
						|
endfunction
 | 
						|
 | 
						|
function! go#tool#Files(...) abort
 | 
						|
  if len(a:000) > 0
 | 
						|
    let source_files = a:000
 | 
						|
  else
 | 
						|
    let source_files = ['GoFiles']
 | 
						|
  endif
 | 
						|
 | 
						|
  let combined = ''
 | 
						|
  for sf in source_files
 | 
						|
    " Strip dot in case people used ":GoFiles .GoFiles".
 | 
						|
    let sf = substitute(sf, '^\.', '', '')
 | 
						|
 | 
						|
    " Make sure the passed options are valid.
 | 
						|
    if index(go#tool#ValidFiles(), sf) == -1
 | 
						|
      echoerr "unknown source file variable: " . sf
 | 
						|
    endif
 | 
						|
 | 
						|
    if go#util#IsWin()
 | 
						|
      let combined .= '{{range $f := .' . sf . '}}{{$.Dir}}\{{$f}}{{printf \"\n\"}}{{end}}{{range $f := .CgoFiles}}{{$.Dir}}\{{$f}}{{printf \"\n\"}}{{end}}'
 | 
						|
    else
 | 
						|
      let combined .= "{{range $f := ." . sf . "}}{{$.Dir}}/{{$f}}{{printf \"\\n\"}}{{end}}{{range $f := .CgoFiles}}{{$.Dir}}/{{$f}}{{printf \"\\n\"}}{{end}}"
 | 
						|
    endif
 | 
						|
  endfor
 | 
						|
 | 
						|
  let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', l:combined])
 | 
						|
  return split(l:out, '\n')
 | 
						|
endfunction
 | 
						|
 | 
						|
function! go#tool#Deps() abort
 | 
						|
  if go#util#IsWin()
 | 
						|
    let format = '{{range $f := .Deps}}{{$f}}{{printf \"\n\"}}{{end}}'
 | 
						|
  else
 | 
						|
    let format = "{{range $f := .Deps}}{{$f}}\n{{end}}"
 | 
						|
  endif
 | 
						|
  let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', l:format])
 | 
						|
  return split(l:out, '\n')
 | 
						|
endfunction
 | 
						|
 | 
						|
function! go#tool#Imports() abort
 | 
						|
  let imports = {}
 | 
						|
  if go#util#IsWin()
 | 
						|
    let format = '{{range $f := .Imports}}{{$f}}{{printf \"\n\"}}{{end}}'
 | 
						|
  else
 | 
						|
    let format = "{{range $f := .Imports}}{{$f}}{{printf \"\\n\"}}{{end}}"
 | 
						|
  endif
 | 
						|
  let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', l:format])
 | 
						|
  if l:err != 0
 | 
						|
    echo out
 | 
						|
    return imports
 | 
						|
  endif
 | 
						|
 | 
						|
  for package_path in split(out, '\n')
 | 
						|
    let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', '{{.Name}}', l:package_path])
 | 
						|
    if l:err != 0
 | 
						|
      echo out
 | 
						|
      return imports
 | 
						|
    endif
 | 
						|
    let package_name = substitute(l:out, '\n$', '', '')
 | 
						|
    let imports[package_name] = package_path
 | 
						|
  endfor
 | 
						|
 | 
						|
  return imports
 | 
						|
endfunction
 | 
						|
 | 
						|
function! go#tool#Info(showstatus) abort
 | 
						|
  let l:mode = go#config#InfoMode()
 | 
						|
  if l:mode == 'guru'
 | 
						|
    call go#guru#DescribeInfo(a:showstatus)
 | 
						|
  elseif l:mode == 'gopls'
 | 
						|
    if !go#config#GoplsEnabled()
 | 
						|
      call go#util#EchoError("go_info_mode is 'gopls', but gopls is disabled")
 | 
						|
      return
 | 
						|
    endif
 | 
						|
    call go#lsp#Info(a:showstatus)
 | 
						|
  else
 | 
						|
    call go#util#EchoError('go_info_mode value: '. l:mode .' is not valid. Valid values are: [guru, gopls]')
 | 
						|
  endif
 | 
						|
endfunction
 | 
						|
 | 
						|
function! go#tool#PackageName() abort
 | 
						|
  let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', '{{.Name}}'])
 | 
						|
  if l:err != 0
 | 
						|
      return -1
 | 
						|
  endif
 | 
						|
 | 
						|
  return split(out, '\n')[0]
 | 
						|
endfunction
 | 
						|
 | 
						|
" Exists checks whether the given importpath exists or not. It returns 0 if
 | 
						|
" the importpath exists under GOPATH.
 | 
						|
function! go#tool#Exists(importpath) abort
 | 
						|
    let [l:out, l:err] = go#util#ExecInDir(['go', 'list', a:importpath])
 | 
						|
    if l:err != 0
 | 
						|
        return -1
 | 
						|
    endif
 | 
						|
 | 
						|
    return 0
 | 
						|
endfunction
 | 
						|
 | 
						|
function! go#tool#List(package_path) abort
 | 
						|
  let [l:out, l:err] = go#util#ExecInDir(['go', 'list', '-tags', go#config#BuildTags(), '-f', '{{.ImportPath}}', a:package_path])
 | 
						|
  if l:err != 0
 | 
						|
      return -1
 | 
						|
  endif
 | 
						|
 | 
						|
  return split(out, '\n')
 | 
						|
endfunction
 | 
						|
 | 
						|
function! go#tool#DescribeBalloon()
 | 
						|
  let l:fname = fnamemodify(bufname(v:beval_bufnr), ':p')
 | 
						|
 | 
						|
  let l:winid = win_getid()
 | 
						|
 | 
						|
  call win_gotoid(bufwinid(v:beval_bufnr))
 | 
						|
 | 
						|
  let [l:line, l:col] = go#lsp#lsp#Position(v:beval_lnum, v:beval_col)
 | 
						|
  call go#lsp#Hover(l:fname, l:line, l:col, funcref('s:balloon', []))
 | 
						|
 | 
						|
  call win_gotoid(l:winid)
 | 
						|
  return ''
 | 
						|
endfunction
 | 
						|
 | 
						|
function! s:balloon(msg)
 | 
						|
  let l:msg = a:msg
 | 
						|
  if has('balloon_eval')
 | 
						|
    if has('balloon_multiline')
 | 
						|
      let l:msg = join(a:msg, "\n")
 | 
						|
    endif
 | 
						|
  endif
 | 
						|
 | 
						|
  call balloon_show(l:msg)
 | 
						|
endfunction
 | 
						|
 | 
						|
" restore Vi compatibility settings
 | 
						|
let &cpo = s:cpo_save
 | 
						|
unlet s:cpo_save
 | 
						|
 | 
						|
" vim: sw=2 ts=2 et
 |