Skip to content

Commit

Permalink
Fix TS 4.1 errors for tasks and remote explorer
Browse files Browse the repository at this point in the history
Part of #106358
  • Loading branch information
alexr00 committed Sep 10, 2020
1 parent 226c417 commit 26803ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/vs/workbench/contrib/remote/browser/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,11 @@ class HelpItemValue {
const emptyString: Promise<string> = new Promise(resolve => setTimeout(() => resolve(''), 500));
this._url = await Promise.race([urlCommand, emptyString]);
}
} else {
this._url = '';
}
}
if (this._url === undefined) {
this._url = '';
}
resolve(this._url);
});
}
Expand Down
8 changes: 4 additions & 4 deletions src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class RunAutomaticTasks extends Disposable implements IWorkbenchContribut
}
}

private static runTasks(taskService: ITaskService, tasks: Array<Task | Promise<Task>>) {
private static runTasks(taskService: ITaskService, tasks: Array<Task | Promise<Task | undefined>>) {
tasks.forEach(task => {
if (task instanceof Promise) {
task.then(promiseResult => {
Expand All @@ -52,8 +52,8 @@ export class RunAutomaticTasks extends Disposable implements IWorkbenchContribut
});
}

private static findAutoTasks(taskService: ITaskService, workspaceTaskResult: Map<string, WorkspaceFolderTaskResult>): { tasks: Array<Task | Promise<Task>>, taskNames: Array<string> } {
const tasks = new Array<Task | Promise<Task>>();
private static findAutoTasks(taskService: ITaskService, workspaceTaskResult: Map<string, WorkspaceFolderTaskResult>): { tasks: Array<Task | Promise<Task | undefined>>, taskNames: Array<string> } {
const tasks = new Array<Task | Promise<Task | undefined>>();
const taskNames = new Array<string>();
if (workspaceTaskResult) {
workspaceTaskResult.forEach(resultElement => {
Expand All @@ -68,7 +68,7 @@ export class RunAutomaticTasks extends Disposable implements IWorkbenchContribut
if (resultElement.configurations) {
forEach(resultElement.configurations.byIdentifier, (configedTask) => {
if (configedTask.value.runOptions.runOn === RunOnOptions.folderOpen) {
tasks.push(new Promise<Task>(resolve => {
tasks.push(new Promise<Task | undefined>(resolve => {
taskService.getTask(resultElement.workspaceFolder, configedTask.value._id, true).then(task => resolve(task));
}));
if (configedTask.value._label) {
Expand Down

0 comments on commit 26803ce

Please sign in to comment.