From cff9f62d321a90c45e622f5304e60a248cbcf4f2 Mon Sep 17 00:00:00 2001 From: Bernardo Date: Sun, 30 Dec 2018 18:24:07 +0100 Subject: fix regex and add rustc-watch problem matcher --- editors/code/package.json | 55 +++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 23 deletions(-) (limited to 'editors/code/package.json') diff --git a/editors/code/package.json b/editors/code/package.json index 2989a7016..93a1d6d01 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -145,37 +145,46 @@ } } }, - "problemMatchers": [ + "problemPatterns": [ { "name": "rustc", - "fileLocation": [ - "relative", - "${workspaceRoot}" - ], - "pattern": [ + "patterns": [ { - "regexp": "^(warning|warn|error)(\\[(.*)\\])?: (.*)$", + "regexp": "^(warning|warn|error)(?:\\[(.*?)\\])?: (.*)$", "severity": 1, - "message": 4, - "code": 3 - }, - { - "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", - "file": 2, - "line": 3, - "column": 4 + "code": 2, + "message": 3 }, { - "regexp": "^.*$" - }, - { - "regexp": "^([\\s->=]*(.*):(\\d*):(\\d*)|.*)$", - "file": 2, - "line": 3, - "column": 4 + "regexp": "^[\\s->=]*(.*?):(\\d*):(\\d*)\\s*$", + "file": 1, + "line": 2, + "column": 3 } ] } + ], + "problemMatchers": [ + { + "name": "rustc", + "fileLocation": [ + "relative", + "${workspaceRoot}" + ], + "pattern": "$rustc" + }, + { + "name": "rustc-watch", + "fileLocation": [ + "relative", + "${workspaceRoot}" + ], + "background": { + "beginsPattern": "^\\[Running ", + "endsPattern": "^(\\[Finished running\\]|To learn more, run the command again with --verbose\\.)$" + }, + "pattern": "$rustc" + } ] } -} +} \ No newline at end of file -- cgit v1.2.3 From 96f0683974406055e98ff88af3b01327aae8ba61 Mon Sep 17 00:00:00 2001 From: Bernardo Date: Sun, 30 Dec 2018 18:30:14 +0100 Subject: named multiline problem patterns are not parsed properly in vscode at the moment --- editors/code/package.json | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) (limited to 'editors/code/package.json') diff --git a/editors/code/package.json b/editors/code/package.json index 93a1d6d01..e0db3c337 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -147,6 +147,7 @@ }, "problemPatterns": [ { + "//comment": "named multiline problem patterns are not parsed properly in vscode at the moment, when fixed in vscode replace both \"pattern\": [...] below with \"pattern\": \"$rustc\"", "name": "rustc", "patterns": [ { @@ -171,7 +172,20 @@ "relative", "${workspaceRoot}" ], - "pattern": "$rustc" + "pattern": [ + { + "regexp": "^(warning|warn|error)(?:\\[(.*?)\\])?: (.*)$", + "severity": 1, + "code": 2, + "message": 3 + }, + { + "regexp": "^[\\s->=]*(.*?):(\\d*):(\\d*)\\s*$", + "file": 1, + "line": 2, + "column": 3 + } + ] }, { "name": "rustc-watch", @@ -183,7 +197,20 @@ "beginsPattern": "^\\[Running ", "endsPattern": "^(\\[Finished running\\]|To learn more, run the command again with --verbose\\.)$" }, - "pattern": "$rustc" + "pattern": [ + { + "regexp": "^(warning|warn|error)(?:\\[(.*?)\\])?: (.*)$", + "severity": 1, + "code": 2, + "message": 3 + }, + { + "regexp": "^[\\s->=]*(.*?):(\\d*):(\\d*)\\s*$", + "file": 1, + "line": 2, + "column": 3 + } + ] } ] } -- cgit v1.2.3