summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <w0rp@users.noreply.github.com>2019-05-08 09:50:12 +0100
committerGitHub <noreply@github.com>2019-05-08 09:50:12 +0100
commita223253f35be35b31a6103805a9ed197cd13cdb5 (patch)
tree2c626e10337bc317c63d149af8eca07983c0317a
parentd390abd721352d583c20f999129ad23f67decbb4 (diff)
parentc7292ce892fbf3b6f35c44e1cd44d138160da981 (diff)
downloadale-a223253f35be35b31a6103805a9ed197cd13cdb5.zip
Merge pull request #2134 from oaue/master
javac linter: fix handling of error messages containing ':' character
-rw-r--r--ale_linters/java/javac.vim2
-rw-r--r--test/handler/test_javac_handler.vader12
2 files changed, 12 insertions, 2 deletions
diff --git a/ale_linters/java/javac.vim b/ale_linters/java/javac.vim
index 7ca95ba5..3883783b 100644
--- a/ale_linters/java/javac.vim
+++ b/ale_linters/java/javac.vim
@@ -99,7 +99,7 @@ function! ale_linters#java#javac#Handle(buffer, lines) abort
" Main.java:13: warning: [deprecation] donaught() in Testclass has been deprecated
" Main.java:16: error: ';' expected
let l:directory = expand('#' . a:buffer . ':p:h')
- let l:pattern = '\v^(.*):(\d+): (.+):(.+)$'
+ let l:pattern = '\v^(.*):(\d+): (.{-1,}):(.+)$'
let l:col_pattern = '\v^(\s*\^)$'
let l:symbol_pattern = '\v^ +symbol: *(class|method) +([^ ]+)'
let l:output = []
diff --git a/test/handler/test_javac_handler.vader b/test/handler/test_javac_handler.vader
index ff4e1631..3dc245af 100644
--- a/test/handler/test_javac_handler.vader
+++ b/test/handler/test_javac_handler.vader
@@ -44,6 +44,13 @@ Execute(The javac handler should handle cannot find symbol errors):
\ 'text': 'error: cannot find symbol: bar()',
\ 'type': 'E',
\ },
+ \ {
+ \ 'filename': ale#path#Simplify('/tmp/vLPr4Q5/33/foo.java'),
+ \ 'lnum': 58,
+ \ 'col': 19,
+ \ 'text': 'error: incompatible types: Bar cannot be converted to Foo',
+ \ 'type': 'E',
+ \ },
\ ],
\ ale_linters#java#javac#Handle(bufnr(''), [
\ '/tmp/vLPr4Q5/33/foo.java:1: error: some error',
@@ -62,7 +69,10 @@ Execute(The javac handler should handle cannot find symbol errors):
\ ' this.bar();',
\ ' ^',
\ ' symbol: method bar()',
- \ '5 errors',
+ \ '/tmp/vLPr4Q5/33/foo.java:58: error: incompatible types: Bar cannot be converted to Foo',
+ \ ' this.setFoo(bar);',
+ \ ' ^',
+ \ '6 errors',
\ ])
Execute(The javac handler should resolve files from different directories):