From 70867692894aa99e9ef450f19f5ff7b571b98aad Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 6 Sep 2018 17:05:05 +0100 Subject: #1891 Fix the go-langserver tests --- ale_linters/go/golangserver.vim | 28 ---------------------------- ale_linters/go/langserver.vim | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 28 deletions(-) delete mode 100644 ale_linters/go/golangserver.vim create mode 100644 ale_linters/go/langserver.vim (limited to 'ale_linters') diff --git a/ale_linters/go/golangserver.vim b/ale_linters/go/golangserver.vim deleted file mode 100644 index c80b096d..00000000 --- a/ale_linters/go/golangserver.vim +++ /dev/null @@ -1,28 +0,0 @@ -" Author: Horacio Sanson -" Description: Support for go-langserver https://github.com/sourcegraph/go-langserver - -call ale#Set('go_langserver_executable', 'go-langserver') -call ale#Set('go_langserver_options', '') - -function! ale_linters#go#golangserver#GetCommand(buffer) abort - let l:executable = [ale#Escape(ale#Var(a:buffer, 'go_langserver_executable'))] - let l:options = ale#Var(a:buffer, 'go_langserver_options') - let l:options = substitute(l:options, '-gocodecompletion', '', 'g') - let l:options = filter(split(l:options, ' '), 'empty(v:val) != 1') - - if(ale#Var(a:buffer, 'completion_enabled') == 1) - call add(l:options, '-gocodecompletion') - endif - - let l:options = uniq(sort(l:options)) - - return join(extend(l:executable, l:options), ' ') -endfunction - -call ale#linter#Define('go', { -\ 'name': 'golangserver', -\ 'lsp': 'stdio', -\ 'executable_callback': ale#VarFunc('go_langserver_executable'), -\ 'command_callback': 'ale_linters#go#golangserver#GetCommand', -\ 'project_root_callback': 'ale#go#FindProjectRoot', -\}) diff --git a/ale_linters/go/langserver.vim b/ale_linters/go/langserver.vim new file mode 100644 index 00000000..df956483 --- /dev/null +++ b/ale_linters/go/langserver.vim @@ -0,0 +1,28 @@ +" Author: Horacio Sanson +" Description: Support for go-langserver https://github.com/sourcegraph/go-langserver + +call ale#Set('go_langserver_executable', 'go-langserver') +call ale#Set('go_langserver_options', '') + +function! ale_linters#go#langserver#GetCommand(buffer) abort + let l:executable = [ale#Escape(ale#Var(a:buffer, 'go_langserver_executable'))] + let l:options = ale#Var(a:buffer, 'go_langserver_options') + let l:options = substitute(l:options, '-gocodecompletion', '', 'g') + let l:options = filter(split(l:options, ' '), 'empty(v:val) != 1') + + if(ale#Var(a:buffer, 'completion_enabled') == 1) + call add(l:options, '-gocodecompletion') + endif + + let l:options = uniq(sort(l:options)) + + return join(extend(l:executable, l:options), ' ') +endfunction + +call ale#linter#Define('go', { +\ 'name': 'golangserver', +\ 'lsp': 'stdio', +\ 'executable_callback': ale#VarFunc('go_langserver_executable'), +\ 'command_callback': 'ale_linters#go#langserver#GetCommand', +\ 'project_root_callback': 'ale#go#FindProjectRoot', +\}) -- cgit v1.2.3