mirror of
https://github.com/dense-analysis/ale.git
synced 2026-02-11 20:51:49 +08:00
#2132 - Replace all uses of foo_callback with foo
This commit is contained in:
@@ -16,48 +16,47 @@ Execute(The buffer-specific variable can be a string):
|
||||
let b:ale_lsp_root = '/some/path'
|
||||
call ale#test#SetFilename('other-file.c')
|
||||
|
||||
AssertLSPProjectFull '/some/path'
|
||||
AssertLSPProject '/some/path'
|
||||
|
||||
Execute(The buffer-specific variable can be a dictionary):
|
||||
let b:ale_lsp_root = {'clangd': '/some/path', 'golangserver': '/other/path'}
|
||||
call ale#test#SetFilename('other-file.c')
|
||||
|
||||
AssertLSPProjectFull '/some/path'
|
||||
AssertLSPProject '/some/path'
|
||||
|
||||
Execute(The buffer-specific variable can have funcrefs):
|
||||
let b:ale_lsp_root = {'clangd': function('Hook1'), 'golangserver': '/path'}
|
||||
call ale#test#SetFilename('other-file.c')
|
||||
|
||||
AssertLSPProjectFull 'abc123'
|
||||
AssertLSPProject 'abc123'
|
||||
|
||||
Execute(The global variable can be a dictionary):
|
||||
let g:ale_lsp_root = {'clangd': '/some/path', 'golangserver': '/other/path'}
|
||||
call ale#test#SetFilename('other-file.c')
|
||||
|
||||
AssertLSPProjectFull '/some/path'
|
||||
AssertLSPProject '/some/path'
|
||||
|
||||
Execute(The global variable can have funcrefs):
|
||||
let g:ale_lsp_root = {'clangd': function('Hook1'), 'golangserver': '/path'}
|
||||
call ale#test#SetFilename('other-file.c')
|
||||
|
||||
AssertLSPProjectFull 'abc123'
|
||||
AssertLSPProject 'abc123'
|
||||
|
||||
Execute(The buffer-specific variable overrides the global variable):
|
||||
let b:ale_lsp_root = {'clangd': '/some/path', 'golangserver': '/other/path'}
|
||||
let g:ale_lsp_root = {'clangd': '/not/this/path', 'golangserver': '/elsewhere'}
|
||||
call ale#test#SetFilename('other-file.c')
|
||||
|
||||
AssertLSPProjectFull '/some/path'
|
||||
AssertLSPProject '/some/path'
|
||||
|
||||
Execute(The global variable is queried if the buffer-specific has no value):
|
||||
let b:ale_lsp_root = {'golangserver': '/other/path'}
|
||||
let g:ale_lsp_root = {'clangd': '/some/path', 'golangserver': '/elsewhere'}
|
||||
call ale#test#SetFilename('other-file.c')
|
||||
|
||||
AssertLSPProjectFull '/some/path'
|
||||
|
||||
AssertLSPProject '/some/path'
|
||||
|
||||
Execute(The default hook value is acceptable):
|
||||
call ale#test#SetFilename('other-file.c')
|
||||
|
||||
AssertLSPProjectFull ''
|
||||
AssertLSPProject ''
|
||||
|
||||
Reference in New Issue
Block a user