Skip to content

Commit 171537f

Browse files
authored
fix command not found warning (microsoft#155250)
fix command not found part of microsoft#155163
1 parent 3b03ea7 commit 171537f

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import {
5757
TaskSettingId,
5858
TasksSchemaProperties
5959
} from 'vs/workbench/contrib/tasks/common/tasks';
60-
import { ITaskService, ITaskProvider, IProblemMatcherRunOptions, ICustomizationProperties, ITaskFilter, IWorkspaceFolderTaskResult, CustomExecutionSupportedContext, ShellExecutionSupportedContext, ProcessExecutionSupportedContext } from 'vs/workbench/contrib/tasks/common/taskService';
60+
import { ITaskService, ITaskProvider, IProblemMatcherRunOptions, ICustomizationProperties, ITaskFilter, IWorkspaceFolderTaskResult, CustomExecutionSupportedContext, ShellExecutionSupportedContext, ProcessExecutionSupportedContext, TaskCommandsRegistered } from 'vs/workbench/contrib/tasks/common/taskService';
6161
import { getTemplates as getTaskTemplates } from 'vs/workbench/contrib/tasks/common/taskTemplates';
6262

6363
import * as TaskConfig from '../common/taskConfiguration';
@@ -491,6 +491,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
491491
this._openTaskFile(resource, TaskSourceKind.WorkspaceFile);
492492
}
493493
});
494+
TaskCommandsRegistered.bindTo(this._contextKeyService).set(true);
494495
}
495496

496497
private get workspaceFolders(): IWorkspaceFolder[] {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { StatusbarAlignment, IStatusbarService, IStatusbarEntryAccessor, IStatus
2121
import { IOutputChannelRegistry, Extensions as OutputExt } from 'vs/workbench/services/output/common/output';
2222

2323
import { ITaskEvent, TaskEventKind, TaskGroup, TaskSettingId, TASKS_CATEGORY, TASK_RUNNING_STATE } from 'vs/workbench/contrib/tasks/common/tasks';
24-
import { ITaskService, ProcessExecutionSupportedContext, ShellExecutionSupportedContext } from 'vs/workbench/contrib/tasks/common/taskService';
24+
import { ITaskService, ProcessExecutionSupportedContext, ShellExecutionSupportedContext, TaskCommandsRegistered } from 'vs/workbench/contrib/tasks/common/taskService';
2525

2626
import { Extensions as WorkbenchExtensions, IWorkbenchContributionsRegistry, IWorkbenchContribution } from 'vs/workbench/common/contributions';
2727
import { RunAutomaticTasks, ManageAutomaticTaskRunning } from 'vs/workbench/contrib/tasks/browser/runAutomaticTasks';
@@ -359,7 +359,7 @@ MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
359359
KeybindingsRegistry.registerKeybindingRule({
360360
id: 'workbench.action.tasks.build',
361361
weight: KeybindingWeight.WorkbenchContrib,
362-
when: undefined,
362+
when: TaskCommandsRegistered,
363363
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyB
364364
});
365365

src/vs/workbench/contrib/tasks/common/taskService.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export { ITaskSummary, Task, ITaskTerminateResponse as TaskTerminateResponse };
1919

2020
export const CustomExecutionSupportedContext = new RawContextKey<boolean>('customExecutionSupported', true, nls.localize('tasks.customExecutionSupported', "Whether CustomExecution tasks are supported. Consider using in the when clause of a \'taskDefinition\' contribution."));
2121
export const ShellExecutionSupportedContext = new RawContextKey<boolean>('shellExecutionSupported', false, nls.localize('tasks.shellExecutionSupported', "Whether ShellExecution tasks are supported. Consider using in the when clause of a \'taskDefinition\' contribution."));
22+
export const TaskCommandsRegistered = new RawContextKey<boolean>('taskCommandsRegistered', false, nls.localize('tasks.taskCommandsRegistered', "Whether the task commands have been registered yet"));
2223
export const ProcessExecutionSupportedContext = new RawContextKey<boolean>('processExecutionSupported', false, nls.localize('tasks.processExecutionSupported', "Whether ProcessExecution tasks are supported. Consider using in the when clause of a \'taskDefinition\' contribution."));
2324

2425
export const ITaskService = createDecorator<ITaskService>('taskService');

0 commit comments

Comments
 (0)