Close #4401 - Use subtle defaults for virtual-text

Default virtual-text to the Comment highlight group and prefix
virtual-text messages with comment text for each language by default.

Messages can now be formatted with `%type%` to print the error type.

The Vim 9.0 version has been updated in the Docker image to add test
coverage for virtual-text.
This commit is contained in:
w0rp
2022-12-27 23:11:53 +00:00
parent 98b2ef438e
commit a18472cc58
7 changed files with 343 additions and 100 deletions

View File

@@ -129,7 +129,7 @@ After:
Given javascript(A Javscript file with warnings/errors):
var x = 3 + 12345678
var x = 5*2 + parseInt("10");
// comment
//" comment
Execute(Messages should be shown for the correct lines):
call cursor(1, 1)
@@ -219,6 +219,26 @@ Execute(The severity should be formatted into the message correctly):
AssertEqual 'Info: Some information', g:last_message
Execute(The type should be formatted into the message correctly):
let g:ale_echo_msg_format = '%type%: %s'
call cursor(2, 9)
call ale#cursor#EchoCursorWarning()
AssertEqual
\ 'W: Infix operators must be spaced.',
\ g:last_message
call cursor(1, 10)
call ale#cursor#EchoCursorWarning()
AssertEqual 'E: Missing semicolon.', g:last_message
call cursor(1, 14)
call ale#cursor#EchoCursorWarning()
AssertEqual 'I: Some information', g:last_message
Execute(The %code% and %ifcode% should show the code and some text):
let g:ale_echo_msg_format = '%(code) %%s'