diff options
author | w0rp <devw0rp@gmail.com> | 2019-02-22 18:05:04 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2019-02-22 18:05:04 +0000 |
commit | 883978ece93bd19250d6d7e8b9659b48f23522e2 (patch) | |
tree | 8ac9417b7c980906295745cc5ea709b91a789390 /autoload | |
parent | f53b25d2567a2f7495dab444680596f48de427d1 (diff) | |
download | ale-883978ece93bd19250d6d7e8b9659b48f23522e2.zip |
#2132 - Replace all uses of foo_callback with foo
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale.vim | 5 | ||||
-rw-r--r-- | autoload/ale/assert.vim | 21 | ||||
-rw-r--r-- | autoload/ale/linter.vim | 2 | ||||
-rw-r--r-- | autoload/ale/node.vim | 5 |
4 files changed, 9 insertions, 24 deletions
diff --git a/autoload/ale.vim b/autoload/ale.vim index f6c23d72..5aa5fbfc 100644 --- a/autoload/ale.vim +++ b/autoload/ale.vim @@ -169,11 +169,6 @@ function! ale#Var(buffer, variable_name) abort return get(l:vars, l:full_name, g:[l:full_name]) endfunction -" As above, but curry the arguments so only the buffer number is required. -function! ale#VarFunc(variable_name) abort - return {buf -> ale#Var(buf, a:variable_name)} -endfunction - " Initialize a variable with a default value, if it isn't already set. " " Every variable name will be prefixed with 'ale_'. diff --git a/autoload/ale/assert.vim b/autoload/ale/assert.vim index 1b004649..6c2586a6 100644 --- a/autoload/ale/assert.vim +++ b/autoload/ale/assert.vim @@ -114,14 +114,6 @@ endfunction function! ale#assert#LSPProject(expected_root) abort let l:buffer = bufnr('') let l:linter = s:GetLinter() - let l:root = ale#util#GetFunction(l:linter.project_root_callback)(l:buffer) - - AssertEqual a:expected_root, l:root -endfunction - -function! ale#assert#LSPProjectFull(expected_root) abort - let l:buffer = bufnr('') - let l:linter = s:GetLinter() let l:root = ale#lsp_linter#FindProjectRoot(l:buffer, l:linter) AssertEqual a:expected_root, l:root @@ -130,7 +122,7 @@ endfunction function! ale#assert#LSPAddress(expected_address) abort let l:buffer = bufnr('') let l:linter = s:GetLinter() - let l:address = ale#util#GetFunction(l:linter.address_callback)(l:buffer) + let l:address = ale#linter#GetAddress(l:buffer, l:linter) AssertEqual a:expected_address, l:address endfunction @@ -143,7 +135,6 @@ function! ale#assert#SetUpLinterTestCommands() abort command! -nargs=+ AssertLSPConfig :call ale#assert#LSPConfig(<args>) command! -nargs=+ AssertLSPLanguage :call ale#assert#LSPLanguage(<args>) command! -nargs=+ AssertLSPProject :call ale#assert#LSPProject(<args>) - command! -nargs=+ AssertLSPProjectFull :call ale#assert#LSPProjectFull(<args>) command! -nargs=+ AssertLSPAddress :call ale#assert#LSPAddress(<args>) endfunction @@ -159,6 +150,12 @@ function! ale#assert#SetUpLinterTest(filetype, name) abort let l:prefix = 'ale_' . a:filetype . '_' . a:name let b:filter_expr = 'v:val[: len(l:prefix) - 1] is# l:prefix' + Save g:ale_lsp_root + let g:ale_lsp_root = {} + + Save b:ale_lsp_root + unlet! b:ale_lsp_root + Save g:ale_c_build_dir unlet! g:ale_c_build_dir @@ -216,10 +213,6 @@ function! ale#assert#TearDownLinterTest() abort delcommand AssertLSPProject endif - if exists(':AssertLSPProjectFull') - delcommand AssertLSPProjectFull - endif - if exists(':AssertLSPAddress') delcommand AssertLSPAddress endif diff --git a/autoload/ale/linter.vim b/autoload/ale/linter.vim index 74d5c14a..4937a6d7 100644 --- a/autoload/ale/linter.vim +++ b/autoload/ale/linter.vim @@ -340,6 +340,8 @@ function! ale#linter#PreProcess(filetype, linter) abort throw '`aliases` must be a List of String values' endif + " TODO: Emit deprecation warnings for deprecated options later. + return l:obj endfunction diff --git a/autoload/ale/node.vim b/autoload/ale/node.vim index 5c579c75..f75280b7 100644 --- a/autoload/ale/node.vim +++ b/autoload/ale/node.vim @@ -23,11 +23,6 @@ function! ale#node#FindExecutable(buffer, base_var_name, path_list) abort return ale#Var(a:buffer, a:base_var_name . '_executable') endfunction -" As above, but curry the arguments so only the buffer number is required. -function! ale#node#FindExecutableFunc(base_var_name, path_list) abort - return {buf -> ale#node#FindExecutable(buf, a:base_var_name, a:path_list)} -endfunction - " Create a executable string which executes a Node.js script command with a " Node.js executable if needed. " |