mirror of https://github.com/dense-analysis/ale
Update minimum supported NeoVim version to 0.6.0
Stop officially supporting NeoVim versions below 0.6.0, without necessarily breaking ALE for people using older versions.
This commit is contained in:
parent
14350dbb0d
commit
108e858d61
|
@ -28,7 +28,7 @@ jobs:
|
||||||
vim-version:
|
vim-version:
|
||||||
- '--vim-80-only'
|
- '--vim-80-only'
|
||||||
- '--vim-90-only'
|
- '--vim-90-only'
|
||||||
- '--neovim-02-only'
|
- '--neovim-06-only'
|
||||||
- '--neovim-08-only'
|
- '--neovim-08-only'
|
||||||
- '--linters-only'
|
- '--linters-only'
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -4,7 +4,7 @@ FROM testbed/vim:${TESTBED_VIM_VERSION}
|
||||||
|
|
||||||
RUN install_vim -tag v8.0.0027 -build \
|
RUN install_vim -tag v8.0.0027 -build \
|
||||||
-tag v9.0.0297 -build \
|
-tag v9.0.0297 -build \
|
||||||
-tag neovim:v0.2.0 -build \
|
-tag neovim:v0.6.0 -build \
|
||||||
-tag neovim:v0.8.0 -build
|
-tag neovim:v0.8.0 -build
|
||||||
|
|
||||||
ENV PACKAGES="\
|
ENV PACKAGES="\
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
![ALE Logo by Mark Grealish - https://www.bhalash.com/](https://user-images.githubusercontent.com/3518142/59195920-2c339500-8b85-11e9-9c22-f6b7f69637b8.jpg)
|
![ALE Logo by Mark Grealish - https://www.bhalash.com/](https://user-images.githubusercontent.com/3518142/59195920-2c339500-8b85-11e9-9c22-f6b7f69637b8.jpg)
|
||||||
|
|
||||||
ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
|
ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
|
||||||
and semantic errors) in NeoVim 0.2.0+ and Vim 8.0+ while you edit your text files,
|
and semantic errors) in NeoVim 0.6.0+ and Vim 8.0+ while you edit your text files,
|
||||||
and acts as a Vim [Language Server Protocol](https://langserver.org/) client.
|
and acts as a Vim [Language Server Protocol](https://langserver.org/) client.
|
||||||
|
|
||||||
<video autoplay="true" muted="true" loop="true" controls="false" src="https://user-images.githubusercontent.com/3518142/210141215-8f2ff760-6a87-4704-a11e-c109b8e9ec41.mp4" title="An example showing what ALE can do."></video>
|
<video autoplay="true" muted="true" loop="true" controls="false" src="https://user-images.githubusercontent.com/3518142/210141215-8f2ff760-6a87-4704-a11e-c109b8e9ec41.mp4" title="An example showing what ALE can do."></video>
|
||||||
|
|
|
@ -48,7 +48,7 @@ documented functions and options, until a major version is planned. Breaking
|
||||||
changes should be preceded by a deprecation phase complete with warnings.
|
changes should be preceded by a deprecation phase complete with warnings.
|
||||||
Changes required for security may be an exception.
|
Changes required for security may be an exception.
|
||||||
|
|
||||||
ALE supports Vim 8 and above, and NeoVim 0.2.0 or newer. These are the
|
ALE supports Vim 8 and above, and NeoVim 0.6.0 or newer. These are the
|
||||||
earliest versions of Vim and NeoVim which support |job|, |timer|, |closure|,
|
earliest versions of Vim and NeoVim which support |job|, |timer|, |closure|,
|
||||||
and |lambda| features. All ALE code should be written so it is compatible with
|
and |lambda| features. All ALE code should be written so it is compatible with
|
||||||
these versions of Vim, or with version checks so particular features can
|
these versions of Vim, or with version checks so particular features can
|
||||||
|
@ -156,7 +156,7 @@ environments.
|
||||||
|
|
||||||
1. Vim 8.0.0027 on Linux via GitHub Actions.
|
1. Vim 8.0.0027 on Linux via GitHub Actions.
|
||||||
2. Vim 9.0.0297 on Linux via GitHub Actions.
|
2. Vim 9.0.0297 on Linux via GitHub Actions.
|
||||||
3. NeoVim 0.2.0 on Linux via GitHub Actions.
|
3. NeoVim 0.6.0 on Linux via GitHub Actions.
|
||||||
4. NeoVim 0.8.0 on Linux via GitHub Actions.
|
4. NeoVim 0.8.0 on Linux via GitHub Actions.
|
||||||
6. Vim 8 (stable builds) on Windows via AppVeyor.
|
6. Vim 8 (stable builds) on Windows via AppVeyor.
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ let g:loaded_ale_dont_use_this_in_other_plugins_please = 1
|
||||||
|
|
||||||
" A flag for detecting if the required features are set.
|
" A flag for detecting if the required features are set.
|
||||||
if has('nvim')
|
if has('nvim')
|
||||||
|
" We check for NeoVim 0.2.0+, but we only officially support NeoVim 0.6.0
|
||||||
let s:has_features = has('timers') && has('nvim-0.2.0')
|
let s:has_features = has('timers') && has('nvim-0.2.0')
|
||||||
else
|
else
|
||||||
" Check if Job and Channel functions are available, instead of the
|
" Check if Job and Channel functions are available, instead of the
|
||||||
|
@ -25,7 +26,7 @@ if !s:has_features
|
||||||
" Only output a warning if editing some special files.
|
" Only output a warning if editing some special files.
|
||||||
if index(['', 'gitcommit'], &filetype) == -1
|
if index(['', 'gitcommit'], &filetype) == -1
|
||||||
" no-custom-checks
|
" no-custom-checks
|
||||||
echoerr 'ALE requires NeoVim >= 0.2.0 or Vim 8 with +timers +job +channel'
|
echoerr 'ALE requires NeoVim >= 0.6.0 or Vim 8 with +timers +job +channel'
|
||||||
" no-custom-checks
|
" no-custom-checks
|
||||||
echoerr 'Please update your editor appropriately.'
|
echoerr 'Please update your editor appropriately.'
|
||||||
endif
|
endif
|
||||||
|
|
22
run-tests
22
run-tests
|
@ -24,7 +24,7 @@ tests='test/*.vader test/*/*.vader test/*/*/*.vader'
|
||||||
# These flags are forwarded to the script for running Vader tests.
|
# These flags are forwarded to the script for running Vader tests.
|
||||||
verbose_flag=''
|
verbose_flag=''
|
||||||
quiet_flag=''
|
quiet_flag=''
|
||||||
run_neovim_02_tests=1
|
run_neovim_06_tests=1
|
||||||
run_neovim_08_tests=1
|
run_neovim_08_tests=1
|
||||||
run_vim_80_tests=1
|
run_vim_80_tests=1
|
||||||
run_vim_90_tests=1
|
run_vim_90_tests=1
|
||||||
|
@ -43,7 +43,7 @@ while [ $# -ne 0 ]; do
|
||||||
--build-image)
|
--build-image)
|
||||||
run_vim_80_tests=0
|
run_vim_80_tests=0
|
||||||
run_vim_90_tests=0
|
run_vim_90_tests=0
|
||||||
run_neovim_02_tests=0
|
run_neovim_06_tests=0
|
||||||
run_neovim_08_tests=0
|
run_neovim_08_tests=0
|
||||||
run_linters=0
|
run_linters=0
|
||||||
shift
|
shift
|
||||||
|
@ -54,7 +54,7 @@ while [ $# -ne 0 ]; do
|
||||||
run_linters=0
|
run_linters=0
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--neovim-02-only)
|
--neovim-06-only)
|
||||||
run_neovim_08_tests=0
|
run_neovim_08_tests=0
|
||||||
run_vim_80_tests=0
|
run_vim_80_tests=0
|
||||||
run_vim_90_tests=0
|
run_vim_90_tests=0
|
||||||
|
@ -62,27 +62,27 @@ while [ $# -ne 0 ]; do
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--neovim-08-only)
|
--neovim-08-only)
|
||||||
run_neovim_02_tests=0
|
run_neovim_06_tests=0
|
||||||
run_vim_80_tests=0
|
run_vim_80_tests=0
|
||||||
run_vim_90_tests=0
|
run_vim_90_tests=0
|
||||||
run_linters=0
|
run_linters=0
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--vim-only)
|
--vim-only)
|
||||||
run_neovim_02_tests=0
|
run_neovim_06_tests=0
|
||||||
run_neovim_08_tests=0
|
run_neovim_08_tests=0
|
||||||
run_linters=0
|
run_linters=0
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--vim-80-only)
|
--vim-80-only)
|
||||||
run_neovim_02_tests=0
|
run_neovim_06_tests=0
|
||||||
run_neovim_08_tests=0
|
run_neovim_08_tests=0
|
||||||
run_vim_90_tests=0
|
run_vim_90_tests=0
|
||||||
run_linters=0
|
run_linters=0
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--vim-90-only)
|
--vim-90-only)
|
||||||
run_neovim_02_tests=0
|
run_neovim_06_tests=0
|
||||||
run_neovim_08_tests=0
|
run_neovim_08_tests=0
|
||||||
run_vim_80_tests=0
|
run_vim_80_tests=0
|
||||||
run_linters=0
|
run_linters=0
|
||||||
|
@ -91,14 +91,14 @@ while [ $# -ne 0 ]; do
|
||||||
--linters-only)
|
--linters-only)
|
||||||
run_vim_80_tests=0
|
run_vim_80_tests=0
|
||||||
run_vim_90_tests=0
|
run_vim_90_tests=0
|
||||||
run_neovim_02_tests=0
|
run_neovim_06_tests=0
|
||||||
run_neovim_08_tests=0
|
run_neovim_08_tests=0
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--fast)
|
--fast)
|
||||||
run_vim_80_tests=0
|
run_vim_80_tests=0
|
||||||
run_vim_90_tests=0
|
run_vim_90_tests=0
|
||||||
run_neovim_02_tests=0
|
run_neovim_06_tests=0
|
||||||
run_neovim_08_tests=1
|
run_neovim_08_tests=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
@ -113,7 +113,7 @@ while [ $# -ne 0 ]; do
|
||||||
echo ' -q Hide output for successful tests'
|
echo ' -q Hide output for successful tests'
|
||||||
echo ' --build-image Run docker image build only.'
|
echo ' --build-image Run docker image build only.'
|
||||||
echo ' --neovim-only Run tests only for NeoVim'
|
echo ' --neovim-only Run tests only for NeoVim'
|
||||||
echo ' --neovim-02-only Run tests only for NeoVim 0.2'
|
echo ' --neovim-06-only Run tests only for NeoVim 0.2'
|
||||||
echo ' --neovim-08-only Run tests only for NeoVim 0.8'
|
echo ' --neovim-08-only Run tests only for NeoVim 0.8'
|
||||||
echo ' --vim-only Run tests only for Vim'
|
echo ' --vim-only Run tests only for Vim'
|
||||||
echo ' --vim-80-only Run tests only for Vim 8.2'
|
echo ' --vim-80-only Run tests only for Vim 8.2'
|
||||||
|
@ -228,7 +228,7 @@ trap cancel_tests INT TERM
|
||||||
for vim in $(docker run --rm "$DOCKER_RUN_IMAGE" ls /vim-build/bin | grep '^neovim\|^vim' ); do
|
for vim in $(docker run --rm "$DOCKER_RUN_IMAGE" ls /vim-build/bin | grep '^neovim\|^vim' ); do
|
||||||
if ( [[ $vim =~ ^vim-v8.0 ]] && ((run_vim_80_tests)) ) \
|
if ( [[ $vim =~ ^vim-v8.0 ]] && ((run_vim_80_tests)) ) \
|
||||||
|| ( [[ $vim =~ ^vim-v9.0 ]] && ((run_vim_90_tests)) ) \
|
|| ( [[ $vim =~ ^vim-v9.0 ]] && ((run_vim_90_tests)) ) \
|
||||||
|| ( [[ $vim =~ ^neovim-v0.2 ]] && ((run_neovim_02_tests)) ) \
|
|| ( [[ $vim =~ ^neovim-v0.6 ]] && ((run_neovim_06_tests)) ) \
|
||||||
|| ( [[ $vim =~ ^neovim-v0.8 ]] && ((run_neovim_08_tests)) ); then
|
|| ( [[ $vim =~ ^neovim-v0.8 ]] && ((run_neovim_08_tests)) ); then
|
||||||
echo "Starting Vim: $vim..."
|
echo "Starting Vim: $vim..."
|
||||||
file_number=$((file_number+1))
|
file_number=$((file_number+1))
|
||||||
|
|
|
@ -45,7 +45,7 @@ Execute(The start position should be returned when results can be requested):
|
||||||
AssertEqual 11, ale#completion#OmniFunc(1, '')
|
AssertEqual 11, ale#completion#OmniFunc(1, '')
|
||||||
|
|
||||||
Execute(The omnifunc function should return async results):
|
Execute(The omnifunc function should return async results):
|
||||||
" Neovim 0.2.0 and 0.4.4 struggles at running these tests.
|
" Neovim struggles at running these tests.
|
||||||
if !has('nvim')
|
if !has('nvim')
|
||||||
call timer_start(0, function('SetCompletionResult'))
|
call timer_start(0, function('SetCompletionResult'))
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,6 @@ Before:
|
||||||
Save g:ale_use_neovim_diagnostics_api
|
Save g:ale_use_neovim_diagnostics_api
|
||||||
|
|
||||||
function! CollectMessages(buffer)
|
function! CollectMessages(buffer)
|
||||||
if !has('nvim-0.6')
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:messages = []
|
let l:messages = []
|
||||||
for l:diag in v:lua.vim.diagnostic.get(a:buffer)
|
for l:diag in v:lua.vim.diagnostic.get(a:buffer)
|
||||||
call add(l:messages, l:diag.message)
|
call add(l:messages, l:diag.message)
|
||||||
|
@ -22,56 +18,54 @@ After:
|
||||||
|
|
||||||
Execute(Should only set diagnostics belonging to the given buffer):
|
Execute(Should only set diagnostics belonging to the given buffer):
|
||||||
if has('nvim-0.6')
|
if has('nvim-0.6')
|
||||||
|
let b:other_bufnr = bufnr('/foo/bar/baz', 1)
|
||||||
|
" Make sure we actually get another buffer number, or the test is invalid.
|
||||||
|
AssertNotEqual -1, b:other_bufnr
|
||||||
|
|
||||||
let b:other_bufnr = bufnr('/foo/bar/baz', 1)
|
let g:ale_use_neovim_diagnostics_api = 1
|
||||||
" Make sure we actually get another buffer number, or the test is invalid.
|
|
||||||
AssertNotEqual -1, b:other_bufnr
|
|
||||||
|
|
||||||
let g:ale_use_neovim_diagnostics_api = 1
|
call ale#engine#SetResults(bufnr('%'), [
|
||||||
|
\ {
|
||||||
call ale#engine#SetResults(bufnr('%'), [
|
\ 'lnum': 1,
|
||||||
\ {
|
\ 'col': 10,
|
||||||
\ 'lnum': 1,
|
\ 'bufnr': bufnr('%'),
|
||||||
\ 'col': 10,
|
\ 'vcol': 0,
|
||||||
\ 'bufnr': bufnr('%'),
|
\ 'linter_name': 'bettercode',
|
||||||
\ 'vcol': 0,
|
\ 'nr': -1,
|
||||||
\ 'linter_name': 'bettercode',
|
\ 'type': 'W',
|
||||||
\ 'nr': -1,
|
\ 'text': 'A',
|
||||||
\ 'type': 'W',
|
\ },
|
||||||
\ 'text': 'A',
|
\ {
|
||||||
\ },
|
\ 'lnum': 2,
|
||||||
\ {
|
\ 'col': 10,
|
||||||
\ 'lnum': 2,
|
\ 'bufnr': b:other_bufnr,
|
||||||
\ 'col': 10,
|
\ 'vcol': 0,
|
||||||
\ 'bufnr': b:other_bufnr,
|
\ 'linter_name': 'bettercode',
|
||||||
\ 'vcol': 0,
|
\ 'nr': -1,
|
||||||
\ 'linter_name': 'bettercode',
|
\ 'type': 'W',
|
||||||
\ 'nr': -1,
|
\ 'text': 'B',
|
||||||
\ 'type': 'W',
|
\ },
|
||||||
\ 'text': 'B',
|
\ {
|
||||||
\ },
|
\ 'lnum': 3,
|
||||||
\ {
|
\ 'col': 1,
|
||||||
\ 'lnum': 3,
|
\ 'bufnr': bufnr('%'),
|
||||||
\ 'col': 1,
|
\ 'vcol': 0,
|
||||||
\ 'bufnr': bufnr('%'),
|
\ 'linter_name': 'bettercode',
|
||||||
\ 'vcol': 0,
|
\ 'nr': -1,
|
||||||
\ 'linter_name': 'bettercode',
|
\ 'type': 'E',
|
||||||
\ 'nr': -1,
|
\ 'text': 'C',
|
||||||
\ 'type': 'E',
|
\ },
|
||||||
\ 'text': 'C',
|
\ {
|
||||||
\ },
|
\ 'lnum': 4,
|
||||||
\ {
|
\ 'col': 1,
|
||||||
\ 'lnum': 4,
|
\ 'bufnr': b:other_bufnr,
|
||||||
\ 'col': 1,
|
\ 'vcol': 0,
|
||||||
\ 'bufnr': b:other_bufnr,
|
\ 'linter_name': 'bettercode',
|
||||||
\ 'vcol': 0,
|
\ 'nr': -1,
|
||||||
\ 'linter_name': 'bettercode',
|
\ 'type': 'E',
|
||||||
\ 'nr': -1,
|
\ 'text': 'D',
|
||||||
\ 'type': 'E',
|
\ },
|
||||||
\ 'text': 'D',
|
\])
|
||||||
\ },
|
|
||||||
\])
|
|
||||||
|
|
||||||
AssertEqual ["A", "C"], CollectMessages(bufnr('%'))
|
|
||||||
|
|
||||||
|
AssertEqual ["A", "C"], CollectMessages(bufnr('%'))
|
||||||
endif
|
endif
|
||||||
|
|
Loading…
Reference in New Issue