2016-10-14 19:29:31 +00:00
|
|
|
Before:
|
2016-10-24 19:21:32 +00:00
|
|
|
let g:ale_buffer_info = {
|
|
|
|
\ bufnr('%'): {
|
|
|
|
\ 'loclist': [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'bufnr': bufnr('%'),
|
|
|
|
\ 'vcol': 0,
|
|
|
|
\ 'linter_name': 'eslint',
|
|
|
|
\ 'nr': -1,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'col': 10,
|
2017-03-02 07:14:30 +00:00
|
|
|
\ 'text': 'Missing semicolon. (semi)',
|
|
|
|
\ 'detail': 'Every statement should end with a semicolon'
|
2016-10-24 19:21:32 +00:00
|
|
|
\ },
|
|
|
|
\ {
|
2016-10-14 19:29:31 +00:00
|
|
|
\ 'lnum': 2,
|
|
|
|
\ 'bufnr': bufnr('%'),
|
|
|
|
\ 'vcol': 0,
|
|
|
|
\ 'linter_name': 'eslint',
|
|
|
|
\ 'nr': -1,
|
|
|
|
\ 'type': 'W',
|
|
|
|
\ 'col': 10,
|
|
|
|
\ 'text': 'Infix operators must be spaced. (space-infix-ops)'
|
2016-10-24 19:21:32 +00:00
|
|
|
\ },
|
|
|
|
\ {
|
2016-10-14 19:29:31 +00:00
|
|
|
\ 'lnum': 2,
|
|
|
|
\ 'bufnr': bufnr('%'),
|
|
|
|
\ 'vcol': 0,
|
|
|
|
\ 'linter_name': 'eslint',
|
|
|
|
\ 'nr': -1,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'col': 15,
|
|
|
|
\ 'text': 'Missing radix parameter (radix)'
|
2016-10-24 19:21:32 +00:00
|
|
|
\ }
|
|
|
|
\ ],
|
|
|
|
\ },
|
2016-10-14 19:29:31 +00:00
|
|
|
\}
|
|
|
|
|
|
|
|
After:
|
|
|
|
unlet! g:output
|
|
|
|
unlet! g:lines
|
2016-10-24 19:21:32 +00:00
|
|
|
let g:ale_buffer_info = {}
|
2016-10-14 19:29:31 +00:00
|
|
|
|
|
|
|
Given javascript(A Javscript file with warnings/errors):
|
|
|
|
var x = 3
|
|
|
|
var x = 5*2 + parseInt("10");
|
|
|
|
|
|
|
|
Execute(Evaluate the cursor function at line 1):
|
|
|
|
:1
|
|
|
|
call ale#cursor#EchoCursorWarning()
|
|
|
|
|
|
|
|
Then(Check the cursor output):
|
|
|
|
redir => g:output
|
|
|
|
:mess
|
|
|
|
redir END
|
|
|
|
|
|
|
|
let g:lines = split(g:output, "\n")
|
|
|
|
|
|
|
|
AssertEqual 'Missing semicolon. (semi)', g:lines[-1]
|
|
|
|
|
|
|
|
Execute(Evaluate the cursor function at line 2):
|
|
|
|
:2
|
|
|
|
call ale#cursor#EchoCursorWarning()
|
|
|
|
|
|
|
|
Then(Check the cursor output):
|
|
|
|
redir => g:output
|
|
|
|
:mess
|
|
|
|
redir END
|
|
|
|
|
|
|
|
let g:lines = split(g:output, "\n")
|
|
|
|
|
|
|
|
AssertEqual 'Infix operators must be spaced. (space-infix-ops)', g:lines[-1]
|
|
|
|
|
|
|
|
Execute(Evaluate the cursor function later in line 2):
|
|
|
|
:2
|
|
|
|
normal 16l
|
|
|
|
call ale#cursor#EchoCursorWarning()
|
|
|
|
|
|
|
|
Then(Check the cursor output):
|
|
|
|
redir => g:output
|
|
|
|
:mess
|
|
|
|
redir END
|
|
|
|
|
|
|
|
let g:lines = split(g:output, "\n")
|
|
|
|
|
|
|
|
AssertEqual 'Missing radix parameter (radix)', g:lines[-1]
|
2017-03-02 07:14:30 +00:00
|
|
|
|
|
|
|
Execute(Evaluate the cursor detail function at line 1):
|
|
|
|
:1
|
|
|
|
call ale#cursor#ShowCursorDetail()
|
|
|
|
|
|
|
|
Then(Check the cursor output):
|
|
|
|
redir => g:output
|
|
|
|
:mess
|
|
|
|
redir END
|
|
|
|
|
2017-03-03 02:40:07 +00:00
|
|
|
let g:lines = split(g:output, "\n")
|
|
|
|
|
|
|
|
AssertEqual "Every statement should end with a semicolon", g:lines[-1]
|
|
|
|
|
|
|
|
Execute(Evaluate the cursor detail function at line 2):
|
|
|
|
:2
|
|
|
|
call ale#cursor#ShowCursorDetail()
|
|
|
|
|
|
|
|
Then(Check the cursor output):
|
|
|
|
redir => g:output
|
|
|
|
:mess
|
|
|
|
redir END
|
|
|
|
|
|
|
|
let g:lines = split(g:output, "\n")
|
|
|
|
|
|
|
|
AssertEqual "Infix operators must be spaced. (space-infix-ops)", g:lines[-1]
|