@codingame/monaco-vscode-task-service-override 1.85.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/external/tslib/tslib.es6.js +11 -0
  2. package/index.d.ts +1 -0
  3. package/index.js +1 -0
  4. package/override/vs/platform/dialogs/common/dialogs.js +8 -0
  5. package/package.json +24 -0
  6. package/task.d.ts +5 -0
  7. package/task.js +12 -0
  8. package/vscode/src/vs/base/common/parsers.js +44 -0
  9. package/vscode/src/vs/workbench/contrib/tasks/browser/abstractTaskService.js +3851 -0
  10. package/vscode/src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.js +167 -0
  11. package/vscode/src/vs/workbench/contrib/tasks/browser/task.contribution.js +694 -0
  12. package/vscode/src/vs/workbench/contrib/tasks/browser/taskQuickPick.js +452 -0
  13. package/vscode/src/vs/workbench/contrib/tasks/browser/taskService.js +36 -0
  14. package/vscode/src/vs/workbench/contrib/tasks/browser/taskTerminalStatus.js +191 -0
  15. package/vscode/src/vs/workbench/contrib/tasks/browser/tasksQuickAccess.js +121 -0
  16. package/vscode/src/vs/workbench/contrib/tasks/browser/terminalTaskSystem.js +1713 -0
  17. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchemaCommon.js +440 -0
  18. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v1.js +125 -0
  19. package/vscode/src/vs/workbench/contrib/tasks/common/jsonSchema_v2.js +901 -0
  20. package/vscode/src/vs/workbench/contrib/tasks/common/problemCollectors.js +464 -0
  21. package/vscode/src/vs/workbench/contrib/tasks/common/problemMatcher.js +1796 -0
  22. package/vscode/src/vs/workbench/contrib/tasks/common/taskConfiguration.js +1581 -0
  23. package/vscode/src/vs/workbench/contrib/tasks/common/taskSystem.js +15 -0
  24. package/vscode/src/vs/workbench/contrib/tasks/common/taskTemplates.js +145 -0
  25. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEscapeSequences.js +13 -0
@@ -0,0 +1,1796 @@
1
+ import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
2
+ import * as Objects from 'monaco-editor/esm/vs/base/common/objects.js';
3
+ import * as strings from 'monaco-editor/esm/vs/base/common/strings.js';
4
+ import * as assert from 'monaco-editor/esm/vs/base/common/assert.js';
5
+ import { join, normalize } from 'monaco-editor/esm/vs/base/common/path.js';
6
+ import * as Types from 'monaco-editor/esm/vs/base/common/types.js';
7
+ import * as UUID from 'monaco-editor/esm/vs/base/common/uuid.js';
8
+ import * as platform from 'monaco-editor/esm/vs/base/common/platform.js';
9
+ import Severity from 'monaco-editor/esm/vs/base/common/severity.js';
10
+ import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
11
+ import { Parser, ValidationStatus } from '../../../../base/common/parsers.js';
12
+ import { asArray } from 'monaco-editor/esm/vs/base/common/arrays.js';
13
+ import { Schemas as Schemas$1 } from 'monaco-editor/esm/vs/base/common/network.js';
14
+ import { MarkerSeverity } from 'monaco-editor/esm/vs/platform/markers/common/markers.js';
15
+ import { ExtensionsRegistry } from 'vscode/vscode/vs/workbench/services/extensions/common/extensionsRegistry';
16
+ import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
17
+ import { FileType } from 'monaco-editor/esm/vs/platform/files/common/files.js';
18
+
19
+ var FileLocationKind;
20
+ ( (function(FileLocationKind) {
21
+ FileLocationKind[FileLocationKind["Default"] = 0] = "Default";
22
+ FileLocationKind[FileLocationKind["Relative"] = 1] = "Relative";
23
+ FileLocationKind[FileLocationKind["Absolute"] = 2] = "Absolute";
24
+ FileLocationKind[FileLocationKind["AutoDetect"] = 3] = "AutoDetect";
25
+ FileLocationKind[FileLocationKind["Search"] = 4] = "Search";
26
+ })(FileLocationKind || (FileLocationKind = {})));
27
+ ( (function(FileLocationKind) {
28
+ function fromString(value) {
29
+ value = value.toLowerCase();
30
+ if (value === 'absolute') {
31
+ return FileLocationKind.Absolute;
32
+ }
33
+ else if (value === 'relative') {
34
+ return FileLocationKind.Relative;
35
+ }
36
+ else if (value === 'autodetect') {
37
+ return FileLocationKind.AutoDetect;
38
+ }
39
+ else if (value === 'search') {
40
+ return FileLocationKind.Search;
41
+ }
42
+ else {
43
+ return undefined;
44
+ }
45
+ }
46
+ FileLocationKind.fromString = fromString;
47
+ })(FileLocationKind || (FileLocationKind = {})));
48
+ var ProblemLocationKind;
49
+ ( (function(ProblemLocationKind) {
50
+ ProblemLocationKind[ProblemLocationKind["File"] = 0] = "File";
51
+ ProblemLocationKind[ProblemLocationKind["Location"] = 1] = "Location";
52
+ })(ProblemLocationKind || (ProblemLocationKind = {})));
53
+ ( (function(ProblemLocationKind) {
54
+ function fromString(value) {
55
+ value = value.toLowerCase();
56
+ if (value === 'file') {
57
+ return ProblemLocationKind.File;
58
+ }
59
+ else if (value === 'location') {
60
+ return ProblemLocationKind.Location;
61
+ }
62
+ else {
63
+ return undefined;
64
+ }
65
+ }
66
+ ProblemLocationKind.fromString = fromString;
67
+ })(ProblemLocationKind || (ProblemLocationKind = {})));
68
+ var ApplyToKind;
69
+ ( (function(ApplyToKind) {
70
+ ApplyToKind[ApplyToKind["allDocuments"] = 0] = "allDocuments";
71
+ ApplyToKind[ApplyToKind["openDocuments"] = 1] = "openDocuments";
72
+ ApplyToKind[ApplyToKind["closedDocuments"] = 2] = "closedDocuments";
73
+ })(ApplyToKind || (ApplyToKind = {})));
74
+ ( (function(ApplyToKind) {
75
+ function fromString(value) {
76
+ value = value.toLowerCase();
77
+ if (value === 'alldocuments') {
78
+ return ApplyToKind.allDocuments;
79
+ }
80
+ else if (value === 'opendocuments') {
81
+ return ApplyToKind.openDocuments;
82
+ }
83
+ else if (value === 'closeddocuments') {
84
+ return ApplyToKind.closedDocuments;
85
+ }
86
+ else {
87
+ return undefined;
88
+ }
89
+ }
90
+ ApplyToKind.fromString = fromString;
91
+ })(ApplyToKind || (ApplyToKind = {})));
92
+ function isNamedProblemMatcher(value) {
93
+ return value && Types.isString(value.name) ? true : false;
94
+ }
95
+ async function getResource(filename, matcher, fileService) {
96
+ const kind = matcher.fileLocation;
97
+ let fullPath;
98
+ if (kind === FileLocationKind.Absolute) {
99
+ fullPath = filename;
100
+ }
101
+ else if ((kind === FileLocationKind.Relative) && matcher.filePrefix && Types.isString(matcher.filePrefix)) {
102
+ fullPath = join(matcher.filePrefix, filename);
103
+ }
104
+ else if (kind === FileLocationKind.AutoDetect) {
105
+ const matcherClone = Objects.deepClone(matcher);
106
+ matcherClone.fileLocation = FileLocationKind.Relative;
107
+ if (fileService) {
108
+ const relative = await getResource(filename, matcherClone);
109
+ let stat = undefined;
110
+ try {
111
+ stat = await fileService.stat(relative);
112
+ }
113
+ catch (ex) {
114
+ }
115
+ if (stat) {
116
+ return relative;
117
+ }
118
+ }
119
+ matcherClone.fileLocation = FileLocationKind.Absolute;
120
+ return getResource(filename, matcherClone);
121
+ }
122
+ else if (kind === FileLocationKind.Search && fileService) {
123
+ const fsProvider = fileService.getProvider(Schemas$1.file);
124
+ if (fsProvider) {
125
+ const uri = await searchForFileLocation(filename, fsProvider, matcher.filePrefix);
126
+ fullPath = uri?.path;
127
+ }
128
+ if (!fullPath) {
129
+ const absoluteMatcher = Objects.deepClone(matcher);
130
+ absoluteMatcher.fileLocation = FileLocationKind.Absolute;
131
+ return getResource(filename, absoluteMatcher);
132
+ }
133
+ }
134
+ if (fullPath === undefined) {
135
+ throw new Error('FileLocationKind is not actionable. Does the matcher have a filePrefix? This should never happen.');
136
+ }
137
+ fullPath = normalize(fullPath);
138
+ fullPath = fullPath.replace(/\\/g, '/');
139
+ if (fullPath[0] !== '/') {
140
+ fullPath = '/' + fullPath;
141
+ }
142
+ if (matcher.uriProvider !== undefined) {
143
+ return matcher.uriProvider(fullPath);
144
+ }
145
+ else {
146
+ return URI.file(fullPath);
147
+ }
148
+ }
149
+ async function searchForFileLocation(filename, fsProvider, args) {
150
+ const exclusions = ( new Set(( asArray(args.exclude || []).map(x => URI.file(x).path))));
151
+ async function search(dir) {
152
+ if (( exclusions.has(dir.path))) {
153
+ return undefined;
154
+ }
155
+ const entries = await fsProvider.readdir(dir);
156
+ const subdirs = [];
157
+ for (const [name, fileType] of entries) {
158
+ if (fileType === FileType.Directory) {
159
+ subdirs.push(URI.joinPath(dir, name));
160
+ continue;
161
+ }
162
+ if (fileType === FileType.File) {
163
+ const fullUri = URI.joinPath(dir, name);
164
+ if (fullUri.path.endsWith(filename)) {
165
+ return fullUri;
166
+ }
167
+ }
168
+ }
169
+ for (const subdir of subdirs) {
170
+ const result = await search(subdir);
171
+ if (result) {
172
+ return result;
173
+ }
174
+ }
175
+ return undefined;
176
+ }
177
+ for (const dir of asArray(args.include || [])) {
178
+ const hit = await search(URI.file(dir));
179
+ if (hit) {
180
+ return hit;
181
+ }
182
+ }
183
+ return undefined;
184
+ }
185
+ function createLineMatcher(matcher, fileService) {
186
+ const pattern = matcher.pattern;
187
+ if (Array.isArray(pattern)) {
188
+ return ( new MultiLineMatcher(matcher, fileService));
189
+ }
190
+ else {
191
+ return ( new SingleLineMatcher(matcher, fileService));
192
+ }
193
+ }
194
+ const endOfLine = platform.OS === 1 ? '\r\n' : '\n';
195
+ class AbstractLineMatcher {
196
+ constructor(matcher, fileService) {
197
+ this.matcher = matcher;
198
+ this.fileService = fileService;
199
+ }
200
+ handle(lines, start = 0) {
201
+ return { match: null, continue: false };
202
+ }
203
+ next(line) {
204
+ return null;
205
+ }
206
+ fillProblemData(data, pattern, matches) {
207
+ if (data) {
208
+ this.fillProperty(data, 'file', pattern, matches, true);
209
+ this.appendProperty(data, 'message', pattern, matches, true);
210
+ this.fillProperty(data, 'code', pattern, matches, true);
211
+ this.fillProperty(data, 'severity', pattern, matches, true);
212
+ this.fillProperty(data, 'location', pattern, matches, true);
213
+ this.fillProperty(data, 'line', pattern, matches);
214
+ this.fillProperty(data, 'character', pattern, matches);
215
+ this.fillProperty(data, 'endLine', pattern, matches);
216
+ this.fillProperty(data, 'endCharacter', pattern, matches);
217
+ return true;
218
+ }
219
+ else {
220
+ return false;
221
+ }
222
+ }
223
+ appendProperty(data, property, pattern, matches, trim = false) {
224
+ const patternProperty = pattern[property];
225
+ if (Types.isUndefined(data[property])) {
226
+ this.fillProperty(data, property, pattern, matches, trim);
227
+ }
228
+ else if (!Types.isUndefined(patternProperty) && patternProperty < matches.length) {
229
+ let value = matches[patternProperty];
230
+ if (trim) {
231
+ value = strings.trim(value);
232
+ }
233
+ data[property] += endOfLine + value;
234
+ }
235
+ }
236
+ fillProperty(data, property, pattern, matches, trim = false) {
237
+ const patternAtProperty = pattern[property];
238
+ if (Types.isUndefined(data[property]) && !Types.isUndefined(patternAtProperty) && patternAtProperty < matches.length) {
239
+ let value = matches[patternAtProperty];
240
+ if (value !== undefined) {
241
+ if (trim) {
242
+ value = strings.trim(value);
243
+ }
244
+ data[property] = value;
245
+ }
246
+ }
247
+ }
248
+ getMarkerMatch(data) {
249
+ try {
250
+ const location = this.getLocation(data);
251
+ if (data.file && location && data.message) {
252
+ const marker = {
253
+ severity: this.getSeverity(data),
254
+ startLineNumber: location.startLineNumber,
255
+ startColumn: location.startCharacter,
256
+ endLineNumber: location.endLineNumber,
257
+ endColumn: location.endCharacter,
258
+ message: data.message
259
+ };
260
+ if (data.code !== undefined) {
261
+ marker.code = data.code;
262
+ }
263
+ if (this.matcher.source !== undefined) {
264
+ marker.source = this.matcher.source;
265
+ }
266
+ return {
267
+ description: this.matcher,
268
+ resource: this.getResource(data.file),
269
+ marker: marker
270
+ };
271
+ }
272
+ }
273
+ catch (err) {
274
+ console.error(`Failed to convert problem data into match: ${JSON.stringify(data)}`);
275
+ }
276
+ return undefined;
277
+ }
278
+ getResource(filename) {
279
+ return getResource(filename, this.matcher, this.fileService);
280
+ }
281
+ getLocation(data) {
282
+ if (data.kind === ProblemLocationKind.File) {
283
+ return this.createLocation(0, 0, 0, 0);
284
+ }
285
+ if (data.location) {
286
+ return this.parseLocationInfo(data.location);
287
+ }
288
+ if (!data.line) {
289
+ return null;
290
+ }
291
+ const startLine = parseInt(data.line);
292
+ const startColumn = data.character ? parseInt(data.character) : undefined;
293
+ const endLine = data.endLine ? parseInt(data.endLine) : undefined;
294
+ const endColumn = data.endCharacter ? parseInt(data.endCharacter) : undefined;
295
+ return this.createLocation(startLine, startColumn, endLine, endColumn);
296
+ }
297
+ parseLocationInfo(value) {
298
+ if (!value || !value.match(/(\d+|\d+,\d+|\d+,\d+,\d+,\d+)/)) {
299
+ return null;
300
+ }
301
+ const parts = value.split(',');
302
+ const startLine = parseInt(parts[0]);
303
+ const startColumn = parts.length > 1 ? parseInt(parts[1]) : undefined;
304
+ if (parts.length > 3) {
305
+ return this.createLocation(startLine, startColumn, parseInt(parts[2]), parseInt(parts[3]));
306
+ }
307
+ else {
308
+ return this.createLocation(startLine, startColumn, undefined, undefined);
309
+ }
310
+ }
311
+ createLocation(startLine, startColumn, endLine, endColumn) {
312
+ if (startColumn !== undefined && endColumn !== undefined) {
313
+ return { startLineNumber: startLine, startCharacter: startColumn, endLineNumber: endLine || startLine, endCharacter: endColumn };
314
+ }
315
+ if (startColumn !== undefined) {
316
+ return { startLineNumber: startLine, startCharacter: startColumn, endLineNumber: startLine, endCharacter: startColumn };
317
+ }
318
+ return { startLineNumber: startLine, startCharacter: 1, endLineNumber: startLine, endCharacter: 2 ** 31 - 1 };
319
+ }
320
+ getSeverity(data) {
321
+ let result = null;
322
+ if (data.severity) {
323
+ const value = data.severity;
324
+ if (value) {
325
+ result = Severity.fromValue(value);
326
+ if (result === Severity.Ignore) {
327
+ if (value === 'E') {
328
+ result = Severity.Error;
329
+ }
330
+ else if (value === 'W') {
331
+ result = Severity.Warning;
332
+ }
333
+ else if (value === 'I') {
334
+ result = Severity.Info;
335
+ }
336
+ else if (strings.equalsIgnoreCase(value, 'hint')) {
337
+ result = Severity.Info;
338
+ }
339
+ else if (strings.equalsIgnoreCase(value, 'note')) {
340
+ result = Severity.Info;
341
+ }
342
+ }
343
+ }
344
+ }
345
+ if (result === null || result === Severity.Ignore) {
346
+ result = this.matcher.severity || Severity.Error;
347
+ }
348
+ return MarkerSeverity.fromSeverity(result);
349
+ }
350
+ }
351
+ class SingleLineMatcher extends AbstractLineMatcher {
352
+ constructor(matcher, fileService) {
353
+ super(matcher, fileService);
354
+ this.pattern = matcher.pattern;
355
+ }
356
+ get matchLength() {
357
+ return 1;
358
+ }
359
+ handle(lines, start = 0) {
360
+ assert.ok(lines.length - start === 1);
361
+ const data = Object.create(null);
362
+ if (this.pattern.kind !== undefined) {
363
+ data.kind = this.pattern.kind;
364
+ }
365
+ const matches = this.pattern.regexp.exec(lines[start]);
366
+ if (matches) {
367
+ this.fillProblemData(data, this.pattern, matches);
368
+ const match = this.getMarkerMatch(data);
369
+ if (match) {
370
+ return { match: match, continue: false };
371
+ }
372
+ }
373
+ return { match: null, continue: false };
374
+ }
375
+ next(line) {
376
+ return null;
377
+ }
378
+ }
379
+ class MultiLineMatcher extends AbstractLineMatcher {
380
+ constructor(matcher, fileService) {
381
+ super(matcher, fileService);
382
+ this.patterns = matcher.pattern;
383
+ }
384
+ get matchLength() {
385
+ return this.patterns.length;
386
+ }
387
+ handle(lines, start = 0) {
388
+ assert.ok(lines.length - start === this.patterns.length);
389
+ this.data = Object.create(null);
390
+ let data = this.data;
391
+ data.kind = this.patterns[0].kind;
392
+ for (let i = 0; i < this.patterns.length; i++) {
393
+ const pattern = this.patterns[i];
394
+ const matches = pattern.regexp.exec(lines[i + start]);
395
+ if (!matches) {
396
+ return { match: null, continue: false };
397
+ }
398
+ else {
399
+ if (pattern.loop && i === this.patterns.length - 1) {
400
+ data = Objects.deepClone(data);
401
+ }
402
+ this.fillProblemData(data, pattern, matches);
403
+ }
404
+ }
405
+ const loop = !!this.patterns[this.patterns.length - 1].loop;
406
+ if (!loop) {
407
+ this.data = undefined;
408
+ }
409
+ const markerMatch = data ? this.getMarkerMatch(data) : null;
410
+ return { match: markerMatch ? markerMatch : null, continue: loop };
411
+ }
412
+ next(line) {
413
+ const pattern = this.patterns[this.patterns.length - 1];
414
+ assert.ok(pattern.loop === true && this.data !== null);
415
+ const matches = pattern.regexp.exec(line);
416
+ if (!matches) {
417
+ this.data = undefined;
418
+ return null;
419
+ }
420
+ const data = Objects.deepClone(this.data);
421
+ let problemMatch;
422
+ if (this.fillProblemData(data, pattern, matches)) {
423
+ problemMatch = this.getMarkerMatch(data);
424
+ }
425
+ return problemMatch ? problemMatch : null;
426
+ }
427
+ }
428
+ var Config;
429
+ ( (function(Config) {
430
+ ( (function(CheckedProblemPattern) {
431
+ function is(value) {
432
+ const candidate = value;
433
+ return candidate && Types.isString(candidate.regexp);
434
+ }
435
+ CheckedProblemPattern.is = is;
436
+ })(
437
+ Config.CheckedProblemPattern || (Config.CheckedProblemPattern = {})
438
+ ));
439
+ let NamedProblemPattern;
440
+ ( (function(NamedProblemPattern) {
441
+ function is(value) {
442
+ const candidate = value;
443
+ return candidate && Types.isString(candidate.name);
444
+ }
445
+ NamedProblemPattern.is = is;
446
+ })(
447
+ NamedProblemPattern = Config.NamedProblemPattern || (Config.NamedProblemPattern = {})
448
+ ));
449
+ ( (function(NamedCheckedProblemPattern) {
450
+ function is(value) {
451
+ const candidate = value;
452
+ return candidate && NamedProblemPattern.is(candidate) && Types.isString(candidate.regexp);
453
+ }
454
+ NamedCheckedProblemPattern.is = is;
455
+ })(
456
+ Config.NamedCheckedProblemPattern || (Config.NamedCheckedProblemPattern = {})
457
+ ));
458
+ let MultiLineProblemPattern;
459
+ ( (function(MultiLineProblemPattern) {
460
+ function is(value) {
461
+ return value && Array.isArray(value);
462
+ }
463
+ MultiLineProblemPattern.is = is;
464
+ })(
465
+ MultiLineProblemPattern = Config.MultiLineProblemPattern || (Config.MultiLineProblemPattern = {})
466
+ ));
467
+ let MultiLineCheckedProblemPattern;
468
+ ( (function(MultiLineCheckedProblemPattern) {
469
+ function is(value) {
470
+ if (!MultiLineProblemPattern.is(value)) {
471
+ return false;
472
+ }
473
+ for (const element of value) {
474
+ if (!Config.CheckedProblemPattern.is(element)) {
475
+ return false;
476
+ }
477
+ }
478
+ return true;
479
+ }
480
+ MultiLineCheckedProblemPattern.is = is;
481
+ })(
482
+ MultiLineCheckedProblemPattern = Config.MultiLineCheckedProblemPattern || (Config.MultiLineCheckedProblemPattern = {})
483
+ ));
484
+ ( (function(NamedMultiLineCheckedProblemPattern) {
485
+ function is(value) {
486
+ const candidate = value;
487
+ return candidate && Types.isString(candidate.name) && Array.isArray(candidate.patterns) && MultiLineCheckedProblemPattern.is(candidate.patterns);
488
+ }
489
+ NamedMultiLineCheckedProblemPattern.is = is;
490
+ })(
491
+ Config.NamedMultiLineCheckedProblemPattern || (Config.NamedMultiLineCheckedProblemPattern = {})
492
+ ));
493
+ function isNamedProblemMatcher(value) {
494
+ return Types.isString(value.name);
495
+ }
496
+ Config.isNamedProblemMatcher = isNamedProblemMatcher;
497
+ })(Config || (Config = {})));
498
+ class ProblemPatternParser extends Parser {
499
+ constructor(logger) {
500
+ super(logger);
501
+ }
502
+ parse(value) {
503
+ if (Config.NamedMultiLineCheckedProblemPattern.is(value)) {
504
+ return this.createNamedMultiLineProblemPattern(value);
505
+ }
506
+ else if (Config.MultiLineCheckedProblemPattern.is(value)) {
507
+ return this.createMultiLineProblemPattern(value);
508
+ }
509
+ else if (Config.NamedCheckedProblemPattern.is(value)) {
510
+ const result = this.createSingleProblemPattern(value);
511
+ result.name = value.name;
512
+ return result;
513
+ }
514
+ else if (Config.CheckedProblemPattern.is(value)) {
515
+ return this.createSingleProblemPattern(value);
516
+ }
517
+ else {
518
+ this.error(( localizeWithPath(
519
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
520
+ 'ProblemPatternParser.problemPattern.missingRegExp',
521
+ 'The problem pattern is missing a regular expression.'
522
+ )));
523
+ return null;
524
+ }
525
+ }
526
+ createSingleProblemPattern(value) {
527
+ const result = this.doCreateSingleProblemPattern(value, true);
528
+ if (result === undefined) {
529
+ return null;
530
+ }
531
+ else if (result.kind === undefined) {
532
+ result.kind = ProblemLocationKind.Location;
533
+ }
534
+ return this.validateProblemPattern([result]) ? result : null;
535
+ }
536
+ createNamedMultiLineProblemPattern(value) {
537
+ const validPatterns = this.createMultiLineProblemPattern(value.patterns);
538
+ if (!validPatterns) {
539
+ return null;
540
+ }
541
+ const result = {
542
+ name: value.name,
543
+ label: value.label ? value.label : value.name,
544
+ patterns: validPatterns
545
+ };
546
+ return result;
547
+ }
548
+ createMultiLineProblemPattern(values) {
549
+ const result = [];
550
+ for (let i = 0; i < values.length; i++) {
551
+ const pattern = this.doCreateSingleProblemPattern(values[i], false);
552
+ if (pattern === undefined) {
553
+ return null;
554
+ }
555
+ if (i < values.length - 1) {
556
+ if (!Types.isUndefined(pattern.loop) && pattern.loop) {
557
+ pattern.loop = false;
558
+ this.error(( localizeWithPath(
559
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
560
+ 'ProblemPatternParser.loopProperty.notLast',
561
+ 'The loop property is only supported on the last line matcher.'
562
+ )));
563
+ }
564
+ }
565
+ result.push(pattern);
566
+ }
567
+ if (result[0].kind === undefined) {
568
+ result[0].kind = ProblemLocationKind.Location;
569
+ }
570
+ return this.validateProblemPattern(result) ? result : null;
571
+ }
572
+ doCreateSingleProblemPattern(value, setDefaults) {
573
+ const regexp = this.createRegularExpression(value.regexp);
574
+ if (regexp === undefined) {
575
+ return undefined;
576
+ }
577
+ let result = { regexp };
578
+ if (value.kind) {
579
+ result.kind = ProblemLocationKind.fromString(value.kind);
580
+ }
581
+ function copyProperty(result, source, resultKey, sourceKey) {
582
+ const value = source[sourceKey];
583
+ if (typeof value === 'number') {
584
+ result[resultKey] = value;
585
+ }
586
+ }
587
+ copyProperty(result, value, 'file', 'file');
588
+ copyProperty(result, value, 'location', 'location');
589
+ copyProperty(result, value, 'line', 'line');
590
+ copyProperty(result, value, 'character', 'column');
591
+ copyProperty(result, value, 'endLine', 'endLine');
592
+ copyProperty(result, value, 'endCharacter', 'endColumn');
593
+ copyProperty(result, value, 'severity', 'severity');
594
+ copyProperty(result, value, 'code', 'code');
595
+ copyProperty(result, value, 'message', 'message');
596
+ if (value.loop === true || value.loop === false) {
597
+ result.loop = value.loop;
598
+ }
599
+ if (setDefaults) {
600
+ if (result.location || result.kind === ProblemLocationKind.File) {
601
+ const defaultValue = {
602
+ file: 1,
603
+ message: 0
604
+ };
605
+ result = Objects.mixin(result, defaultValue, false);
606
+ }
607
+ else {
608
+ const defaultValue = {
609
+ file: 1,
610
+ line: 2,
611
+ character: 3,
612
+ message: 0
613
+ };
614
+ result = Objects.mixin(result, defaultValue, false);
615
+ }
616
+ }
617
+ return result;
618
+ }
619
+ validateProblemPattern(values) {
620
+ let file = false, message = false, location = false, line = false;
621
+ const locationKind = (values[0].kind === undefined) ? ProblemLocationKind.Location : values[0].kind;
622
+ values.forEach((pattern, i) => {
623
+ if (i !== 0 && pattern.kind) {
624
+ this.error(( localizeWithPath(
625
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
626
+ 'ProblemPatternParser.problemPattern.kindProperty.notFirst',
627
+ 'The problem pattern is invalid. The kind property must be provided only in the first element'
628
+ )));
629
+ }
630
+ file = file || !Types.isUndefined(pattern.file);
631
+ message = message || !Types.isUndefined(pattern.message);
632
+ location = location || !Types.isUndefined(pattern.location);
633
+ line = line || !Types.isUndefined(pattern.line);
634
+ });
635
+ if (!(file && message)) {
636
+ this.error(( localizeWithPath(
637
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
638
+ 'ProblemPatternParser.problemPattern.missingProperty',
639
+ 'The problem pattern is invalid. It must have at least have a file and a message.'
640
+ )));
641
+ return false;
642
+ }
643
+ if (locationKind === ProblemLocationKind.Location && !(location || line)) {
644
+ this.error(( localizeWithPath(
645
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
646
+ 'ProblemPatternParser.problemPattern.missingLocation',
647
+ 'The problem pattern is invalid. It must either have kind: "file" or have a line or location match group.'
648
+ )));
649
+ return false;
650
+ }
651
+ return true;
652
+ }
653
+ createRegularExpression(value) {
654
+ let result;
655
+ try {
656
+ result = ( new RegExp(value));
657
+ }
658
+ catch (err) {
659
+ this.error(( localizeWithPath(
660
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
661
+ 'ProblemPatternParser.invalidRegexp',
662
+ 'Error: The string {0} is not a valid regular expression.\n',
663
+ value
664
+ )));
665
+ }
666
+ return result;
667
+ }
668
+ }
669
+ class ExtensionRegistryReporter {
670
+ constructor(_collector, _validationStatus = ( new ValidationStatus())) {
671
+ this._collector = _collector;
672
+ this._validationStatus = _validationStatus;
673
+ }
674
+ info(message) {
675
+ this._validationStatus.state = 1 ;
676
+ this._collector.info(message);
677
+ }
678
+ warn(message) {
679
+ this._validationStatus.state = 2 ;
680
+ this._collector.warn(message);
681
+ }
682
+ error(message) {
683
+ this._validationStatus.state = 3 ;
684
+ this._collector.error(message);
685
+ }
686
+ fatal(message) {
687
+ this._validationStatus.state = 4 ;
688
+ this._collector.error(message);
689
+ }
690
+ get status() {
691
+ return this._validationStatus;
692
+ }
693
+ }
694
+ var Schemas;
695
+ ( (function(Schemas) {
696
+ Schemas.ProblemPattern = {
697
+ default: {
698
+ regexp: '^([^\\\\s].*)\\\\((\\\\d+,\\\\d+)\\\\):\\\\s*(.*)$',
699
+ file: 1,
700
+ location: 2,
701
+ message: 3
702
+ },
703
+ type: 'object',
704
+ additionalProperties: false,
705
+ properties: {
706
+ regexp: {
707
+ type: 'string',
708
+ description: ( localizeWithPath(
709
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
710
+ 'ProblemPatternSchema.regexp',
711
+ 'The regular expression to find an error, warning or info in the output.'
712
+ ))
713
+ },
714
+ kind: {
715
+ type: 'string',
716
+ description: ( localizeWithPath(
717
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
718
+ 'ProblemPatternSchema.kind',
719
+ 'whether the pattern matches a location (file and line) or only a file.'
720
+ ))
721
+ },
722
+ file: {
723
+ type: 'integer',
724
+ description: ( localizeWithPath(
725
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
726
+ 'ProblemPatternSchema.file',
727
+ 'The match group index of the filename. If omitted 1 is used.'
728
+ ))
729
+ },
730
+ location: {
731
+ type: 'integer',
732
+ description: ( localizeWithPath(
733
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
734
+ 'ProblemPatternSchema.location',
735
+ 'The match group index of the problem\'s location. Valid location patterns are: (line), (line,column) and (startLine,startColumn,endLine,endColumn). If omitted (line,column) is assumed.'
736
+ ))
737
+ },
738
+ line: {
739
+ type: 'integer',
740
+ description: ( localizeWithPath(
741
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
742
+ 'ProblemPatternSchema.line',
743
+ 'The match group index of the problem\'s line. Defaults to 2'
744
+ ))
745
+ },
746
+ column: {
747
+ type: 'integer',
748
+ description: ( localizeWithPath(
749
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
750
+ 'ProblemPatternSchema.column',
751
+ 'The match group index of the problem\'s line character. Defaults to 3'
752
+ ))
753
+ },
754
+ endLine: {
755
+ type: 'integer',
756
+ description: ( localizeWithPath(
757
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
758
+ 'ProblemPatternSchema.endLine',
759
+ 'The match group index of the problem\'s end line. Defaults to undefined'
760
+ ))
761
+ },
762
+ endColumn: {
763
+ type: 'integer',
764
+ description: ( localizeWithPath(
765
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
766
+ 'ProblemPatternSchema.endColumn',
767
+ 'The match group index of the problem\'s end line character. Defaults to undefined'
768
+ ))
769
+ },
770
+ severity: {
771
+ type: 'integer',
772
+ description: ( localizeWithPath(
773
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
774
+ 'ProblemPatternSchema.severity',
775
+ 'The match group index of the problem\'s severity. Defaults to undefined'
776
+ ))
777
+ },
778
+ code: {
779
+ type: 'integer',
780
+ description: ( localizeWithPath(
781
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
782
+ 'ProblemPatternSchema.code',
783
+ 'The match group index of the problem\'s code. Defaults to undefined'
784
+ ))
785
+ },
786
+ message: {
787
+ type: 'integer',
788
+ description: ( localizeWithPath(
789
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
790
+ 'ProblemPatternSchema.message',
791
+ 'The match group index of the message. If omitted it defaults to 4 if location is specified. Otherwise it defaults to 5.'
792
+ ))
793
+ },
794
+ loop: {
795
+ type: 'boolean',
796
+ description: ( localizeWithPath(
797
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
798
+ 'ProblemPatternSchema.loop',
799
+ 'In a multi line matcher loop indicated whether this pattern is executed in a loop as long as it matches. Can only specified on a last pattern in a multi line pattern.'
800
+ ))
801
+ }
802
+ }
803
+ };
804
+ Schemas.NamedProblemPattern = Objects.deepClone(Schemas.ProblemPattern);
805
+ Schemas.NamedProblemPattern.properties = Objects.deepClone(Schemas.NamedProblemPattern.properties) || {};
806
+ Schemas.NamedProblemPattern.properties['name'] = {
807
+ type: 'string',
808
+ description: ( localizeWithPath(
809
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
810
+ 'NamedProblemPatternSchema.name',
811
+ 'The name of the problem pattern.'
812
+ ))
813
+ };
814
+ Schemas.MultiLineProblemPattern = {
815
+ type: 'array',
816
+ items: Schemas.ProblemPattern
817
+ };
818
+ Schemas.NamedMultiLineProblemPattern = {
819
+ type: 'object',
820
+ additionalProperties: false,
821
+ properties: {
822
+ name: {
823
+ type: 'string',
824
+ description: ( localizeWithPath(
825
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
826
+ 'NamedMultiLineProblemPatternSchema.name',
827
+ 'The name of the problem multi line problem pattern.'
828
+ ))
829
+ },
830
+ patterns: {
831
+ type: 'array',
832
+ description: ( localizeWithPath(
833
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
834
+ 'NamedMultiLineProblemPatternSchema.patterns',
835
+ 'The actual patterns.'
836
+ )),
837
+ items: Schemas.ProblemPattern
838
+ }
839
+ }
840
+ };
841
+ })(Schemas || (Schemas = {})));
842
+ const problemPatternExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
843
+ extensionPoint: 'problemPatterns',
844
+ jsonSchema: {
845
+ description: ( localizeWithPath(
846
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
847
+ 'ProblemPatternExtPoint',
848
+ 'Contributes problem patterns'
849
+ )),
850
+ type: 'array',
851
+ items: {
852
+ anyOf: [
853
+ Schemas.NamedProblemPattern,
854
+ Schemas.NamedMultiLineProblemPattern
855
+ ]
856
+ }
857
+ }
858
+ }));
859
+ class ProblemPatternRegistryImpl {
860
+ constructor() {
861
+ this.patterns = Object.create(null);
862
+ this.fillDefaults();
863
+ this.readyPromise = ( new Promise((resolve, reject) => {
864
+ problemPatternExtPoint.setHandler((extensions, delta) => {
865
+ try {
866
+ delta.removed.forEach(extension => {
867
+ const problemPatterns = extension.value;
868
+ for (const pattern of problemPatterns) {
869
+ if (this.patterns[pattern.name]) {
870
+ delete this.patterns[pattern.name];
871
+ }
872
+ }
873
+ });
874
+ delta.added.forEach(extension => {
875
+ const problemPatterns = extension.value;
876
+ const parser = ( new ProblemPatternParser(( new ExtensionRegistryReporter(extension.collector))));
877
+ for (const pattern of problemPatterns) {
878
+ if (Config.NamedMultiLineCheckedProblemPattern.is(pattern)) {
879
+ const result = parser.parse(pattern);
880
+ if (parser.problemReporter.status.state < 3 ) {
881
+ this.add(result.name, result.patterns);
882
+ }
883
+ else {
884
+ extension.collector.error(( localizeWithPath(
885
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
886
+ 'ProblemPatternRegistry.error',
887
+ 'Invalid problem pattern. The pattern will be ignored.'
888
+ )));
889
+ extension.collector.error(JSON.stringify(pattern, undefined, 4));
890
+ }
891
+ }
892
+ else if (Config.NamedProblemPattern.is(pattern)) {
893
+ const result = parser.parse(pattern);
894
+ if (parser.problemReporter.status.state < 3 ) {
895
+ this.add(pattern.name, result);
896
+ }
897
+ else {
898
+ extension.collector.error(( localizeWithPath(
899
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
900
+ 'ProblemPatternRegistry.error',
901
+ 'Invalid problem pattern. The pattern will be ignored.'
902
+ )));
903
+ extension.collector.error(JSON.stringify(pattern, undefined, 4));
904
+ }
905
+ }
906
+ parser.reset();
907
+ }
908
+ });
909
+ }
910
+ catch (error) {
911
+ }
912
+ resolve(undefined);
913
+ });
914
+ }));
915
+ }
916
+ onReady() {
917
+ return this.readyPromise;
918
+ }
919
+ add(key, value) {
920
+ this.patterns[key] = value;
921
+ }
922
+ get(key) {
923
+ return this.patterns[key];
924
+ }
925
+ fillDefaults() {
926
+ this.add('msCompile', {
927
+ regexp: /^(?:\s*\d+>)?(\S.*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\)\s*:\s+((?:fatal +)?error|warning|info)\s+(\w+\d+)\s*:\s*(.*)$/,
928
+ kind: ProblemLocationKind.Location,
929
+ file: 1,
930
+ location: 2,
931
+ severity: 3,
932
+ code: 4,
933
+ message: 5
934
+ });
935
+ this.add('gulp-tsc', {
936
+ regexp: /^([^\s].*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\):\s+(\d+)\s+(.*)$/,
937
+ kind: ProblemLocationKind.Location,
938
+ file: 1,
939
+ location: 2,
940
+ code: 3,
941
+ message: 4
942
+ });
943
+ this.add('cpp', {
944
+ regexp: /^(\S.*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\):\s+(error|warning|info)\s+(C\d+)\s*:\s*(.*)$/,
945
+ kind: ProblemLocationKind.Location,
946
+ file: 1,
947
+ location: 2,
948
+ severity: 3,
949
+ code: 4,
950
+ message: 5
951
+ });
952
+ this.add('csc', {
953
+ regexp: /^(\S.*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\):\s+(error|warning|info)\s+(CS\d+)\s*:\s*(.*)$/,
954
+ kind: ProblemLocationKind.Location,
955
+ file: 1,
956
+ location: 2,
957
+ severity: 3,
958
+ code: 4,
959
+ message: 5
960
+ });
961
+ this.add('vb', {
962
+ regexp: /^(\S.*)\((\d+|\d+,\d+|\d+,\d+,\d+,\d+)\):\s+(error|warning|info)\s+(BC\d+)\s*:\s*(.*)$/,
963
+ kind: ProblemLocationKind.Location,
964
+ file: 1,
965
+ location: 2,
966
+ severity: 3,
967
+ code: 4,
968
+ message: 5
969
+ });
970
+ this.add('lessCompile', {
971
+ regexp: /^\s*(.*) in file (.*) line no. (\d+)$/,
972
+ kind: ProblemLocationKind.Location,
973
+ message: 1,
974
+ file: 2,
975
+ line: 3
976
+ });
977
+ this.add('jshint', {
978
+ regexp: /^(.*):\s+line\s+(\d+),\s+col\s+(\d+),\s(.+?)(?:\s+\((\w)(\d+)\))?$/,
979
+ kind: ProblemLocationKind.Location,
980
+ file: 1,
981
+ line: 2,
982
+ character: 3,
983
+ message: 4,
984
+ severity: 5,
985
+ code: 6
986
+ });
987
+ this.add('jshint-stylish', [
988
+ {
989
+ regexp: /^(.+)$/,
990
+ kind: ProblemLocationKind.Location,
991
+ file: 1
992
+ },
993
+ {
994
+ regexp: /^\s+line\s+(\d+)\s+col\s+(\d+)\s+(.+?)(?:\s+\((\w)(\d+)\))?$/,
995
+ line: 1,
996
+ character: 2,
997
+ message: 3,
998
+ severity: 4,
999
+ code: 5,
1000
+ loop: true
1001
+ }
1002
+ ]);
1003
+ this.add('eslint-compact', {
1004
+ regexp: /^(.+):\sline\s(\d+),\scol\s(\d+),\s(Error|Warning|Info)\s-\s(.+)\s\((.+)\)$/,
1005
+ file: 1,
1006
+ kind: ProblemLocationKind.Location,
1007
+ line: 2,
1008
+ character: 3,
1009
+ severity: 4,
1010
+ message: 5,
1011
+ code: 6
1012
+ });
1013
+ this.add('eslint-stylish', [
1014
+ {
1015
+ regexp: /^((?:[a-zA-Z]:)*[./\\]+.*?)$/,
1016
+ kind: ProblemLocationKind.Location,
1017
+ file: 1
1018
+ },
1019
+ {
1020
+ regexp: /^\s+(\d+):(\d+)\s+(error|warning|info)\s+(.+?)(?:\s\s+(.*))?$/,
1021
+ line: 1,
1022
+ character: 2,
1023
+ severity: 3,
1024
+ message: 4,
1025
+ code: 5,
1026
+ loop: true
1027
+ }
1028
+ ]);
1029
+ this.add('go', {
1030
+ regexp: /^([^:]*: )?((.:)?[^:]*):(\d+)(:(\d+))?: (.*)$/,
1031
+ kind: ProblemLocationKind.Location,
1032
+ file: 2,
1033
+ line: 4,
1034
+ character: 6,
1035
+ message: 7
1036
+ });
1037
+ }
1038
+ }
1039
+ const ProblemPatternRegistry = ( new ProblemPatternRegistryImpl());
1040
+ class ProblemMatcherParser extends Parser {
1041
+ constructor(logger) {
1042
+ super(logger);
1043
+ }
1044
+ parse(json) {
1045
+ const result = this.createProblemMatcher(json);
1046
+ if (!this.checkProblemMatcherValid(json, result)) {
1047
+ return undefined;
1048
+ }
1049
+ this.addWatchingMatcher(json, result);
1050
+ return result;
1051
+ }
1052
+ checkProblemMatcherValid(externalProblemMatcher, problemMatcher) {
1053
+ if (!problemMatcher) {
1054
+ this.error(( localizeWithPath(
1055
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1056
+ 'ProblemMatcherParser.noProblemMatcher',
1057
+ 'Error: the description can\'t be converted into a problem matcher:\n{0}\n',
1058
+ JSON.stringify(externalProblemMatcher, null, 4)
1059
+ )));
1060
+ return false;
1061
+ }
1062
+ if (!problemMatcher.pattern) {
1063
+ this.error(( localizeWithPath(
1064
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1065
+ 'ProblemMatcherParser.noProblemPattern',
1066
+ 'Error: the description doesn\'t define a valid problem pattern:\n{0}\n',
1067
+ JSON.stringify(externalProblemMatcher, null, 4)
1068
+ )));
1069
+ return false;
1070
+ }
1071
+ if (!problemMatcher.owner) {
1072
+ this.error(( localizeWithPath(
1073
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1074
+ 'ProblemMatcherParser.noOwner',
1075
+ 'Error: the description doesn\'t define an owner:\n{0}\n',
1076
+ JSON.stringify(externalProblemMatcher, null, 4)
1077
+ )));
1078
+ return false;
1079
+ }
1080
+ if (Types.isUndefined(problemMatcher.fileLocation)) {
1081
+ this.error(( localizeWithPath(
1082
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1083
+ 'ProblemMatcherParser.noFileLocation',
1084
+ 'Error: the description doesn\'t define a file location:\n{0}\n',
1085
+ JSON.stringify(externalProblemMatcher, null, 4)
1086
+ )));
1087
+ return false;
1088
+ }
1089
+ return true;
1090
+ }
1091
+ createProblemMatcher(description) {
1092
+ let result = null;
1093
+ const owner = Types.isString(description.owner) ? description.owner : UUID.generateUuid();
1094
+ const source = Types.isString(description.source) ? description.source : undefined;
1095
+ let applyTo = Types.isString(description.applyTo) ? ApplyToKind.fromString(description.applyTo) : ApplyToKind.allDocuments;
1096
+ if (!applyTo) {
1097
+ applyTo = ApplyToKind.allDocuments;
1098
+ }
1099
+ let fileLocation = undefined;
1100
+ let filePrefix = undefined;
1101
+ let kind;
1102
+ if (Types.isUndefined(description.fileLocation)) {
1103
+ fileLocation = FileLocationKind.Relative;
1104
+ filePrefix = '${workspaceFolder}';
1105
+ }
1106
+ else if (Types.isString(description.fileLocation)) {
1107
+ kind = FileLocationKind.fromString(description.fileLocation);
1108
+ if (kind) {
1109
+ fileLocation = kind;
1110
+ if ((kind === FileLocationKind.Relative) || (kind === FileLocationKind.AutoDetect)) {
1111
+ filePrefix = '${workspaceFolder}';
1112
+ }
1113
+ else if (kind === FileLocationKind.Search) {
1114
+ filePrefix = { include: ['${workspaceFolder}'] };
1115
+ }
1116
+ }
1117
+ }
1118
+ else if (Types.isStringArray(description.fileLocation)) {
1119
+ const values = description.fileLocation;
1120
+ if (values.length > 0) {
1121
+ kind = FileLocationKind.fromString(values[0]);
1122
+ if (values.length === 1 && kind === FileLocationKind.Absolute) {
1123
+ fileLocation = kind;
1124
+ }
1125
+ else if (values.length === 2 && (kind === FileLocationKind.Relative || kind === FileLocationKind.AutoDetect) && values[1]) {
1126
+ fileLocation = kind;
1127
+ filePrefix = values[1];
1128
+ }
1129
+ }
1130
+ }
1131
+ else if (Array.isArray(description.fileLocation)) {
1132
+ const kind = FileLocationKind.fromString(description.fileLocation[0]);
1133
+ if (kind === FileLocationKind.Search) {
1134
+ fileLocation = FileLocationKind.Search;
1135
+ filePrefix = description.fileLocation[1] ?? { include: ['${workspaceFolder}'] };
1136
+ }
1137
+ }
1138
+ const pattern = description.pattern ? this.createProblemPattern(description.pattern) : undefined;
1139
+ let severity = description.severity ? Severity.fromValue(description.severity) : undefined;
1140
+ if (severity === Severity.Ignore) {
1141
+ this.info(( localizeWithPath(
1142
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1143
+ 'ProblemMatcherParser.unknownSeverity',
1144
+ 'Info: unknown severity {0}. Valid values are error, warning and info.\n',
1145
+ description.severity
1146
+ )));
1147
+ severity = Severity.Error;
1148
+ }
1149
+ if (Types.isString(description.base)) {
1150
+ const variableName = description.base;
1151
+ if (variableName.length > 1 && variableName[0] === '$') {
1152
+ const base = ProblemMatcherRegistry.get(variableName.substring(1));
1153
+ if (base) {
1154
+ result = Objects.deepClone(base);
1155
+ if (description.owner !== undefined && owner !== undefined) {
1156
+ result.owner = owner;
1157
+ }
1158
+ if (description.source !== undefined && source !== undefined) {
1159
+ result.source = source;
1160
+ }
1161
+ if (description.fileLocation !== undefined && fileLocation !== undefined) {
1162
+ result.fileLocation = fileLocation;
1163
+ result.filePrefix = filePrefix;
1164
+ }
1165
+ if (description.pattern !== undefined && pattern !== undefined && pattern !== null) {
1166
+ result.pattern = pattern;
1167
+ }
1168
+ if (description.severity !== undefined && severity !== undefined) {
1169
+ result.severity = severity;
1170
+ }
1171
+ if (description.applyTo !== undefined && applyTo !== undefined) {
1172
+ result.applyTo = applyTo;
1173
+ }
1174
+ }
1175
+ }
1176
+ }
1177
+ else if (fileLocation && pattern) {
1178
+ result = {
1179
+ owner: owner,
1180
+ applyTo: applyTo,
1181
+ fileLocation: fileLocation,
1182
+ pattern: pattern,
1183
+ };
1184
+ if (source) {
1185
+ result.source = source;
1186
+ }
1187
+ if (filePrefix) {
1188
+ result.filePrefix = filePrefix;
1189
+ }
1190
+ if (severity) {
1191
+ result.severity = severity;
1192
+ }
1193
+ }
1194
+ if (Config.isNamedProblemMatcher(description)) {
1195
+ result.name = description.name;
1196
+ result.label = Types.isString(description.label) ? description.label : description.name;
1197
+ }
1198
+ return result;
1199
+ }
1200
+ createProblemPattern(value) {
1201
+ if (Types.isString(value)) {
1202
+ const variableName = value;
1203
+ if (variableName.length > 1 && variableName[0] === '$') {
1204
+ const result = ProblemPatternRegistry.get(variableName.substring(1));
1205
+ if (!result) {
1206
+ this.error(( localizeWithPath(
1207
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1208
+ 'ProblemMatcherParser.noDefinedPatter',
1209
+ 'Error: the pattern with the identifier {0} doesn\'t exist.',
1210
+ variableName
1211
+ )));
1212
+ }
1213
+ return result;
1214
+ }
1215
+ else {
1216
+ if (variableName.length === 0) {
1217
+ this.error(( localizeWithPath(
1218
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1219
+ 'ProblemMatcherParser.noIdentifier',
1220
+ 'Error: the pattern property refers to an empty identifier.'
1221
+ )));
1222
+ }
1223
+ else {
1224
+ this.error(( localizeWithPath(
1225
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1226
+ 'ProblemMatcherParser.noValidIdentifier',
1227
+ 'Error: the pattern property {0} is not a valid pattern variable name.',
1228
+ variableName
1229
+ )));
1230
+ }
1231
+ }
1232
+ }
1233
+ else if (value) {
1234
+ const problemPatternParser = ( new ProblemPatternParser(this.problemReporter));
1235
+ if (Array.isArray(value)) {
1236
+ return problemPatternParser.parse(value);
1237
+ }
1238
+ else {
1239
+ return problemPatternParser.parse(value);
1240
+ }
1241
+ }
1242
+ return null;
1243
+ }
1244
+ addWatchingMatcher(external, internal) {
1245
+ const oldBegins = this.createRegularExpression(external.watchedTaskBeginsRegExp);
1246
+ const oldEnds = this.createRegularExpression(external.watchedTaskEndsRegExp);
1247
+ if (oldBegins && oldEnds) {
1248
+ internal.watching = {
1249
+ activeOnStart: false,
1250
+ beginsPattern: { regexp: oldBegins },
1251
+ endsPattern: { regexp: oldEnds }
1252
+ };
1253
+ return;
1254
+ }
1255
+ const backgroundMonitor = external.background || external.watching;
1256
+ if (Types.isUndefinedOrNull(backgroundMonitor)) {
1257
+ return;
1258
+ }
1259
+ const begins = this.createWatchingPattern(backgroundMonitor.beginsPattern);
1260
+ const ends = this.createWatchingPattern(backgroundMonitor.endsPattern);
1261
+ if (begins && ends) {
1262
+ internal.watching = {
1263
+ activeOnStart: Types.isBoolean(backgroundMonitor.activeOnStart) ? backgroundMonitor.activeOnStart : false,
1264
+ beginsPattern: begins,
1265
+ endsPattern: ends
1266
+ };
1267
+ return;
1268
+ }
1269
+ if (begins || ends) {
1270
+ this.error(( localizeWithPath(
1271
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1272
+ 'ProblemMatcherParser.problemPattern.watchingMatcher',
1273
+ 'A problem matcher must define both a begin pattern and an end pattern for watching.'
1274
+ )));
1275
+ }
1276
+ }
1277
+ createWatchingPattern(external) {
1278
+ if (Types.isUndefinedOrNull(external)) {
1279
+ return null;
1280
+ }
1281
+ let regexp;
1282
+ let file;
1283
+ if (Types.isString(external)) {
1284
+ regexp = this.createRegularExpression(external);
1285
+ }
1286
+ else {
1287
+ regexp = this.createRegularExpression(external.regexp);
1288
+ if (Types.isNumber(external.file)) {
1289
+ file = external.file;
1290
+ }
1291
+ }
1292
+ if (!regexp) {
1293
+ return null;
1294
+ }
1295
+ return file ? { regexp, file } : { regexp, file: 1 };
1296
+ }
1297
+ createRegularExpression(value) {
1298
+ let result = null;
1299
+ if (!value) {
1300
+ return result;
1301
+ }
1302
+ try {
1303
+ result = ( new RegExp(value));
1304
+ }
1305
+ catch (err) {
1306
+ this.error(( localizeWithPath(
1307
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1308
+ 'ProblemMatcherParser.invalidRegexp',
1309
+ 'Error: The string {0} is not a valid regular expression.\n',
1310
+ value
1311
+ )));
1312
+ }
1313
+ return result;
1314
+ }
1315
+ }
1316
+ ( (function(Schemas) {
1317
+ Schemas.WatchingPattern = {
1318
+ type: 'object',
1319
+ additionalProperties: false,
1320
+ properties: {
1321
+ regexp: {
1322
+ type: 'string',
1323
+ description: ( localizeWithPath(
1324
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1325
+ 'WatchingPatternSchema.regexp',
1326
+ 'The regular expression to detect the begin or end of a background task.'
1327
+ ))
1328
+ },
1329
+ file: {
1330
+ type: 'integer',
1331
+ description: ( localizeWithPath(
1332
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1333
+ 'WatchingPatternSchema.file',
1334
+ 'The match group index of the filename. Can be omitted.'
1335
+ ))
1336
+ },
1337
+ }
1338
+ };
1339
+ Schemas.PatternType = {
1340
+ anyOf: [
1341
+ {
1342
+ type: 'string',
1343
+ description: ( localizeWithPath(
1344
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1345
+ 'PatternTypeSchema.name',
1346
+ 'The name of a contributed or predefined pattern'
1347
+ ))
1348
+ },
1349
+ Schemas.ProblemPattern,
1350
+ Schemas.MultiLineProblemPattern
1351
+ ],
1352
+ description: ( localizeWithPath(
1353
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1354
+ 'PatternTypeSchema.description',
1355
+ 'A problem pattern or the name of a contributed or predefined problem pattern. Can be omitted if base is specified.'
1356
+ ))
1357
+ };
1358
+ Schemas.ProblemMatcher = {
1359
+ type: 'object',
1360
+ additionalProperties: false,
1361
+ properties: {
1362
+ base: {
1363
+ type: 'string',
1364
+ description: ( localizeWithPath(
1365
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1366
+ 'ProblemMatcherSchema.base',
1367
+ 'The name of a base problem matcher to use.'
1368
+ ))
1369
+ },
1370
+ owner: {
1371
+ type: 'string',
1372
+ description: ( localizeWithPath(
1373
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1374
+ 'ProblemMatcherSchema.owner',
1375
+ 'The owner of the problem inside Code. Can be omitted if base is specified. Defaults to \'external\' if omitted and base is not specified.'
1376
+ ))
1377
+ },
1378
+ source: {
1379
+ type: 'string',
1380
+ description: ( localizeWithPath(
1381
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1382
+ 'ProblemMatcherSchema.source',
1383
+ 'A human-readable string describing the source of this diagnostic, e.g. \'typescript\' or \'super lint\'.'
1384
+ ))
1385
+ },
1386
+ severity: {
1387
+ type: 'string',
1388
+ enum: ['error', 'warning', 'info'],
1389
+ description: ( localizeWithPath(
1390
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1391
+ 'ProblemMatcherSchema.severity',
1392
+ 'The default severity for captures problems. Is used if the pattern doesn\'t define a match group for severity.'
1393
+ ))
1394
+ },
1395
+ applyTo: {
1396
+ type: 'string',
1397
+ enum: ['allDocuments', 'openDocuments', 'closedDocuments'],
1398
+ description: ( localizeWithPath(
1399
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1400
+ 'ProblemMatcherSchema.applyTo',
1401
+ 'Controls if a problem reported on a text document is applied only to open, closed or all documents.'
1402
+ ))
1403
+ },
1404
+ pattern: Schemas.PatternType,
1405
+ fileLocation: {
1406
+ oneOf: [
1407
+ {
1408
+ type: 'string',
1409
+ enum: ['absolute', 'relative', 'autoDetect', 'search']
1410
+ },
1411
+ {
1412
+ type: 'array',
1413
+ prefixItems: [
1414
+ {
1415
+ type: 'string',
1416
+ enum: ['absolute', 'relative', 'autoDetect', 'search']
1417
+ },
1418
+ ],
1419
+ minItems: 1,
1420
+ maxItems: 1,
1421
+ additionalItems: false
1422
+ },
1423
+ {
1424
+ type: 'array',
1425
+ prefixItems: [
1426
+ { type: 'string', enum: ['relative', 'autoDetect'] },
1427
+ { type: 'string' },
1428
+ ],
1429
+ minItems: 2,
1430
+ maxItems: 2,
1431
+ additionalItems: false,
1432
+ examples: [
1433
+ ['relative', '${workspaceFolder}'],
1434
+ ['autoDetect', '${workspaceFolder}'],
1435
+ ]
1436
+ },
1437
+ {
1438
+ type: 'array',
1439
+ prefixItems: [
1440
+ { type: 'string', enum: ['search'] },
1441
+ {
1442
+ type: 'object',
1443
+ properties: {
1444
+ 'include': {
1445
+ oneOf: [
1446
+ { type: 'string' },
1447
+ { type: 'array', items: { type: 'string' } }
1448
+ ]
1449
+ },
1450
+ 'exclude': {
1451
+ oneOf: [
1452
+ { type: 'string' },
1453
+ { type: 'array', items: { type: 'string' } }
1454
+ ]
1455
+ },
1456
+ },
1457
+ required: ['include']
1458
+ }
1459
+ ],
1460
+ minItems: 2,
1461
+ maxItems: 2,
1462
+ additionalItems: false,
1463
+ examples: [
1464
+ ['search', { 'include': ['${workspaceFolder}'] }],
1465
+ ['search', { 'include': ['${workspaceFolder}'], 'exclude': [] }]
1466
+ ],
1467
+ }
1468
+ ],
1469
+ description: ( localizeWithPath(
1470
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1471
+ 'ProblemMatcherSchema.fileLocation',
1472
+ 'Defines how file names reported in a problem pattern should be interpreted. A relative fileLocation may be an array, where the second element of the array is the path of the relative file location. The search fileLocation mode, performs a deep (and, possibly, heavy) file system search within the directories specified by the include/exclude properties of the second element (or the current workspace directory if not specified).'
1473
+ ))
1474
+ },
1475
+ background: {
1476
+ type: 'object',
1477
+ additionalProperties: false,
1478
+ description: ( localizeWithPath(
1479
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1480
+ 'ProblemMatcherSchema.background',
1481
+ 'Patterns to track the begin and end of a matcher active on a background task.'
1482
+ )),
1483
+ properties: {
1484
+ activeOnStart: {
1485
+ type: 'boolean',
1486
+ description: ( localizeWithPath(
1487
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1488
+ 'ProblemMatcherSchema.background.activeOnStart',
1489
+ 'If set to true the background monitor is in active mode when the task starts. This is equals of issuing a line that matches the beginsPattern'
1490
+ ))
1491
+ },
1492
+ beginsPattern: {
1493
+ oneOf: [
1494
+ {
1495
+ type: 'string'
1496
+ },
1497
+ Schemas.WatchingPattern
1498
+ ],
1499
+ description: ( localizeWithPath(
1500
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1501
+ 'ProblemMatcherSchema.background.beginsPattern',
1502
+ 'If matched in the output the start of a background task is signaled.'
1503
+ ))
1504
+ },
1505
+ endsPattern: {
1506
+ oneOf: [
1507
+ {
1508
+ type: 'string'
1509
+ },
1510
+ Schemas.WatchingPattern
1511
+ ],
1512
+ description: ( localizeWithPath(
1513
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1514
+ 'ProblemMatcherSchema.background.endsPattern',
1515
+ 'If matched in the output the end of a background task is signaled.'
1516
+ ))
1517
+ }
1518
+ }
1519
+ },
1520
+ watching: {
1521
+ type: 'object',
1522
+ additionalProperties: false,
1523
+ deprecationMessage: ( localizeWithPath(
1524
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1525
+ 'ProblemMatcherSchema.watching.deprecated',
1526
+ 'The watching property is deprecated. Use background instead.'
1527
+ )),
1528
+ description: ( localizeWithPath(
1529
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1530
+ 'ProblemMatcherSchema.watching',
1531
+ 'Patterns to track the begin and end of a watching matcher.'
1532
+ )),
1533
+ properties: {
1534
+ activeOnStart: {
1535
+ type: 'boolean',
1536
+ description: ( localizeWithPath(
1537
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1538
+ 'ProblemMatcherSchema.watching.activeOnStart',
1539
+ 'If set to true the watcher is in active mode when the task starts. This is equals of issuing a line that matches the beginPattern'
1540
+ ))
1541
+ },
1542
+ beginsPattern: {
1543
+ oneOf: [
1544
+ {
1545
+ type: 'string'
1546
+ },
1547
+ Schemas.WatchingPattern
1548
+ ],
1549
+ description: ( localizeWithPath(
1550
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1551
+ 'ProblemMatcherSchema.watching.beginsPattern',
1552
+ 'If matched in the output the start of a watching task is signaled.'
1553
+ ))
1554
+ },
1555
+ endsPattern: {
1556
+ oneOf: [
1557
+ {
1558
+ type: 'string'
1559
+ },
1560
+ Schemas.WatchingPattern
1561
+ ],
1562
+ description: ( localizeWithPath(
1563
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1564
+ 'ProblemMatcherSchema.watching.endsPattern',
1565
+ 'If matched in the output the end of a watching task is signaled.'
1566
+ ))
1567
+ }
1568
+ }
1569
+ }
1570
+ }
1571
+ };
1572
+ Schemas.LegacyProblemMatcher = Objects.deepClone(Schemas.ProblemMatcher);
1573
+ Schemas.LegacyProblemMatcher.properties = Objects.deepClone(Schemas.LegacyProblemMatcher.properties) || {};
1574
+ Schemas.LegacyProblemMatcher.properties['watchedTaskBeginsRegExp'] = {
1575
+ type: 'string',
1576
+ deprecationMessage: ( localizeWithPath(
1577
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1578
+ 'LegacyProblemMatcherSchema.watchedBegin.deprecated',
1579
+ 'This property is deprecated. Use the watching property instead.'
1580
+ )),
1581
+ description: ( localizeWithPath(
1582
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1583
+ 'LegacyProblemMatcherSchema.watchedBegin',
1584
+ 'A regular expression signaling that a watched tasks begins executing triggered through file watching.'
1585
+ ))
1586
+ };
1587
+ Schemas.LegacyProblemMatcher.properties['watchedTaskEndsRegExp'] = {
1588
+ type: 'string',
1589
+ deprecationMessage: ( localizeWithPath(
1590
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1591
+ 'LegacyProblemMatcherSchema.watchedEnd.deprecated',
1592
+ 'This property is deprecated. Use the watching property instead.'
1593
+ )),
1594
+ description: ( localizeWithPath(
1595
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1596
+ 'LegacyProblemMatcherSchema.watchedEnd',
1597
+ 'A regular expression signaling that a watched tasks ends executing.'
1598
+ ))
1599
+ };
1600
+ Schemas.NamedProblemMatcher = Objects.deepClone(Schemas.ProblemMatcher);
1601
+ Schemas.NamedProblemMatcher.properties = Objects.deepClone(Schemas.NamedProblemMatcher.properties) || {};
1602
+ Schemas.NamedProblemMatcher.properties.name = {
1603
+ type: 'string',
1604
+ description: ( localizeWithPath(
1605
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1606
+ 'NamedProblemMatcherSchema.name',
1607
+ 'The name of the problem matcher used to refer to it.'
1608
+ ))
1609
+ };
1610
+ Schemas.NamedProblemMatcher.properties.label = {
1611
+ type: 'string',
1612
+ description: ( localizeWithPath(
1613
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1614
+ 'NamedProblemMatcherSchema.label',
1615
+ 'A human readable label of the problem matcher.'
1616
+ ))
1617
+ };
1618
+ })(Schemas || (Schemas = {})));
1619
+ const problemMatchersExtPoint = ( ExtensionsRegistry.registerExtensionPoint({
1620
+ extensionPoint: 'problemMatchers',
1621
+ deps: [problemPatternExtPoint],
1622
+ jsonSchema: {
1623
+ description: ( localizeWithPath(
1624
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1625
+ 'ProblemMatcherExtPoint',
1626
+ 'Contributes problem matchers'
1627
+ )),
1628
+ type: 'array',
1629
+ items: Schemas.NamedProblemMatcher
1630
+ }
1631
+ }));
1632
+ class ProblemMatcherRegistryImpl {
1633
+ constructor() {
1634
+ this._onMatchersChanged = ( new Emitter());
1635
+ this.onMatcherChanged = this._onMatchersChanged.event;
1636
+ this.matchers = Object.create(null);
1637
+ this.fillDefaults();
1638
+ this.readyPromise = ( new Promise((resolve, reject) => {
1639
+ problemMatchersExtPoint.setHandler((extensions, delta) => {
1640
+ try {
1641
+ delta.removed.forEach(extension => {
1642
+ const problemMatchers = extension.value;
1643
+ for (const matcher of problemMatchers) {
1644
+ if (this.matchers[matcher.name]) {
1645
+ delete this.matchers[matcher.name];
1646
+ }
1647
+ }
1648
+ });
1649
+ delta.added.forEach(extension => {
1650
+ const problemMatchers = extension.value;
1651
+ const parser = ( new ProblemMatcherParser(( new ExtensionRegistryReporter(extension.collector))));
1652
+ for (const matcher of problemMatchers) {
1653
+ const result = parser.parse(matcher);
1654
+ if (result && isNamedProblemMatcher(result)) {
1655
+ this.add(result);
1656
+ }
1657
+ }
1658
+ });
1659
+ if ((delta.removed.length > 0) || (delta.added.length > 0)) {
1660
+ this._onMatchersChanged.fire();
1661
+ }
1662
+ }
1663
+ catch (error) {
1664
+ }
1665
+ const matcher = this.get('tsc-watch');
1666
+ if (matcher) {
1667
+ matcher.tscWatch = true;
1668
+ }
1669
+ resolve(undefined);
1670
+ });
1671
+ }));
1672
+ }
1673
+ onReady() {
1674
+ ProblemPatternRegistry.onReady();
1675
+ return this.readyPromise;
1676
+ }
1677
+ add(matcher) {
1678
+ this.matchers[matcher.name] = matcher;
1679
+ }
1680
+ get(name) {
1681
+ return this.matchers[name];
1682
+ }
1683
+ keys() {
1684
+ return ( Object.keys(this.matchers));
1685
+ }
1686
+ fillDefaults() {
1687
+ this.add({
1688
+ name: 'msCompile',
1689
+ label: ( localizeWithPath(
1690
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1691
+ 'msCompile',
1692
+ 'Microsoft compiler problems'
1693
+ )),
1694
+ owner: 'msCompile',
1695
+ source: 'cpp',
1696
+ applyTo: ApplyToKind.allDocuments,
1697
+ fileLocation: FileLocationKind.Absolute,
1698
+ pattern: ProblemPatternRegistry.get('msCompile')
1699
+ });
1700
+ this.add({
1701
+ name: 'lessCompile',
1702
+ label: ( localizeWithPath(
1703
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1704
+ 'lessCompile',
1705
+ 'Less problems'
1706
+ )),
1707
+ deprecated: true,
1708
+ owner: 'lessCompile',
1709
+ source: 'less',
1710
+ applyTo: ApplyToKind.allDocuments,
1711
+ fileLocation: FileLocationKind.Absolute,
1712
+ pattern: ProblemPatternRegistry.get('lessCompile'),
1713
+ severity: Severity.Error
1714
+ });
1715
+ this.add({
1716
+ name: 'gulp-tsc',
1717
+ label: ( localizeWithPath(
1718
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1719
+ 'gulp-tsc',
1720
+ 'Gulp TSC Problems'
1721
+ )),
1722
+ owner: 'typescript',
1723
+ source: 'ts',
1724
+ applyTo: ApplyToKind.closedDocuments,
1725
+ fileLocation: FileLocationKind.Relative,
1726
+ filePrefix: '${workspaceFolder}',
1727
+ pattern: ProblemPatternRegistry.get('gulp-tsc')
1728
+ });
1729
+ this.add({
1730
+ name: 'jshint',
1731
+ label: ( localizeWithPath(
1732
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1733
+ 'jshint',
1734
+ 'JSHint problems'
1735
+ )),
1736
+ owner: 'jshint',
1737
+ source: 'jshint',
1738
+ applyTo: ApplyToKind.allDocuments,
1739
+ fileLocation: FileLocationKind.Absolute,
1740
+ pattern: ProblemPatternRegistry.get('jshint')
1741
+ });
1742
+ this.add({
1743
+ name: 'jshint-stylish',
1744
+ label: ( localizeWithPath(
1745
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1746
+ 'jshint-stylish',
1747
+ 'JSHint stylish problems'
1748
+ )),
1749
+ owner: 'jshint',
1750
+ source: 'jshint',
1751
+ applyTo: ApplyToKind.allDocuments,
1752
+ fileLocation: FileLocationKind.Absolute,
1753
+ pattern: ProblemPatternRegistry.get('jshint-stylish')
1754
+ });
1755
+ this.add({
1756
+ name: 'eslint-compact',
1757
+ label: ( localizeWithPath(
1758
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1759
+ 'eslint-compact',
1760
+ 'ESLint compact problems'
1761
+ )),
1762
+ owner: 'eslint',
1763
+ source: 'eslint',
1764
+ applyTo: ApplyToKind.allDocuments,
1765
+ fileLocation: FileLocationKind.Absolute,
1766
+ filePrefix: '${workspaceFolder}',
1767
+ pattern: ProblemPatternRegistry.get('eslint-compact')
1768
+ });
1769
+ this.add({
1770
+ name: 'eslint-stylish',
1771
+ label: ( localizeWithPath(
1772
+ 'vs/workbench/contrib/tasks/common/problemMatcher',
1773
+ 'eslint-stylish',
1774
+ 'ESLint stylish problems'
1775
+ )),
1776
+ owner: 'eslint',
1777
+ source: 'eslint',
1778
+ applyTo: ApplyToKind.allDocuments,
1779
+ fileLocation: FileLocationKind.Absolute,
1780
+ pattern: ProblemPatternRegistry.get('eslint-stylish')
1781
+ });
1782
+ this.add({
1783
+ name: 'go',
1784
+ label: ( localizeWithPath('vs/workbench/contrib/tasks/common/problemMatcher', 'go', 'Go problems')),
1785
+ owner: 'go',
1786
+ source: 'go',
1787
+ applyTo: ApplyToKind.allDocuments,
1788
+ fileLocation: FileLocationKind.Relative,
1789
+ filePrefix: '${workspaceFolder}',
1790
+ pattern: ProblemPatternRegistry.get('go')
1791
+ });
1792
+ }
1793
+ }
1794
+ const ProblemMatcherRegistry = ( new ProblemMatcherRegistryImpl());
1795
+
1796
+ export { ApplyToKind, Config, ExtensionRegistryReporter, FileLocationKind, ProblemLocationKind, ProblemMatcherParser, ProblemMatcherRegistry, ProblemPatternParser, ProblemPatternRegistry, Schemas, createLineMatcher, getResource, isNamedProblemMatcher };