Skip to content

Commit 6a74dea

Browse files
committed
src/features: updated errorRegex to work on Windows
The previous revision to errorRegex removed support for \r\n line endings. This change uses \s* to match all whitespace between the lines in the error message which shoul eliminate this problem in the future. Also, the previous version only allowed uppercase drive letters and my system reported lowercase (ie. c:\) which caused the matching to fail.
1 parent c5169e9 commit 6a74dea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/features/linter-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default class FortranLintingProvider {
1919
private doModernFortranLint(textDocument: vscode.TextDocument) {
2020

2121

22-
const errorRegex: RegExp = /^([A-Z]:\\)*([^:]*):([0-9]+):([0-9]+):\n+(.*)\n.*\n(Error|Warning|Fatal Error):\s(.*)$/gm;
22+
const errorRegex: RegExp = /^([a-zA-Z]:\\)*([^:]*):([0-9]+):([0-9]+):\s+(.*)\s+.*?\s+(Error|Warning|Fatal Error):\s(.*)$/gm;
2323

2424
if (textDocument.languageId !== LANGUAGE_ID) {
2525
return;

0 commit comments

Comments
 (0)