Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

chore(tasks): Align Task Service to upstream changes #1124

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.include
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ IMAGE_TAG="next"
THEIA_GITHUB_REPO="eclipse-theia/theia"
THEIA_VERSION="master"
THEIA_BRANCH="master"
THEIA_COMMIT_SHA="d734315e505ad4a7691a3f6f4a07d2209af0d9cf"
THEIA_COMMIT_SHA="9b9cc2ba4864a45edcb34b459485d8aa54268a5d"
THEIA_GIT_REFS="refs\\/heads\\/master"
THEIA_DOCKER_IMAGE_VERSION=

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ export class TaskConfigurationsService extends TaskService {
this.getOpenerOptions(resolvedTask)
);

let taskInfo: TaskInfo | undefined;
try {
const taskInfo = await this.taskServer.run(resolvedTask, this.getContext(), option);
taskInfo = await this.taskServer.run(resolvedTask, this.getContext(), option);
terminal.start(taskInfo.terminalId);

this.lastTask = { source, taskLabel, scope: resolvedTask._scope };
Expand All @@ -62,14 +63,14 @@ export class TaskConfigurationsService extends TaskService {
console.error(errorMessage, error);
this.messageService.error(errorMessage);

if (taskInfo && !this.isRemoteTask(taskInfo.config) && typeof taskInfo.terminalId === 'number') {
this.shellTerminalServer.onAttachAttempted(taskInfo.terminalId);
}
return undefined;
}
}

async attach(terminalId: number, taskId: number): Promise<void> {
const runningTasks = await this.getRunningTasks();

const taskInfo = runningTasks.find((t: TaskInfo) => t.taskId === taskId);
async attach(terminalId: number, taskInfo: TaskInfo): Promise<number | void> {
if (taskInfo) {
const kind = this.isRemoteTask(taskInfo.config) ? REMOTE_TASK_KIND : TASK_KIND;
const terminalWidget = this.terminalService.all.find(
Expand All @@ -87,7 +88,7 @@ export class TaskConfigurationsService extends TaskService {
this.getOpenerOptions(taskConfig)
);

widget.start(terminalId);
return widget.start(terminalId);
}

protected getFactoryOptions(config?: TaskConfiguration): TerminalWidgetFactoryOptions {
Expand Down