summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ale_linters/reason/reason_ls.vim21
-rw-r--r--doc/ale-reasonml.txt16
2 files changed, 37 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',
+\})
diff --git a/doc/ale-reasonml.txt b/doc/ale-reasonml.txt
index 426d4c46..89231f4f 100644
--- a/doc/ale-reasonml.txt
+++ b/doc/ale-reasonml.txt
@@ -34,6 +34,22 @@ g:ale_reason_ols_use_global *g:ale_reason_ols_use_global*
executable. See also |ale-integrations-local-executables|.
===============================================================================
+reason-language-server *ale-reasonml-language-server*
+
+ Note: You *must* set an executable - there is no 'default' install location.
+ Go to https://github.com/jaredly/reason-language-server and download the
+ latest release. You can place it anywhere, but ensure you set the executable
+ path.
+
+g:ale_reason_ls_executable *g:ale_reason_ls_executable*
+ *b:ale_reason_ls_executable*
+ Type: |String|
+
+ This variable defines the standard location of the language server
+ executable. This *must* be set.
+
+
+===============================================================================
refmt *ale-reasonml-refmt*
g:ale_reasonml_refmt_executable *g:ale_reasonml_refmt_executable*