summaryrefslogtreecommitdiff
path: root/ale_linters/ruby/sorbet.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ale_linters/ruby/sorbet.vim')
-rw-r--r--ale_linters/ruby/sorbet.vim23
1 files changed, 23 insertions, 0 deletions
diff --git a/ale_linters/ruby/sorbet.vim b/ale_linters/ruby/sorbet.vim
new file mode 100644
index 00000000..ee765a6e
--- /dev/null
+++ b/ale_linters/ruby/sorbet.vim
@@ -0,0 +1,23 @@
+call ale#Set('ruby_sorbet_executable', 'srb')
+call ale#Set('ruby_sorbet_options', '')
+
+function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
+ let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
+ let l:options = ale#Var(a:buffer, 'ruby_sorbet_options')
+
+ return ale#handlers#ruby#EscapeExecutable(l:executable, 'srb')
+ \ . ' tc'
+ \ . (!empty(l:options) ? ' ' . l:options : '')
+ \ . ' --lsp --disable-watchman'
+endfunction
+
+call ale#linter#Define('ruby', {
+\ 'name': 'sorbet',
+\ 'aliases': ['srb'],
+\ 'lsp': 'stdio',
+\ 'language': 'ruby',
+\ 'executable': {b -> ale#Var(b, 'ruby_sorbet_executable')},
+\ 'command': function('ale_linters#ruby#sorbet#GetCommand'),
+\ 'project_root': function('ale#ruby#FindProjectRoot')
+\})
+