Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/diagnostics/msvc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as vscode from 'vscode';

import { oneLess, RawDiagnosticParser, FeedLineResult } from './util';

export const REGEX = /^\s*(\d+>)?\s*([^\s>].*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\):\s+((?:fatal )?error|warning|info)\s*(\w{1,2}\d+)?\s*:\s*(.*)$/;
export const REGEX = /^\s*(\d+>)?\s*([^\s>].*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\)\s*:\s+((?:fatal )?error|warning|info)\s*(\w{1,2}\d+)?\s*:\s*(.*)$/;

export class Parser extends RawDiagnosticParser {
doHandleLine(line: string) {
Expand Down
9 changes: 9 additions & 0 deletions test/unit-tests/diagnostics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,15 @@ suite('Diagnostics', async () => {
expect(build_consumer.compilers.msvc.diagnostics[0].location.start.character).to.eq(0);
});

test('Parse MSVC single proc error (older compiler)', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSVC 2010 are more precise, I am not testing older compiler yet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MSVC 2010 is the older compiler.

const lines = [`E:\\CI-Cor-Ready\\study\\reproc\\reproc\\src\\strv.c(13) : error C2143: syntax error : missing ';' before 'type'`];
feedLines(build_consumer, [], lines);
expect(build_consumer.compilers.msvc.diagnostics).to.have.length(1);
expect(build_consumer.compilers.msvc.diagnostics[0].file).to.eq('E:\\CI-Cor-Ready\\study\\reproc\\reproc\\src\\strv.c');
expect(build_consumer.compilers.msvc.diagnostics[0].location.start.line).to.eq(12);
expect(build_consumer.compilers.msvc.diagnostics[0].location.start.character).to.eq(0);
});

test('Parse MSVC multi proc error', () => {
const lines = [`12>C:\\foo\\bar\\include\\bar.hpp(67): error C2429: language feature 'init-statements in if/switch' requires compiler flag '/std:c++latest'`];
feedLines(build_consumer, [], lines);
Expand Down