Skip to content

Commit

Permalink
Task definition should always be defined
Browse files Browse the repository at this point in the history
- according to https://github.com/microsoft/vscode/blob/1.35.1/src/vs/workbench/api/common/extHostTypes.ts#L1876 the task definition should never be `undefined`. This change adjusts the Task class in Theia to align with VS Code.

Signed-off-by: elaihau <[email protected]>
  • Loading branch information
elaihau authored and elaihau committed Jun 25, 2019
1 parent 4941fd2 commit 9b4a532
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/plugin-ext/src/plugin/types-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ export enum TaskScope {
}

export class Task {
private taskDefinition: theia.TaskDefinition | undefined;
private taskDefinition: theia.TaskDefinition;
private taskScope: theia.TaskScope.Global | theia.TaskScope.Workspace | theia.WorkspaceFolder | undefined;
private taskName: string;
private taskExecution: ProcessExecution | ShellExecution | undefined;
Expand Down Expand Up @@ -1616,11 +1616,11 @@ export class Task {
this.isTaskBackground = false;
}

get definition(): theia.TaskDefinition | undefined {
get definition(): theia.TaskDefinition {
return this.taskDefinition;
}

set definition(value: theia.TaskDefinition | undefined) {
set definition(value: theia.TaskDefinition) {
if (value === undefined || value === null) {
throw illegalArgument('Kind can\'t be undefined or null');
}
Expand Down

0 comments on commit 9b4a532

Please sign in to comment.