Change where task execution context is set

This commit is contained in:
Alex Ross 2020-07-20 13:11:33 +02:00
parent 4d21831e50
commit 2d7ae4a7d9
4 changed files with 12 additions and 12 deletions

View file

@ -613,6 +613,9 @@ export class MainThreadTask implements MainThreadTaskShape {
public $registerTaskSystem(key: string, info: TaskSystemInfoDTO): void {
let platform: Platform.Platform;
switch (info.platform) {
case 'Web':
platform = Platform.Platform.Web;
break;
case 'win32':
platform = Platform.Platform.Windows;
break;

View file

@ -696,13 +696,11 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
@IExtHostApiDeprecationService deprecationService: IExtHostApiDeprecationService
) {
super(extHostRpc, initData, workspaceService, editorService, configurationService, extHostTerminalService, logService, deprecationService);
if (initData.remote.isRemote && initData.remote.authority) {
this.registerTaskSystem(Schemas.vscodeRemote, {
scheme: Schemas.vscodeRemote,
authority: initData.remote.authority,
platform: Platform.PlatformToString(Platform.Platform.Web)
});
}
this.registerTaskSystem(Schemas.vscodeRemote, {
scheme: Schemas.vscodeRemote,
authority: '',
platform: Platform.PlatformToString(Platform.Platform.Web)
});
}
public async executeTask(extension: IExtensionDescription, task: vscode.Task): Promise<vscode.TaskExecution> {

View file

@ -334,7 +334,7 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
this.setExecutionContexts();
}
protected setExecutionContexts(custom: boolean = true, shell: boolean = false, process: boolean = false): void {
protected setExecutionContexts(custom: boolean = true, shell: boolean = true, process: boolean = true): void {
const customContext = CustomExecutionSupportedContext.bindTo(this.contextKeyService);
customContext.set(custom);
const shellContext = ShellExecutionSupportedContext.bindTo(this.contextKeyService);
@ -530,6 +530,9 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
}
public registerTaskSystem(key: string, info: TaskSystemInfo): void {
if (info.platform === Platform.Platform.Web) {
this.setExecutionContexts(true, false, false);
}
this._taskSystemInfos.set(key, info);
}

View file

@ -25,10 +25,6 @@ interface WorkspaceFolderConfigurationResult {
export class TaskService extends AbstractTaskService {
private _configHasErrors: boolean = false;
protected setExecutionContexts(): void {
super.setExecutionContexts(true, true, true);
}
protected getTaskSystem(): ITaskSystem {
if (this._taskSystem) {
return this._taskSystem;