From 61c1ddd90429c2604867358aedc2456b560845f9 Mon Sep 17 00:00:00 2001 From: w0rp Date: Mon, 15 Apr 2019 13:36:03 +0100 Subject: [PATCH] Fix #2440 - Fix the kotlinc command when Maven and Gradle are missing --- ale_linters/kotlin/kotlinc.vim | 2 ++ .../command_callback/test_kotlinc_command_callback.vader | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 test/command_callback/test_kotlinc_command_callback.vader diff --git a/ale_linters/kotlin/kotlinc.vim b/ale_linters/kotlin/kotlinc.vim index fddd6625..3c6854fa 100644 --- a/ale_linters/kotlin/kotlinc.vim +++ b/ale_linters/kotlin/kotlinc.vim @@ -12,6 +12,8 @@ let g:ale_kotlin_kotlinc_module_filename = get(g:, 'ale_kotlin_kotlinc_module_fi let s:classpath_sep = has('unix') ? ':' : ';' function! ale_linters#kotlin#kotlinc#RunWithImportPaths(buffer) abort + let l:command = '' + " exec maven/gradle only if classpath is not set if ale#Var(a:buffer, 'kotlin_kotlinc_classpath') isnot# '' return ale_linters#kotlin#kotlinc#GetCommand(a:buffer, [], {}) diff --git a/test/command_callback/test_kotlinc_command_callback.vader b/test/command_callback/test_kotlinc_command_callback.vader new file mode 100644 index 00000000..fe94bffa --- /dev/null +++ b/test/command_callback/test_kotlinc_command_callback.vader @@ -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'))