mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
* Add initialization_options to Sorbet LSP linter Using a predefined object will ensure that Sorbet always receives an object instead of an array. LSP defines the initializationOptions as anything. Unfortunately Sorbet is too strict and raises an error when anything other than an object is passed which causes the linter to fail * Document empty objects will prevent Sorbet from properly initializing
44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
|
|
Before:
|
|
call ale#assert#SetUpLinterTest('ruby', 'sorbet')
|
|
call ale#test#SetFilename('dummy.rb')
|
|
|
|
let g:ale_ruby_sorbet_executable = 'srb'
|
|
let g:ale_ruby_sorbet_options = ''
|
|
let g:ale_ruby_sorbet_enable_watchman = 0
|
|
let g:ale_ruby_sorbet_initialization_options = { 'highlightUntyped': v:false }
|
|
|
|
After:
|
|
call ale#assert#TearDownLinterTest()
|
|
|
|
Execute(Executable should default to srb):
|
|
AssertLinter 'srb', ale#Escape('srb')
|
|
\ . ' tc --lsp --disable-watchman'
|
|
|
|
Execute(Able to enable watchman):
|
|
let g:ale_ruby_sorbet_enable_watchman = 1
|
|
|
|
AssertLinter 'srb', ale#Escape('srb')
|
|
\ . ' tc --lsp'
|
|
|
|
Execute(Should be able to set a custom executable):
|
|
let g:ale_ruby_sorbet_executable = 'bin/srb'
|
|
|
|
AssertLinter 'bin/srb' , ale#Escape('bin/srb')
|
|
\ . ' tc --lsp --disable-watchman'
|
|
|
|
Execute(Setting bundle appends 'exec srb tc'):
|
|
let g:ale_ruby_sorbet_executable = 'path to/bundle'
|
|
|
|
AssertLinter 'path to/bundle', ale#Escape('path to/bundle')
|
|
\ . ' exec srb'
|
|
\ . ' tc --lsp --disable-watchman'
|
|
|
|
Execute(Should use predetermined initialization_options by default):
|
|
AssertLSPOptions { 'highlightUntyped': v:false }
|
|
|
|
Execute(Should be able to set custom initialization_options):
|
|
let g:ale_ruby_sorbet_initialization_options = {'enableTypedFalse': v:true}
|
|
|
|
AssertLSPOptions {'enableTypedFalse': v:true}
|