mirror of
https://github.com/amix/vimrc
synced 2025-06-16 01:25:00 +08:00
Updated plugins
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
call ale#Set('go_gopls_executable', 'gopls')
|
||||
call ale#Set('go_gopls_options', '--mode stdio')
|
||||
call ale#Set('go_gopls_init_options', {})
|
||||
call ale#Set('go_gopls_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#go#gopls#GetCommand(buffer) abort
|
||||
return ale#go#EnvString(a:buffer)
|
||||
@ -29,7 +30,9 @@ endfunction
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'gopls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'go_gopls_executable')},
|
||||
\ 'executable': {b -> ale#path#FindExecutable(b, 'go_gopls', [
|
||||
\ ale#go#GetGoPathExecutable('bin/gopls'),
|
||||
\ ])},
|
||||
\ 'command': function('ale_linters#go#gopls#GetCommand'),
|
||||
\ 'project_root': function('ale_linters#go#gopls#FindProjectRoot'),
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'go_gopls_init_options')},
|
||||
|
@ -1,8 +1,10 @@
|
||||
" Author: Ben Reedy <https://github.com/breed808>
|
||||
" Description: staticcheck for Go files
|
||||
|
||||
call ale#Set('go_staticcheck_executable', 'staticcheck')
|
||||
call ale#Set('go_staticcheck_options', '')
|
||||
call ale#Set('go_staticcheck_lint_package', 0)
|
||||
call ale#Set('go_staticcheck_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#go#staticcheck#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'go_staticcheck_options')
|
||||
@ -10,18 +12,20 @@ function! ale_linters#go#staticcheck#GetCommand(buffer) abort
|
||||
let l:env = ale#go#EnvString(a:buffer)
|
||||
|
||||
if l:lint_package
|
||||
return l:env . 'staticcheck'
|
||||
return l:env . '%e'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' .'
|
||||
endif
|
||||
|
||||
return l:env . 'staticcheck'
|
||||
return l:env . '%e'
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . ' %s:t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'staticcheck',
|
||||
\ 'executable': 'staticcheck',
|
||||
\ 'executable': {b -> ale#path#FindExecutable(b, 'go_staticcheck', [
|
||||
\ ale#go#GetGoPathExecutable('bin/staticcheck'),
|
||||
\ ])},
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': function('ale_linters#go#staticcheck#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#go#Handler',
|
||||
|
Reference in New Issue
Block a user