diff options
author | w0rp <devw0rp@gmail.com> | 2018-08-02 23:44:12 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-08-02 23:44:12 +0100 |
commit | 217284360d35711b751859ed27a7a3c3da300e85 (patch) | |
tree | 4b26a84b397e3ac15a8b13a572b1f9a50312dbab /ale_linters/vue | |
parent | 9ef266d050d698c3ed3be3456ce6a5da5755d5ef (diff) | |
download | ale-217284360d35711b751859ed27a7a3c3da300e85.zip |
Simplify the code for most linters and tests with closures
Diffstat (limited to 'ale_linters/vue')
-rw-r--r-- | ale_linters/vue/vls.vim | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/ale_linters/vue/vls.vim b/ale_linters/vue/vls.vim index 0d4bf9f6..7116128b 100644 --- a/ale_linters/vue/vls.vim +++ b/ale_linters/vue/vls.vim @@ -4,18 +4,6 @@ call ale#Set('vue_vls_executable', 'vls') call ale#Set('vue_vls_use_global', get(g:, 'ale_use_global_executables', 0)) -function! ale_linters#vue#vls#GetExecutable(buffer) abort - return ale#node#FindExecutable(a:buffer, 'vue_vls', [ - \ 'node_modules/.bin/vls', - \]) -endfunction - -function! ale_linters#vue#vls#GetCommand(buffer) abort - let l:exe = ale#Escape(ale_linters#vue#vls#GetExecutable(a:buffer)) - - return l:exe . ' --stdio' -endfunction - function! ale_linters#vue#vls#GetProjectRoot(buffer) abort let l:package_path = ale#path#FindNearestFile(a:buffer, 'package.json') @@ -25,8 +13,10 @@ endfunction call ale#linter#Define('vue', { \ 'name': 'vls', \ 'lsp': 'stdio', -\ 'executable_callback': 'ale_linters#vue#vls#GetExecutable', -\ 'command_callback': 'ale_linters#vue#vls#GetCommand', +\ 'executable_callback': ale#node#FindExecutableFunc('vue_vls', [ +\ 'node_modules/.bin/vls', +\ ]), +\ 'command': '%e --stdio', \ 'language': 'vue', \ 'project_root_callback': 'ale_linters#vue#vls#GetProjectRoot', \}) |