summaryrefslogtreecommitdiff
path: root/ale_linters/d/dls.vim
diff options
context:
space:
mode:
authorAuri <me@aurieh.me>2018-10-17 18:11:41 +0300
committerw0rp <w0rp@users.noreply.github.com>2018-10-17 16:11:41 +0100
commitbe21aa5cda39850d9f0261e3b6cac9d48a170756 (patch)
treedac5b3105be2930e81be392b7afbcdbed1d75309 /ale_linters/d/dls.vim
parentd999eb1f3564cb2933059ae2bc1e7d5edda2a8d2 (diff)
downloadale-be21aa5cda39850d9f0261e3b6cac9d48a170756.zip
New linter: dls (#1992)
* New linter: dls
Diffstat (limited to 'ale_linters/d/dls.vim')
-rw-r--r--ale_linters/d/dls.vim22
1 files changed, 22 insertions, 0 deletions
diff --git a/ale_linters/d/dls.vim b/ale_linters/d/dls.vim
new file mode 100644
index 00000000..7210d21e
--- /dev/null
+++ b/ale_linters/d/dls.vim
@@ -0,0 +1,22 @@
+" Author: aurieh <me@aurieh.me>
+" Description: A Language Server implementation for D
+
+call ale#Set('d_dls_executable', 'dls')
+
+function! ale_linters#d#dls#GetExecutable(buffer) abort
+ return ale#Var(a:buffer, 'd_dls_executable')
+endfunction
+
+function! ale_linters#d#dls#FindProjectRoot(buffer) abort
+ " Note: this will return . if dub config is empty
+ " dls can run outside DUB projects just fine
+ return fnamemodify(ale#d#FindDUBConfig(a:buffer), ':h')
+endfunction
+
+call ale#linter#Define('d', {
+\ 'name': 'dls',
+\ 'lsp': 'stdio',
+\ 'executable_callback': 'ale_linters#d#dls#GetExecutable',
+\ 'command_callback': 'ale_linters#d#dls#GetExecutable',
+\ 'project_root_callback': 'ale_linters#d#dls#FindProjectRoot',
+\})