Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ale_linters/ruby/solargraph.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand Down
4 changes: 2 additions & 2 deletions doc/ale-ruby.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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'.


===============================================================================
Expand Down
7 changes: 7 additions & 0 deletions test/linter/test_ruby_solargraph.vader
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down