Close #2132 - Add deprecation warnings for old features
This commit is contained in:
parent
e85eb82401
commit
ce64e349cd
@ -107,24 +107,36 @@ endfunction
|
|||||||
" Register a temporary file to be managed with the ALE engine for
|
" Register a temporary file to be managed with the ALE engine for
|
||||||
" a current job run.
|
" a current job run.
|
||||||
function! ale#engine#ManageFile(buffer, filename) abort
|
function! ale#engine#ManageFile(buffer, filename) abort
|
||||||
" TODO: Emit deprecation warning here later.
|
if !get(g:, 'ale_ignore_2_4_warnings')
|
||||||
|
execute 'echom ''ale#engine#ManageFile is deprecated. Use `let g:ale_ignore_2_4_warnings = 1` to disable this message.'''
|
||||||
|
endif
|
||||||
|
|
||||||
call ale#command#ManageFile(a:buffer, a:filename)
|
call ale#command#ManageFile(a:buffer, a:filename)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Same as the above, but manage an entire directory.
|
" Same as the above, but manage an entire directory.
|
||||||
function! ale#engine#ManageDirectory(buffer, directory) abort
|
function! ale#engine#ManageDirectory(buffer, directory) abort
|
||||||
" TODO: Emit deprecation warning here later.
|
if !get(g:, 'ale_ignore_2_4_warnings')
|
||||||
|
execute 'echom ''ale#engine#ManageDirectory is deprecated. Use `let g:ale_ignore_2_4_warnings = 1` to disable this message.'''
|
||||||
|
endif
|
||||||
|
|
||||||
call ale#command#ManageDirectory(a:buffer, a:directory)
|
call ale#command#ManageDirectory(a:buffer, a:directory)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! ale#engine#CreateFile(buffer) abort
|
function! ale#engine#CreateFile(buffer) abort
|
||||||
" TODO: Emit deprecation warning here later.
|
if !get(g:, 'ale_ignore_2_4_warnings')
|
||||||
|
execute 'echom ''ale#engine#CreateFile is deprecated. Use `let g:ale_ignore_2_4_warnings = 1` to disable this message.'''
|
||||||
|
endif
|
||||||
|
|
||||||
return ale#command#CreateFile(a:buffer)
|
return ale#command#CreateFile(a:buffer)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Create a new temporary directory and manage it in one go.
|
" Create a new temporary directory and manage it in one go.
|
||||||
function! ale#engine#CreateDirectory(buffer) abort
|
function! ale#engine#CreateDirectory(buffer) abort
|
||||||
" TODO: Emit deprecation warning here later.
|
if !get(g:, 'ale_ignore_2_4_warnings')
|
||||||
|
execute 'echom ''ale#engine#CreateDirectory is deprecated. Use `let g:ale_ignore_2_4_warnings = 1` to disable this message.'''
|
||||||
|
endif
|
||||||
|
|
||||||
return ale#command#CreateDirectory(a:buffer)
|
return ale#command#CreateDirectory(a:buffer)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -117,6 +117,10 @@ function! s:HandleExit(job_info, buffer, job_output, data) abort
|
|||||||
let l:input = a:job_info.input
|
let l:input = a:job_info.input
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if l:ChainCallback isnot v:null && !get(g:, 'ale_ignore_2_4_warnings')
|
||||||
|
execute 'echom ''chain_with is deprecated. Use `let g:ale_ignore_2_4_warnings = 1` to disable this message.'''
|
||||||
|
endif
|
||||||
|
|
||||||
let l:next_index = l:ChainCallback is v:null
|
let l:next_index = l:ChainCallback is v:null
|
||||||
\ ? a:job_info.callback_index + 1
|
\ ? a:job_info.callback_index + 1
|
||||||
\ : a:job_info.callback_index
|
\ : a:job_info.callback_index
|
||||||
|
@ -340,7 +340,13 @@ function! ale#linter#PreProcess(filetype, linter) abort
|
|||||||
throw '`aliases` must be a List of String values'
|
throw '`aliases` must be a List of String values'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" TODO: Emit deprecation warnings for deprecated options later.
|
for l:key in filter(keys(l:obj), 'v:val[-9:] is# ''_callback'' || v:val is# ''command_chain''')
|
||||||
|
if !get(g:, 'ale_ignore_2_4_warnings')
|
||||||
|
execute 'echom l:key . '' is deprecated. Use `let g:ale_ignore_2_4_warnings = 1` to disable this message.'''
|
||||||
|
endif
|
||||||
|
|
||||||
|
break
|
||||||
|
endfor
|
||||||
|
|
||||||
return l:obj
|
return l:obj
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -25,10 +25,10 @@ Before:
|
|||||||
call ale#linter#Define('testft', {
|
call ale#linter#Define('testft', {
|
||||||
\ 'name': 'lsplinter',
|
\ 'name': 'lsplinter',
|
||||||
\ 'lsp': 'tsserver',
|
\ 'lsp': 'tsserver',
|
||||||
\ 'executable_callback': 'EmptyString',
|
\ 'executable': function('EmptyString'),
|
||||||
\ 'command_callback': 'EmptyString',
|
\ 'command': function('EmptyString'),
|
||||||
\ 'project_root_callback': 'EmptyString',
|
\ 'project_root': function('EmptyString'),
|
||||||
\ 'language_callback': 'EmptyString',
|
\ 'language': function('EmptyString'),
|
||||||
\})
|
\})
|
||||||
|
|
||||||
call ale#linter#Define('testft', {
|
call ale#linter#Define('testft', {
|
||||||
|
@ -35,3 +35,5 @@ set ttimeoutlen=0
|
|||||||
execute 'set encoding=utf-8'
|
execute 'set encoding=utf-8'
|
||||||
|
|
||||||
let g:mapleader=','
|
let g:mapleader=','
|
||||||
|
|
||||||
|
let g:ale_ignore_2_4_warnings = 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user