problemMatcher.ts ×13

Frontier kind: Code frontier

unlabeled · c_f8c39cd1593f

19 tests · 12428 LOC · 50 files · introduces 0 tests · 42 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges42 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1215 ranges12428 lines · 50 files · Browse complete extent
All tests (intent)
19 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 42 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/workbench/contrib/tasks/common/problemMatcher.ts 42 introduced LOC · 13 ranges

Open complete file

1015
1016 private doCreateSingleProblemPattern(value: Config.ICheckedProblemPattern, setDefaults: boolean): IProblemPattern | undefined {
1017 > const regexp = this.createRegularExpression(value.regexp); problemMatcher.ts
1018 > if (regexp === undefined) {
1019 return undefined;
1020 }
1021 > let result: IProblemPattern = { regexp }; problemMatcher.ts
1022 > if (value.kind) {
1023 result.kind = ProblemLocationKind.fromString(value.kind);
1024 }
1026 > function copyProperty(result: IProblemPattern, source: Config.IProblemPattern, resultKey: keyof IProblemPattern, sourceKey: keyof Config.IProblemPattern) {
1027 > const value = source[sourceKey];
1028 > if (typeof value === 'number') {
1029 (result as unknown as Record<string, unknown>)[resultKey] = value;
1030 }
1032 > copyProperty(result, value, 'file', 'file');
1033 > copyProperty(result, value, 'location', 'location');
1034 > copyProperty(result, value, 'line', 'line');
1035 > copyProperty(result, value, 'character', 'column');
1036 > copyProperty(result, value, 'endLine', 'endLine');
1037 > copyProperty(result, value, 'endCharacter', 'endColumn');
1038 > copyProperty(result, value, 'severity', 'severity');
1039 > copyProperty(result, value, 'code', 'code');
1040 > copyProperty(result, value, 'message', 'message');
1041 > if (value.loop === true || value.loop === false) {
1042 result.loop = value.loop;
1043 }
1044 > if (setDefaults) { problemMatcher.ts
1045 if (result.location || result.kind === ProblemLocationKind.File) {
1046 const defaultValue: Partial<IProblemPattern> = {
1059 }
1060 }
1061 > return result; problemMatcher.ts
1062 > }
1063
1064 private validateProblemPattern(values: IProblemPattern[]): boolean {
1065 > if (!values || values.length === 0) { problemMatcher.ts
1066 this.error(localize('ProblemPatternParser.problemPattern.emptyPattern', 'The problem pattern is invalid. It must contain at least one pattern.'));
1067 return false;
1068 }
1069 > let file: boolean = false, message: boolean = false, location: boolean = false, line: boolean = false; problemMatcher.ts
1070 > const locationKind = (values[0].kind === undefined) ? ProblemLocationKind.Location : values[0].kind;
1071 >
1072 > values.forEach((pattern, i) => {
1073 > if (i !== 0 && pattern.kind) {
1074 this.error(localize('ProblemPatternParser.problemPattern.kindProperty.notFirst', 'The problem pattern is invalid. The kind property must be provided only in the first element'));
1075 }
1076 > file = file || !Types.isUndefined(pattern.file); problemMatcher.ts
1077 > message = message || !Types.isUndefined(pattern.message);
1078 > location = location || !Types.isUndefined(pattern.location);
1079 > line = line || !Types.isUndefined(pattern.line);
1080 > });
1081 > if (!(file && message)) {
1082 this.error(localize('ProblemPatternParser.problemPattern.missingProperty', 'The problem pattern is invalid. It must have at least have a file and a message.'));
1083 return false;
1084 }
1085 > if (locationKind === ProblemLocationKind.Location && !(location || line)) { problemMatcher.ts
1086 this.error(localize('ProblemPatternParser.problemPattern.missingLocation', 'The problem pattern is invalid. It must either have kind: "file" or have a line or location match group.'));
1087 return false;
1088 }
1089 return true;
1091
1092 private createRegularExpression(value: string): RegExp | undefined {
1093 > let result: RegExp | undefined; problemMatcher.ts
1094 > try {
1095 > result = new RegExp(value);
1096 > } catch (err) {
1097 this.error(localize('ProblemPatternParser.invalidRegexp', 'Error: The string {0} is not a valid regular expression.\n', value));
1098 }
1099 > return result; problemMatcher.ts
1100 > }
1101 }
1102