summaryrefslogtreecommitdiff
path: root/ale_linters/odin
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/odin')
-rw-r--r--ale_linters/odin/ols.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/ale_linters/odin/ols.vim b/ale_linters/odin/ols.vim
new file mode 100644
index 00000000..242dea0e
--- /dev/null
+++ b/ale_linters/odin/ols.vim
@@ -0,0 +1,19 @@
+" Author: Benjamin Block <https://github.com/benjamindblock>
+" Description: A language server for Odin.
+
+function! ale_linters#odin#ols#GetProjectRoot(buffer) abort
+ return fnamemodify('', ':h')
+endfunction
+
+call ale#Set('odin_ols_executable', 'ols')
+call ale#Set('odin_ols_config', {})
+
+call ale#linter#Define('odin', {
+\ 'name': 'ols',
+\ 'lsp': 'stdio',
+\ 'language': 'odin',
+\ 'lsp_config': {b -> ale#Var(b, 'odin_ols_config')},
+\ 'executable': {b -> ale#Var(b, 'odin_ols_executable')},
+\ 'command': '%e',
+\ 'project_root': function('ale_linters#odin#ols#GetProjectRoot'),
+\})