diff options
Diffstat (limited to 'ale_linters')
-rw-r--r-- | ale_linters/ansible/ansible_lint.vim | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/ale_linters/ansible/ansible_lint.vim b/ale_linters/ansible/ansible_lint.vim index bdfbee3c..e15008c8 100644 --- a/ale_linters/ansible/ansible_lint.vim +++ b/ale_linters/ansible/ansible_lint.vim @@ -29,10 +29,20 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort for l:issue in l:linter_issues if ale#path#IsBufferPath(a:buffer, l:issue.location.path) + if exists('l:issue.location.positions') + let l:coord_keyname = 'positions' + else + let l:coord_keyname = 'lines' + endif + + let l:column_member = printf( + \ 'l:issue.location.%s.begin.column', l:coord_keyname + \) + call add(l:output, { - \ 'lnum': exists('l:issue.location.lines.begin.column') ? l:issue.location.lines.begin.line : - \ l:issue.location.lines.begin, - \ 'col': exists('l:issue.location.lines.begin.column') ? l:issue.location.lines.begin.column : 0, + \ 'lnum': exists(l:column_member) ? l:issue.location[l:coord_keyname].begin.line : + \ l:issue.location[l:coord_keyname].begin, + \ 'col': exists(l:column_member) ? l:issue.location[l:coord_keyname].begin.column : 0, \ 'text': l:issue.check_name, \ 'detail': l:issue.description, \ 'code': l:issue.severity, |