File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
src/vs/workbench/contrib/tasks/browser Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -293,7 +293,9 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
293
293
} ) ) ;
294
294
this . _taskRunningState = TASK_RUNNING_STATE . bindTo ( _contextKeyService ) ;
295
295
this . _onDidStateChange = this . _register ( new Emitter ( ) ) ;
296
- this . _registerCommands ( ) ;
296
+ this . _registerCommands ( ) . then ( ( ) => {
297
+ TaskCommandsRegistered . bindTo ( this . _contextKeyService ) . set ( true ) ;
298
+ } ) ;
297
299
this . _configurationResolverService . contributeVariable ( 'defaultBuildTask' , async ( ) : Promise < string | undefined > => {
298
300
let tasks = await this . _getTasksForGroup ( TaskGroup . Build ) ;
299
301
if ( tasks . length > 0 ) {
@@ -491,7 +493,6 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
491
493
this . _openTaskFile ( resource , TaskSourceKind . WorkspaceFile ) ;
492
494
}
493
495
} ) ;
494
- TaskCommandsRegistered . bindTo ( this . _contextKeyService ) . set ( true ) ;
495
496
}
496
497
497
498
private get workspaceFolders ( ) : IWorkspaceFolder [ ] {
@@ -2173,7 +2174,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
2173
2174
}
2174
2175
2175
2176
private get _jsonTasksSupported ( ) : boolean {
2176
- return ! ! ShellExecutionSupportedContext . getValue ( this . _contextKeyService ) && ! ! ProcessExecutionSupportedContext . getValue ( this . _contextKeyService ) ;
2177
+ return ShellExecutionSupportedContext . getValue ( this . _contextKeyService ) === true && ProcessExecutionSupportedContext . getValue ( this . _contextKeyService ) === true && ! Platform . isWeb ;
2177
2178
}
2178
2179
2179
2180
private _computeWorkspaceFolderTasks ( workspaceFolder : IWorkspaceFolder , runSource : TaskRunSource = TaskRunSource . User ) : Promise < IWorkspaceFolderTaskResult > {
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ import { TaskDefinitionRegistry } from 'vs/workbench/contrib/tasks/common/taskDe
40
40
import { TerminalMenuBarGroup } from 'vs/workbench/contrib/terminal/browser/terminalMenus' ;
41
41
import { isString } from 'vs/base/common/types' ;
42
42
43
- const SHOW_TASKS_COMMANDS_CONTEXT = ContextKeyExpr . or ( ShellExecutionSupportedContext , ProcessExecutionSupportedContext ) ;
43
+ const SHOW_TASKS_COMMANDS_CONTEXT = ContextKeyExpr . and ( ShellExecutionSupportedContext , ProcessExecutionSupportedContext , TaskCommandsRegistered ) ;
44
44
45
45
const workbenchRegistry = Registry . as < IWorkbenchContributionsRegistry > ( WorkbenchExtensions . Workbench ) ;
46
46
workbenchRegistry . registerWorkbenchContribution ( RunAutomaticTasks , LifecyclePhase . Eventually ) ;
You can’t perform that action at this time.
0 commit comments