summaryrefslogtreecommitdiff
path: root/test/test_autocmd_commands.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2020-08-04 20:07:46 +0100
committerw0rp <devw0rp@gmail.com>2020-08-04 20:11:49 +0100
commitacf892c4d14ee73c570527d86cecfc14c84360a9 (patch)
tree1d6669e80c836419e3eadf5c06f4082ff3b37af0 /test/test_autocmd_commands.vader
parent316c7c7372ad6f34e439944713655ccff2123f40 (diff)
downloadale-acf892c4d14ee73c570527d86cecfc14c84360a9.zip
#1532 - Display hover information on CursorHold
Diffstat (limited to 'test/test_autocmd_commands.vader')
-rw-r--r--test/test_autocmd_commands.vader28
1 files changed, 27 insertions, 1 deletions
diff --git a/test/test_autocmd_commands.vader b/test/test_autocmd_commands.vader
index 355b4c77..a69333d4 100644
--- a/test/test_autocmd_commands.vader
+++ b/test/test_autocmd_commands.vader
@@ -49,6 +49,7 @@ Before:
Save g:ale_lint_on_save
Save g:ale_lint_on_text_changed
Save g:ale_pattern_options_enabled
+ Save g:ale_hover_cursor
" Turn everything on by defaul for these tests.
let g:ale_completion_enabled = 1
@@ -61,6 +62,7 @@ Before:
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 1
let g:ale_pattern_options_enabled = 1
+ let g:ale_hover_cursor = 1
After:
delfunction CheckAutocmd
@@ -84,6 +86,7 @@ Execute (All events should be set up when everything is on):
\ 'BufWinEnter * call ale#events#LintOnEnter(str2nr(expand(''<abuf>'')))',
\ 'BufWritePost * call ale#events#SaveEvent(str2nr(expand(''<abuf>'')))',
\ 'CursorHold * if exists(''*ale#engine#Cleanup'') | call ale#cursor#EchoCursorWarningWithDelay() | endif',
+ \ 'CursorHold if exists(''*ale#lsp#Send'') | call ale#hover#ShowTruncatedMessageAtCursor() | endif',
\ 'CursorMoved * if exists(''*ale#engine#Cleanup'') | call ale#cursor#EchoCursorWarningWithDelay() | endif',
\ 'FileChangedShellPost * call ale#events#FileChangedEvent(str2nr(expand(''<abuf>'')))',
\ 'FileType * call ale#events#FileTypeEvent( str2nr(expand(''<abuf>'')), expand(''<amatch>''))',
@@ -95,9 +98,30 @@ Execute (All events should be set up when everything is on):
\ CheckAutocmd('ALEEvents')
Execute (Only the required events should be bound even if various settings are off):
+ let g:ale_enabled = 1
+ let g:ale_completion_enabled = 0
+ let g:ale_echo_cursor = 0
+ let g:ale_fix_on_save = 0
+ let g:ale_lint_on_enter = 0
+ let g:ale_lint_on_filetype_changed = 0
+ let g:ale_lint_on_insert_leave = 0
+ let g:ale_lint_on_save = 0
+ let g:ale_lint_on_text_changed = 0
+ let g:ale_pattern_options_enabled = 0
+ let g:ale_hover_cursor = 0
+
+ AssertEqual
+ \ [
+ \ 'BufEnter * call ale#events#ReadOrEnterEvent(str2nr(expand(''<abuf>'')))',
+ \ 'BufReadPost * call ale#events#ReadOrEnterEvent(str2nr(expand(''<abuf>'')))',
+ \ 'BufWritePost * call ale#events#SaveEvent(str2nr(expand(''<abuf>'')))',
+ \ ],
+ \ CheckAutocmd('ALEEvents')
+
+Execute (The cursor hoever event should be enabled with g:ale_hover_cursor = 1):
+ let g:ale_enabled = 1
let g:ale_completion_enabled = 0
let g:ale_echo_cursor = 0
- let g:ale_enabled = 0
let g:ale_fix_on_save = 0
let g:ale_lint_on_enter = 0
let g:ale_lint_on_filetype_changed = 0
@@ -105,12 +129,14 @@ Execute (Only the required events should be bound even if various settings are o
let g:ale_lint_on_save = 0
let g:ale_lint_on_text_changed = 0
let g:ale_pattern_options_enabled = 0
+ let g:ale_hover_cursor = 1
AssertEqual
\ [
\ 'BufEnter * call ale#events#ReadOrEnterEvent(str2nr(expand(''<abuf>'')))',
\ 'BufReadPost * call ale#events#ReadOrEnterEvent(str2nr(expand(''<abuf>'')))',
\ 'BufWritePost * call ale#events#SaveEvent(str2nr(expand(''<abuf>'')))',
+ \ 'CursorHold * if exists(''*ale#lsp#Send'') | call ale#hover#ShowTruncatedMessageAtCursor() | endif',
\ ],
\ CheckAutocmd('ALEEvents')