mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
check if values are true not just undefined (#155348)
This commit is contained in:
parent
cad5e069b6
commit
7839742867
|
@ -293,7 +293,9 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
|||
}));
|
||||
this._taskRunningState = TASK_RUNNING_STATE.bindTo(_contextKeyService);
|
||||
this._onDidStateChange = this._register(new Emitter());
|
||||
this._registerCommands();
|
||||
this._registerCommands().then(() => {
|
||||
TaskCommandsRegistered.bindTo(this._contextKeyService).set(true);
|
||||
});
|
||||
this._configurationResolverService.contributeVariable('defaultBuildTask', async (): Promise<string | undefined> => {
|
||||
let tasks = await this._getTasksForGroup(TaskGroup.Build);
|
||||
if (tasks.length > 0) {
|
||||
|
@ -491,7 +493,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
|||
this._openTaskFile(resource, TaskSourceKind.WorkspaceFile);
|
||||
}
|
||||
});
|
||||
TaskCommandsRegistered.bindTo(this._contextKeyService).set(true);
|
||||
}
|
||||
|
||||
private get workspaceFolders(): IWorkspaceFolder[] {
|
||||
|
@ -2173,7 +2174,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
|
|||
}
|
||||
|
||||
private get _jsonTasksSupported(): boolean {
|
||||
return !!ShellExecutionSupportedContext.getValue(this._contextKeyService) && !!ProcessExecutionSupportedContext.getValue(this._contextKeyService);
|
||||
return ShellExecutionSupportedContext.getValue(this._contextKeyService) === true && ProcessExecutionSupportedContext.getValue(this._contextKeyService) === true && !Platform.isWeb;
|
||||
}
|
||||
|
||||
private _computeWorkspaceFolderTasks(workspaceFolder: IWorkspaceFolder, runSource: TaskRunSource = TaskRunSource.User): Promise<IWorkspaceFolderTaskResult> {
|
||||
|
|
|
@ -40,7 +40,7 @@ import { TaskDefinitionRegistry } from 'vs/workbench/contrib/tasks/common/taskDe
|
|||
import { TerminalMenuBarGroup } from 'vs/workbench/contrib/terminal/browser/terminalMenus';
|
||||
import { isString } from 'vs/base/common/types';
|
||||
|
||||
const SHOW_TASKS_COMMANDS_CONTEXT = ContextKeyExpr.or(ShellExecutionSupportedContext, ProcessExecutionSupportedContext);
|
||||
const SHOW_TASKS_COMMANDS_CONTEXT = ContextKeyExpr.and(ShellExecutionSupportedContext, ProcessExecutionSupportedContext, TaskCommandsRegistered);
|
||||
|
||||
const workbenchRegistry = Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench);
|
||||
workbenchRegistry.registerWorkbenchContribution(RunAutomaticTasks, LifecyclePhase.Eventually);
|
||||
|
|
Loading…
Reference in a new issue