Skip to content

Commit 13dc6f1

Browse files
committed
Add setting to turn off problem matcher prompt
Fixes microsoft#62728
1 parent b6138b9 commit 13dc6f1

2 files changed

Lines changed: 38 additions & 4 deletions

File tree

src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,12 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
674674
}
675675

676676
private shouldAttachProblemMatcher(task: Task): boolean {
677+
const settingValue = this.configurationService.getValue('task.problemMatchers.neverPrompt');
678+
if (settingValue === true) {
679+
return false;
680+
} else if (task.type && Types.isStringArray(settingValue) && (settingValue.indexOf(task.type) >= 0)) {
681+
return false;
682+
}
677683
if (!this.canCustomize(task)) {
678684
return false;
679685
}

src/vs/workbench/contrib/tasks/browser/task.contribution.ts

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/wor
3535
import { RunAutomaticTasks, ManageAutomaticTaskRunning } from 'vs/workbench/contrib/tasks/browser/runAutomaticTasks';
3636
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
3737
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
38+
import schemaVersion1 from '../common/jsonSchema_v1';
39+
import schemaVersion2, { updateProblemMatchers } from '../common/jsonSchema_v2';
40+
import { AbstractTaskService, ConfigureTaskAction } from 'vs/workbench/contrib/tasks/browser/abstractTaskService';
41+
import { tasksSchemaId } from 'vs/workbench/services/configuration/common/configuration';
42+
import { IConfigurationRegistry, Extensions } from 'vs/platform/configuration/common/configurationRegistry';
3843

3944
let tasksCategory = nls.localize('tasksCategory', "Tasks");
4045

@@ -288,10 +293,6 @@ let schema: IJSONSchema = {
288293
}
289294
};
290295

291-
import schemaVersion1 from '../common/jsonSchema_v1';
292-
import schemaVersion2, { updateProblemMatchers } from '../common/jsonSchema_v2';
293-
import { AbstractTaskService, ConfigureTaskAction } from 'vs/workbench/contrib/tasks/browser/abstractTaskService';
294-
import { tasksSchemaId } from 'vs/workbench/services/configuration/common/configuration';
295296
schema.definitions = {
296297
...schemaVersion1.definitions,
297298
...schemaVersion2.definitions,
@@ -305,3 +306,30 @@ ProblemMatcherRegistry.onMatcherChanged(() => {
305306
updateProblemMatchers();
306307
jsonRegistry.notifySchemaChanged(tasksSchemaId);
307308
});
309+
310+
const configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);
311+
configurationRegistry.registerConfiguration({
312+
id: 'task',
313+
order: 100,
314+
title: nls.localize('tasksConfigurationTitle', "Tasks"),
315+
type: 'object',
316+
properties: {
317+
'task.problemMatchers.neverPrompt': {
318+
markdownDescription: nls.localize('task.problemMatchers.neverPrompt', "Configures whether to show the problem matcher prompt when running a task. Set to `true` to never promp, or use an array of task types to turn off prompting only for specific task types."),
319+
'oneOf': [
320+
{
321+
type: 'boolean',
322+
markdownDescription: nls.localize('task.problemMatchers.neverPrompt.boolean', 'Sets problem matcher prompting behavior for all tasks.')
323+
},
324+
{
325+
type: 'array',
326+
items: {
327+
type: 'string',
328+
markdownDescription: nls.localize('task.problemMatchers.neverPrompt.array', 'An array of task types to never prompt for problem matchers on.')
329+
}
330+
}
331+
],
332+
default: false
333+
}
334+
}
335+
});

0 commit comments

Comments
 (0)