summaryrefslogtreecommitdiff
path: root/ale_linters/dart/dartanalyzer.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/dart/dartanalyzer.vim')
-rw-r--r--ale_linters/dart/dartanalyzer.vim9
1 files changed, 2 insertions, 7 deletions
diff --git a/ale_linters/dart/dartanalyzer.vim b/ale_linters/dart/dartanalyzer.vim
index ef33c9d4..26817df5 100644
--- a/ale_linters/dart/dartanalyzer.vim
+++ b/ale_linters/dart/dartanalyzer.vim
@@ -3,15 +3,10 @@
call ale#Set('dart_dartanalyzer_executable', 'dartanalyzer')
-function! ale_linters#dart#dartanalyzer#GetExecutable(buffer) abort
- return ale#Var(a:buffer, 'dart_dartanalyzer_executable')
-endfunction
-
function! ale_linters#dart#dartanalyzer#GetCommand(buffer) abort
- let l:executable = ale_linters#dart#dartanalyzer#GetExecutable(a:buffer)
let l:path = ale#path#FindNearestFile(a:buffer, '.packages')
- return ale#Escape(l:executable)
+ return '%e'
\ . (!empty(l:path) ? ' --packages ' . ale#Escape(l:path) : '')
\ . ' %s'
endfunction
@@ -34,7 +29,7 @@ endfunction
call ale#linter#Define('dart', {
\ 'name': 'dartanalyzer',
-\ 'executable_callback': 'ale_linters#dart#dartanalyzer#GetExecutable',
+\ 'executable_callback': ale#VarFunc('dart_dartanalyzer_executable'),
\ 'command_callback': 'ale_linters#dart#dartanalyzer#GetCommand',
\ 'callback': 'ale_linters#dart#dartanalyzer#Handle',
\ 'lint_file': 1,