forked from amix/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
199 changed files
with
2,888 additions
and
971 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,15 @@ | |
" Description: go build for Go files | ||
" inspired by work from dzhou121 <[email protected]> | ||
|
||
call ale#Set('go_go_executable', 'go') | ||
call ale#Set('go_gobuild_options', '') | ||
|
||
function! ale_linters#go#gobuild#GetCommand(buffer) abort | ||
let l:options = ale#Var(a:buffer, 'go_gobuild_options') | ||
|
||
" Run go test in local directory with relative path | ||
return ale#path#BufferCdString(a:buffer) | ||
\ . 'go test' | ||
\ . ale#Var(a:buffer, 'go_go_executable') . ' test' | ||
\ . (!empty(l:options) ? ' ' . l:options : '') | ||
\ . ' -c -o /dev/null ./' | ||
endfunction | ||
|
@@ -21,7 +22,6 @@ function! ale_linters#go#gobuild#GetMatches(lines) abort | |
" file.go:27: missing argument for Printf("%s"): format reads arg 2, have only 1 args | ||
" file.go:53:10: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) | ||
" file.go:5:2: expected declaration, found 'STRING' "log" | ||
|
||
" go test returns relative paths so use tail of filename as part of pattern matcher | ||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:? (.+)$' | ||
|
||
|
@@ -48,7 +48,7 @@ endfunction | |
call ale#linter#Define('go', { | ||
\ 'name': 'gobuild', | ||
\ 'aliases': ['go build'], | ||
\ 'executable': 'go', | ||
\ 'executable_callback': ale#VarFunc('go_go_executable'), | ||
\ 'command_callback': 'ale_linters#go#gobuild#GetCommand', | ||
\ 'output_stream': 'stderr', | ||
\ 'callback': 'ale_linters#go#gobuild#Handler', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
" Author: Sascha Grunert <[email protected]> | ||
" Description: Adds support of golangci-lint | ||
|
||
call ale#Set('go_golangci_lint_options', '--enable-all') | ||
call ale#Set('go_golangci_lint_executable', 'golangci-lint') | ||
call ale#Set('go_golangci_lint_package', 0) | ||
|
||
function! ale_linters#go#golangci_lint#GetCommand(buffer) abort | ||
let l:filename = expand('#' . a:buffer . ':t') | ||
let l:options = ale#Var(a:buffer, 'go_golangci_lint_options') | ||
let l:lint_package = ale#Var(a:buffer, 'go_golangci_lint_package') | ||
|
||
if l:lint_package | ||
return ale#path#BufferCdString(a:buffer) | ||
\ . '%e run ' | ||
\ . l:options | ||
endif | ||
|
||
return ale#path#BufferCdString(a:buffer) | ||
\ . '%e run ' | ||
\ . ale#Escape(l:filename) | ||
\ . ' ' . l:options | ||
endfunction | ||
|
||
function! ale_linters#go#golangci_lint#GetMatches(lines) abort | ||
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)$' | ||
|
||
return ale#util#GetMatches(a:lines, l:pattern) | ||
endfunction | ||
|
||
function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort | ||
let l:dir = expand('#' . a:buffer . ':p:h') | ||
let l:output = [] | ||
|
||
for l:match in ale_linters#go#golangci_lint#GetMatches(a:lines) | ||
" l:match[1] will already be an absolute path, output from | ||
" golangci_lint | ||
call add(l:output, { | ||
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]), | ||
\ 'lnum': l:match[2] + 0, | ||
\ 'col': l:match[3] + 0, | ||
\ 'type': 'E', | ||
\ 'text': l:match[4], | ||
\}) | ||
endfor | ||
|
||
return l:output | ||
endfunction | ||
|
||
call ale#linter#Define('go', { | ||
\ 'name': 'golangci-lint', | ||
\ 'executable_callback': ale#VarFunc('go_golangci_lint_executable'), | ||
\ 'command_callback': 'ale_linters#go#golangci_lint#GetCommand', | ||
\ 'callback': 'ale_linters#go#golangci_lint#Handler', | ||
\ 'lint_file': 1, | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,19 +4,23 @@ | |
" Author: John Eikenberry <[email protected]> | ||
" Description: updated to work with go1.10 | ||
|
||
call ale#Set('go_go_executable', 'go') | ||
call ale#Set('go_govet_options', '') | ||
|
||
function! ale_linters#go#govet#GetCommand(buffer) abort | ||
let l:options = ale#Var(a:buffer, 'go_govet_options') | ||
return ale#path#BufferCdString(a:buffer) . ' go vet .' | ||
|
||
return ale#path#BufferCdString(a:buffer) . ' ' | ||
\ . ale#Var(a:buffer, 'go_go_executable') . ' vet ' | ||
\ . (!empty(l:options) ? ' ' . l:options : '') | ||
\ . ' .' | ||
endfunction | ||
|
||
call ale#linter#Define('go', { | ||
\ 'name': 'govet', | ||
\ 'aliases': ['go vet'], | ||
\ 'output_stream': 'stderr', | ||
\ 'executable': 'go', | ||
\ 'executable_callback': ale#VarFunc('go_go_executable'), | ||
\ 'command_callback': 'ale_linters#go#govet#GetCommand', | ||
\ 'callback': 'ale#handlers#go#Handler', | ||
\ 'lint_file': 1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
" Author: Horacio Sanson <https://github.com/hsanson> | ||
" 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', | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
" Author: Horacio Sanson <https://github.com/hsanson> | ||
" Description: Support for the Java language server https://github.com/georgewfraser/vscode-javac | ||
|
||
call ale#Set('java_javalsp_jar', 'javacs.jar') | ||
|
||
function! ale_linters#java#javalsp#Executable(buffer) abort | ||
return 'java' | ||
endfunction | ||
|
||
function! ale_linters#java#javalsp#Command(buffer) abort | ||
let l:jar = ale#Var(a:buffer, 'java_javalsp_jar') | ||
|
||
return ale#Escape('java -cp ' . l:jar . ' -Xverify:none org.javacs.Main') | ||
endfunction | ||
|
||
call ale#linter#Define('java', { | ||
\ 'name': 'javalsp', | ||
\ 'lsp': 'stdio', | ||
\ 'executable_callback': 'ale_linters#java#javalsp#Executable', | ||
\ 'command_callback': 'ale_linters#java#javalsp#Command', | ||
\ 'language': 'java', | ||
\ 'project_root_callback': 'ale#java#FindProjectRoot', | ||
\}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
sources_non_forked/ale/ale_linters/julia/languageserver.vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
" Author: Bartolomeo Stellato <[email protected]> | ||
" Description: A language server for Julia | ||
|
||
" Set julia executable variable | ||
call ale#Set('julia_executable', 'julia') | ||
|
||
function! ale_linters#julia#languageserver#GetCommand(buffer) abort | ||
let l:julia_executable = ale#Var(a:buffer, 'julia_executable') | ||
let l:cmd_string = 'using LanguageServer; server = LanguageServer.LanguageServerInstance(isdefined(Base, :stdin) ? stdin : STDIN, isdefined(Base, :stdout) ? stdout : STDOUT, false); server.runlinter = true; run(server);' | ||
|
||
return ale#Escape(l:julia_executable) . ' --startup-file=no --history-file=no -e ' . ale#Escape(l:cmd_string) | ||
endfunction | ||
|
||
call ale#linter#Define('julia', { | ||
\ 'name': 'languageserver', | ||
\ 'lsp': 'stdio', | ||
\ 'executable_callback': ale#VarFunc('julia_executable'), | ||
\ 'command_callback': 'ale_linters#julia#languageserver#GetCommand', | ||
\ 'language': 'julia', | ||
\ 'project_root_callback': 'ale#julia#FindProjectRoot', | ||
\}) |
Oops, something went wrong.