mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-08 05:24:46 +08:00
Fix #2440 - Fix the kotlinc command when Maven and Gradle are missing
This commit is contained in:
@@ -12,6 +12,8 @@ let g:ale_kotlin_kotlinc_module_filename = get(g:, 'ale_kotlin_kotlinc_module_fi
|
|||||||
let s:classpath_sep = has('unix') ? ':' : ';'
|
let s:classpath_sep = has('unix') ? ':' : ';'
|
||||||
|
|
||||||
function! ale_linters#kotlin#kotlinc#RunWithImportPaths(buffer) abort
|
function! ale_linters#kotlin#kotlinc#RunWithImportPaths(buffer) abort
|
||||||
|
let l:command = ''
|
||||||
|
|
||||||
" exec maven/gradle only if classpath is not set
|
" exec maven/gradle only if classpath is not set
|
||||||
if ale#Var(a:buffer, 'kotlin_kotlinc_classpath') isnot# ''
|
if ale#Var(a:buffer, 'kotlin_kotlinc_classpath') isnot# ''
|
||||||
return ale_linters#kotlin#kotlinc#GetCommand(a:buffer, [], {})
|
return ale_linters#kotlin#kotlinc#GetCommand(a:buffer, [], {})
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
Before:
|
||||||
|
call ale#assert#SetUpLinterTest('kotlin', 'kotlinc')
|
||||||
|
call ale#test#SetFilename('test.kt')
|
||||||
|
|
||||||
|
After:
|
||||||
|
call ale#assert#TearDownLinterTest()
|
||||||
|
|
||||||
|
Execute(The default command should be correct):
|
||||||
|
AssertLinter 'kotlinc', 'kotlinc ' . ale#Escape(expand('%:p'))
|
||||||
Reference in New Issue
Block a user