diff options
| author | Evgeni Golov | 2026-02-17 21:26:48 +0100 |
|---|---|---|
| committer | GitHub | 2026-02-17 20:26:48 +0000 |
| commit | 69c945d5daecadf8e4c4c499d0a7babda748d603 (patch) | |
| tree | f3b6a4ad471a96c5dd7b6b02b3b3a65c24e2bd51 | |
| parent | cb8c4662aaa5c4ce91357932dab71992763ae8be (diff) | |
| download | ale-69c945d5daecadf8e4c4c499d0a7babda748d603.tar.gz | |
support running solargraph via bundle (#5097)
| -rw-r--r-- | ale_linters/ruby/solargraph.vim | 5 | ||||
| -rw-r--r-- | doc/ale-ruby.txt | 4 | ||||
| -rw-r--r-- | test/linter/test_ruby_solargraph.vader | 7 |
3 files changed, 13 insertions, 3 deletions
diff --git a/ale_linters/ruby/solargraph.vim b/ale_linters/ruby/solargraph.vim index bf54a55c3..6d9be3191 100644 --- a/ale_linters/ruby/solargraph.vim +++ b/ale_linters/ruby/solargraph.vim @@ -8,7 +8,10 @@ call ale#Set('ruby_solargraph_executable', 'solargraph') call ale#Set('ruby_solargraph_options', {}) function! ale_linters#ruby#solargraph#GetCommand(buffer) abort - return '%e' . ale#Pad('stdio') + let l:executable = ale#Var(a:buffer, 'ruby_solargraph_executable') + + return ale#ruby#EscapeExecutable(l:executable, 'solargraph') + \ . ale#Pad('stdio') endfunction call ale#linter#Define('ruby', { diff --git a/doc/ale-ruby.txt b/doc/ale-ruby.txt index 57f17dd52..dec7baaef 100644 --- a/doc/ale-ruby.txt +++ b/doc/ale-ruby.txt @@ -227,8 +227,8 @@ g:ale_ruby_solargraph_executable Type: |String| Default: `'solargraph'` - Override the invoked solargraph binary. This is useful for running solargraph - from binstubs or a bundle. + Override the invoked solargraph binary. Set this to `'bundle'` to invoke + `'bundle` `exec` solargraph'. =============================================================================== diff --git a/test/linter/test_ruby_solargraph.vader b/test/linter/test_ruby_solargraph.vader index 1ae67f50c..3531f7f3a 100644 --- a/test/linter/test_ruby_solargraph.vader +++ b/test/linter/test_ruby_solargraph.vader @@ -13,6 +13,13 @@ Execute(command callback executable can be overridden): let g:ale_ruby_solargraph_executable = 'foobar' AssertLinter 'foobar', ale#Escape('foobar') . ' stdio' +Execute(Setting bundle appends 'exec solargraph'): + let g:ale_ruby_solargraph_executable = 'path to/bundle' + + AssertLinter 'path to/bundle', ale#Escape('path to/bundle') + \ . ' exec solargraph' + \ . ' stdio' + Execute(should set solargraph for rails app): call ale#test#SetFilename('../test-files/ruby/valid_rails_app/app/models/thing.rb') AssertLSPLanguage 'ruby' |