Skip to content

Instantly share code, notes, and snippets.

@mauro1998
Last active May 20, 2020 23:38
Show Gist options
  • Save mauro1998/80ebf9407073efa32e8709e567c35b8b to your computer and use it in GitHub Desktop.
Save mauro1998/80ebf9407073efa32e8709e567c35b8b to your computer and use it in GitHub Desktop.
Default problem matchers for vscode tasks
export enum ProblemLocationKind {
File,
Location
}
class ProblemPatternRegistryImpl implements IProblemPatternRegistry {
// ...
private fillDefaults(): void {
this.add('msCompile', {
regexp: /^(?:\s+\d+\>)?([^\s].*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\)\s*:\s+(error|warning|info)\s+(\w{1,2}\d+)\s*:\s*(.*)$/,
kind: ProblemLocationKind.Location,
file: 1,
location: 2,
severity: 3,
code: 4,
message: 5
});
this.add('gulp-tsc', {
regexp: /^([^\s].*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\):\s+(\d+)\s+(.*)$/,
kind: ProblemLocationKind.Location,
file: 1,
location: 2,
code: 3,
message: 4
});
this.add('cpp', {
regexp: /^([^\s].*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\):\s+(error|warning|info)\s+(C\d+)\s*:\s*(.*)$/,
kind: ProblemLocationKind.Location,
file: 1,
location: 2,
severity: 3,
code: 4,
message: 5
});
this.add('csc', {
regexp: /^([^\s].*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\):\s+(error|warning|info)\s+(CS\d+)\s*:\s*(.*)$/,
kind: ProblemLocationKind.Location,
file: 1,
location: 2,
severity: 3,
code: 4,
message: 5
});
this.add('vb', {
regexp: /^([^\s].*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\):\s+(error|warning|info)\s+(BC\d+)\s*:\s*(.*)$/,
kind: ProblemLocationKind.Location,
file: 1,
location: 2,
severity: 3,
code: 4,
message: 5
});
this.add('lessCompile', {
regexp: /^\s*(.*) in file (.*) line no. (\d+)$/,
kind: ProblemLocationKind.Location,
message: 1,
file: 2,
line: 3
});
this.add('jshint', {
regexp: /^(.*):\s+line\s+(\d+),\s+col\s+(\d+),\s(.+?)(?:\s+\((\w)(\d+)\))?$/,
kind: ProblemLocationKind.Location,
file: 1,
line: 2,
character: 3,
message: 4,
severity: 5,
code: 6
});
this.add('jshint-stylish', [
{
regexp: /^(.+)$/,
kind: ProblemLocationKind.Location,
file: 1
},
{
regexp: /^\s+line\s+(\d+)\s+col\s+(\d+)\s+(.+?)(?:\s+\((\w)(\d+)\))?$/,
line: 1,
character: 2,
message: 3,
severity: 4,
code: 5,
loop: true
}
]);
this.add('eslint-compact', {
regexp: /^(.+):\sline\s(\d+),\scol\s(\d+),\s(Error|Warning|Info)\s-\s(.+)\s\((.+)\)$/,
file: 1,
kind: ProblemLocationKind.Location,
line: 2,
character: 3,
severity: 4,
message: 5,
code: 6
});
this.add('eslint-stylish', [
{
regexp: /^([^\s].*)$/,
kind: ProblemLocationKind.Location,
file: 1
},
{
regexp: /^\s+(\d+):(\d+)\s+(error|warning|info)\s+(.+?)(?:\s\s+(.*))?$/,
line: 1,
character: 2,
severity: 3,
message: 4,
code: 5,
loop: true
}
]);
this.add('go', {
regexp: /^([^:]*: )?((.:)?[^:]*):(\d+)(:(\d+))?: (.*)$/,
kind: ProblemLocationKind.Location,
file: 2,
line: 4,
character: 6,
message: 7
});
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment