#2132 - Replace all uses of foo_callback with foo

This commit is contained in:
w0rp
2019-02-22 18:05:04 +00:00
parent f53b25d256
commit 883978ece9
214 changed files with 452 additions and 524 deletions

View File

@@ -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_'.

View File

@@ -112,14 +112,6 @@ function! ale#assert#LSPLanguage(expected_language) abort
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)
@@ -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

View File

@@ -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

View File

@@ -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.
"