diff options
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/bib/bibclean.vim | 7 | ||||
-rw-r--r-- | ale_linters/java/javac.vim | 8 | ||||
-rw-r--r-- | ale_linters/python/jedils.vim | 34 | ||||
-rw-r--r-- | ale_linters/typescript/tsserver.vim | 1 |
4 files changed, 42 insertions, 8 deletions
diff --git a/ale_linters/bib/bibclean.vim b/ale_linters/bib/bibclean.vim index 9056a9c3..f1610e00 100644 --- a/ale_linters/bib/bibclean.vim +++ b/ale_linters/bib/bibclean.vim @@ -18,7 +18,12 @@ function! ale_linters#bib#bibclean#get_type(str) abort endfunction function! ale_linters#bib#bibclean#match_msg(line) abort - return matchlist(a:line, '^\(.*\) "stdin", line \(.*\): \(.*\)$') + " Legacy message pattern works for bibclean <= v2.11.4. If empty, try + " the new message pattern for bibtex > v2.11.4 + let l:matches_legacy = matchlist(a:line, '^\(.*\) "stdin", line \(\d\+\): \(.*\)$') + + return ! empty(l:matches_legacy) ? l:matches_legacy + \ : matchlist(a:line, '^\(.*\) stdin:\(\d\+\):\(.*\)$') endfunction function! ale_linters#bib#bibclean#match_entry(line) abort diff --git a/ale_linters/java/javac.vim b/ale_linters/java/javac.vim index f866eb09..a5e57e6c 100644 --- a/ale_linters/java/javac.vim +++ b/ale_linters/java/javac.vim @@ -9,13 +9,7 @@ call ale#Set('java_javac_classpath', '') call ale#Set('java_javac_sourcepath', '') function! ale_linters#java#javac#RunWithImportPaths(buffer) abort - let l:command = '' - let l:pom_path = ale#path#FindNearestFile(a:buffer, 'pom.xml') - - if !empty(l:pom_path) && executable('mvn') - let l:command = ale#path#CdString(fnamemodify(l:pom_path, ':h')) - \ . 'mvn dependency:build-classpath' - endif + let l:command = ale#maven#BuildClasspathCommand(a:buffer) " Try to use Gradle if Maven isn't available. if empty(l:command) diff --git a/ale_linters/python/jedils.vim b/ale_linters/python/jedils.vim new file mode 100644 index 00000000..eae5fb07 --- /dev/null +++ b/ale_linters/python/jedils.vim @@ -0,0 +1,34 @@ +" Author: Dalius Dobravolskas <dalius.dobravolskas@gmail.com> +" Description: https://github.com/pappasam/jedi-language-server + +call ale#Set('python_jedils_executable', 'jedi-language-server') +call ale#Set('python_jedils_use_global', get(g:, 'ale_use_global_executables', 0)) +call ale#Set('python_jedils_auto_pipenv', 0) + +function! ale_linters#python#jedils#GetExecutable(buffer) abort + if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_jedils_auto_pipenv')) + \ && ale#python#PipenvPresent(a:buffer) + return 'pipenv' + endif + + return ale#python#FindExecutable(a:buffer, 'python_jedils', ['jedi-language-server']) +endfunction + +function! ale_linters#python#jedils#GetCommand(buffer) abort + let l:executable = ale_linters#python#jedils#GetExecutable(a:buffer) + + let l:exec_args = l:executable =~? 'pipenv$' + \ ? ' run jedi-language-server' + \ : '' + + return ale#Escape(l:executable) . l:exec_args +endfunction + +call ale#linter#Define('python', { +\ 'name': 'jedils', +\ 'lsp': 'stdio', +\ 'executable': function('ale_linters#python#jedils#GetExecutable'), +\ 'command': function('ale_linters#python#jedils#GetCommand'), +\ 'project_root': function('ale#python#FindProjectRoot'), +\ 'completion_filter': 'ale#completion#python#CompletionItemFilter', +\}) diff --git a/ale_linters/typescript/tsserver.vim b/ale_linters/typescript/tsserver.vim index 840889f3..4726e40d 100644 --- a/ale_linters/typescript/tsserver.vim +++ b/ale_linters/typescript/tsserver.vim @@ -9,6 +9,7 @@ call ale#linter#Define('typescript', { \ 'name': 'tsserver', \ 'lsp': 'tsserver', \ 'executable': {b -> ale#node#FindExecutable(b, 'typescript_tsserver', [ +\ '.yarn/sdks/typescript/bin/tsserver', \ 'node_modules/.bin/tsserver', \ ])}, \ 'command': '%e', |