Skip to content

Commit 26803ce

Browse files
committed
Fix TS 4.1 errors for tasks and remote explorer
Part of #106358
1 parent 226c417 commit 26803ce

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/vs/workbench/contrib/remote/browser/remote.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,11 @@ class HelpItemValue {
286286
const emptyString: Promise<string> = new Promise(resolve => setTimeout(() => resolve(''), 500));
287287
this._url = await Promise.race([urlCommand, emptyString]);
288288
}
289-
} else {
290-
this._url = '';
291289
}
292290
}
291+
if (this._url === undefined) {
292+
this._url = '';
293+
}
293294
resolve(this._url);
294295
});
295296
}

src/vs/workbench/contrib/tasks/browser/runAutomaticTasks.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class RunAutomaticTasks extends Disposable implements IWorkbenchContribut
3838
}
3939
}
4040

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

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

0 commit comments

Comments
 (0)