@@ -21,11 +21,11 @@ function! ale_linters#swift#swiftpm#GetCommand(buffer)
21
21
endfunction
22
22
23
23
function ! ale_linters#swift#swiftpm#Handle (buffer , lines )
24
- " Match and ignore file path (anything but :)
24
+ " Match and capture file path (anything but :)
25
25
" Match and capture line number
26
26
" Match and capture column number
27
27
" Match and capture anything in the message
28
- let l: pattern = ' ^[^:]\+:\(\d\+\):\(\d\+\):\s*\(error\|warning\):\s*\(.*\)$'
28
+ let l: pattern = ' ^\( [^:]\+\) :\(\d\+\):\(\d\+\):\s*\(error\|warning\):\s*\(.*\)$'
29
29
let l: output = []
30
30
31
31
for l: line in a: lines
@@ -35,10 +35,11 @@ function! ale_linters#swift#swiftpm#Handle(buffer, lines)
35
35
continue
36
36
endif
37
37
38
- let l: line_number = l: match [1 ]
39
- let l: column = l: match [2 ]
40
- let l: type = l: match [3 ]
41
- let l: text = l: match [4 ]
38
+ let l: file_name = l: match [1 ]
39
+ let l: line_number = l: match [2 ]
40
+ let l: column = l: match [3 ]
41
+ let l: type = l: match [4 ]
42
+ let l: text = l: match [5 ]
42
43
let l: type_identifier = ' N'
43
44
44
45
if l: type == ' error'
@@ -47,14 +48,16 @@ function! ale_linters#swift#swiftpm#Handle(buffer, lines)
47
48
let l: type_identifier = ' W'
48
49
endif
49
50
50
- call add (l: output , {
51
- \ ' bufnr' : a: buffer ,
52
- \ ' lnum' : l: line_number ,
53
- \ ' vcol' : 0 ,
54
- \ ' col' : l: column ,
55
- \ ' text' : l: text ,
56
- \ ' type' : l: type_identifier ,
57
- \ })
51
+ if l: file_name == expand (' %:p' )
52
+ call add (l: output , {
53
+ \ ' bufnr' : a: buffer ,
54
+ \ ' lnum' : l: line_number ,
55
+ \ ' vcol' : 0 ,
56
+ \ ' col' : l: column ,
57
+ \ ' text' : l: text ,
58
+ \ ' type' : l: type_identifier ,
59
+ \ })
60
+ endif
58
61
endfor
59
62
60
63
return l: output
0 commit comments