summaryrefslogtreecommitdiff
path: root/ale_linters/reason
diff options
context:
space:
mode:
authorDavid Buchan-Swanson <david.buchanswanson@gmail.com>2019-04-10 23:24:47 -0600
committerw0rp <devw0rp@gmail.com>2019-06-08 23:50:41 +0100
commit92d515c211716b5d046518547dba85f352e944b1 (patch)
treeff4eb876b89c69d0e4ca715767188bcd86f3e080 /ale_linters/reason
parent59829bc194ac95f67396f47fb90048afc70537c8 (diff)
downloadale-92d515c211716b5d046518547dba85f352e944b1.zip
Add support for reason-language-server
Diffstat (limited to 'ale_linters/reason')
-rw-r--r--ale_linters/reason/reason_ls.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/ale_linters/reason/reason_ls.vim b/ale_linters/reason/reason_ls.vim
new file mode 100644
index 00000000..9bf25d3a
--- /dev/null
+++ b/ale_linters/reason/reason_ls.vim
@@ -0,0 +1,21 @@
+" Author: David Buchan-Swanson <github@deecewan.com>
+" Description: Integrate ALE with reason-language-server.
+
+function! ale_linters#reason#reason_ls#FindProjectRoot(buffer) abort
+ let l:reason_config = ale#path#FindNearestFile(a:buffer, 'bsconfig.json')
+
+ if !empty(l:reason_config)
+ return fnamemodify(l:reason_config, ':h')
+ endif
+
+ return ''
+endfunction
+
+call ale#linter#Define('reason', {
+\ 'name': 'reason-language-server',
+\ 'lsp': 'stdio',
+\ 'executable':{buffer -> ale#Var(buffer, 'reason_ls_executable')},
+\ 'command': '%e',
+\ 'project_root': function('ale_linters#reason#reason_ls#FindProjectRoot'),
+\ 'language': 'reason',
+\})