Skip to content

Commit 9778a6e

Browse files
committed
Merge pull request #2134 from oaue/master
javac linter: fix handling of error messages containing ':' character
1 parent 0927634 commit 9778a6e

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

ale_linters/java/javac.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
9999
" Main.java:13: warning: [deprecation] donaught() in Testclass has been deprecated
100100
" Main.java:16: error: ';' expected
101101
let l:directory = expand('#' . a:buffer . ':p:h')
102-
let l:pattern = '\v^(.*):(\d+): (.+):(.+)$'
102+
let l:pattern = '\v^(.*):(\d+): (.{-1,}):(.+)$'
103103
let l:col_pattern = '\v^(\s*\^)$'
104104
let l:symbol_pattern = '\v^ +symbol: *(class|method) +([^ ]+)'
105105
let l:output = []

test/handler/test_javac_handler.vader

+11-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ Execute(The javac handler should handle cannot find symbol errors):
4444
\ 'text': 'error: cannot find symbol: bar()',
4545
\ 'type': 'E',
4646
\ },
47+
\ {
48+
\ 'filename': ale#path#Simplify('/tmp/vLPr4Q5/33/foo.java'),
49+
\ 'lnum': 58,
50+
\ 'col': 19,
51+
\ 'text': 'error: incompatible types: Bar cannot be converted to Foo',
52+
\ 'type': 'E',
53+
\ },
4754
\ ],
4855
\ ale_linters#java#javac#Handle(bufnr(''), [
4956
\ '/tmp/vLPr4Q5/33/foo.java:1: error: some error',
@@ -62,7 +69,10 @@ Execute(The javac handler should handle cannot find symbol errors):
6269
\ ' this.bar();',
6370
\ ' ^',
6471
\ ' symbol: method bar()',
65-
\ '5 errors',
72+
\ '/tmp/vLPr4Q5/33/foo.java:58: error: incompatible types: Bar cannot be converted to Foo',
73+
\ ' this.setFoo(bar);',
74+
\ ' ^',
75+
\ '6 errors',
6676
\ ])
6777

6878
Execute(The javac handler should resolve files from different directories):

0 commit comments

Comments
 (0)