提交 fbeadf8c 编写于 作者: A Alex Ross

Fallback to first remote task info when no folder is open

Previous behavior was to fallback to local. It makes more sense to fallback to the the first remote details instead
Related to https://github.com/microsoft/vscode-docker/issues/2350
上级 34c563a2
......@@ -1586,11 +1586,14 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
this.contextService, this.environmentService,
AbstractTaskService.OutputChannelId, this.fileService, this.terminalInstanceService,
this.pathService, this.viewDescriptorService, this.logService,
(workspaceFolder: IWorkspaceFolder) => {
if (!workspaceFolder) {
(workspaceFolder: IWorkspaceFolder | undefined) => {
if (workspaceFolder) {
return this._taskSystemInfos.get(workspaceFolder.uri.scheme);
} else if (this._taskSystemInfos.size > 0) {
return this._taskSystemInfos.values().next().value;
} else {
return undefined;
}
return this._taskSystemInfos.get(workspaceFolder.uri.scheme);
}
);
}
......
......@@ -635,7 +635,7 @@ export class TerminalTaskSystem implements ITaskSystem {
const folders = this.contextService.getWorkspace().folders;
workspaceFolder = folders.length > 0 ? folders[0] : undefined;
}
const systemInfo: TaskSystemInfo | undefined = this.currentTask.systemInfo = workspaceFolder ? this.taskSystemInfoResolver(workspaceFolder) : undefined;
const systemInfo: TaskSystemInfo | undefined = this.currentTask.systemInfo = this.taskSystemInfoResolver(workspaceFolder);
let variables = new Set<string>();
this.collectTaskVariables(variables, task);
......
......@@ -125,7 +125,7 @@ export interface TaskSystemInfo {
}
export interface TaskSystemInfoResolver {
(workspaceFolder: IWorkspaceFolder): TaskSystemInfo | undefined;
(workspaceFolder: IWorkspaceFolder | undefined): TaskSystemInfo | undefined;
}
export interface ITaskSystem {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册