summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-07-02 13:25:36 +0100
committerw0rp <devw0rp@gmail.com>2017-07-02 13:25:36 +0100
commit51f256e897891617eb8539c31f0c48e037600de7 (patch)
tree210e120165e290fe58ca6906d791d1450aa1dd77 /autoload
parent857ca941d214a65b2168429bcd3b12df26f13a67 (diff)
downloadale-51f256e897891617eb8539c31f0c48e037600de7.zip
Remove the need for pointless callbacks for LSP linters
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/linter.vim13
1 files changed, 8 insertions, 5 deletions
diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim
index 3419f5af..4138b876 100644
--- a/autoload/ale/linter.vim
+++ b/autoload/ale/linter.vim
@@ -52,21 +52,24 @@ function! ale#linter#PreProcess(linter) abort
let l:obj = {
\ 'name': get(a:linter, 'name'),
\ 'lsp': get(a:linter, 'lsp', ''),
- \ 'callback': get(a:linter, 'callback'),
\}
if type(l:obj.name) != type('')
throw '`name` must be defined to name the linter'
endif
- if !s:IsCallback(l:obj.callback)
- throw '`callback` must be defined with a callback to accept output'
- endif
-
let l:needs_address = l:obj.lsp ==# 'socket'
let l:needs_executable = l:obj.lsp !=# 'socket'
let l:needs_command = l:obj.lsp !=# 'socket'
+ if empty(l:obj.lsp)
+ let l:obj.callback = get(a:linter, 'callback')
+
+ if !s:IsCallback(l:obj.callback)
+ throw '`callback` must be defined with a callback to accept output'
+ endif
+ endif
+
if index(['', 'socket', 'stdio', 'tsserver'], l:obj.lsp) < 0
throw '`lsp` must be either `''lsp''` or `''tsserver''` if defined'
endif