mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-07 21:24:33 +08:00
add filename to output
This commit is contained in:
@@ -39,7 +39,7 @@ function! ale_linters#php#phan#Handle(buffer, lines) abort
|
|||||||
let l:pattern = '^Phan error: \(\w\+\): \(.\+\) in \(.\+\) on line \(\d\+\)$'
|
let l:pattern = '^Phan error: \(\w\+\): \(.\+\) in \(.\+\) on line \(\d\+\)$'
|
||||||
else
|
else
|
||||||
" /path/to/some-filename.php:18 ERRORTYPE message
|
" /path/to/some-filename.php:18 ERRORTYPE message
|
||||||
let l:pattern = '^.*:\(\d\+\)\s\(\w\+\)\s\(.\+\)$'
|
let l:pattern = '^\(.*\):\(\d\+\)\s\(\w\+\)\s\(.\+\)$'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let l:output = []
|
let l:output = []
|
||||||
@@ -49,13 +49,15 @@ function! ale_linters#php#phan#Handle(buffer, lines) abort
|
|||||||
let l:dict = {
|
let l:dict = {
|
||||||
\ 'lnum': l:match[4] + 0,
|
\ 'lnum': l:match[4] + 0,
|
||||||
\ 'text': l:match[2],
|
\ 'text': l:match[2],
|
||||||
|
\ 'filename': l:match[3],
|
||||||
\ 'type': 'W',
|
\ 'type': 'W',
|
||||||
\}
|
\}
|
||||||
else
|
else
|
||||||
let l:dict = {
|
let l:dict = {
|
||||||
\ 'lnum': l:match[1] + 0,
|
\ 'lnum': l:match[2] + 0,
|
||||||
\ 'text': l:match[3],
|
\ 'text': l:match[4],
|
||||||
\ 'type': 'W',
|
\ 'type': 'W',
|
||||||
|
\ 'filename': l:match[1],
|
||||||
\}
|
\}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,13 @@ Execute(The php static analyzer handler should parse errors from phan):
|
|||||||
\ 'lnum': 25,
|
\ 'lnum': 25,
|
||||||
\ 'type': 'W',
|
\ 'type': 'W',
|
||||||
\ 'text': 'Return type of getValidator is undeclared type \Respect\Validation\Validator',
|
\ 'text': 'Return type of getValidator is undeclared type \Respect\Validation\Validator',
|
||||||
|
\ 'filename': 'example.php',
|
||||||
\ },
|
\ },
|
||||||
\ {
|
\ {
|
||||||
\ 'lnum': 66,
|
\ 'lnum': 66,
|
||||||
\ 'type': 'W',
|
\ 'type': 'W',
|
||||||
\ 'text': 'Call to method string from undeclared class \Respect\Validation\Validator',
|
\ 'text': 'Call to method string from undeclared class \Respect\Validation\Validator',
|
||||||
|
\ 'filename': 'example.php',
|
||||||
\ },
|
\ },
|
||||||
\ ],
|
\ ],
|
||||||
\ ale_linters#php#phan#Handle(347, [
|
\ ale_linters#php#phan#Handle(347, [
|
||||||
|
|||||||
Reference in New Issue
Block a user