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 (#4954)
* 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
This commit is contained in:
@@ -6,6 +6,7 @@ Before:
|
||||
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()
|
||||
@@ -32,3 +33,11 @@ Execute(Setting bundle appends 'exec srb tc'):
|
||||
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}
|
||||
|
||||
Reference in New Issue
Block a user