Skip to content

Commit 0de8d51

Browse files
committed
Finalize task detail API
Fixes #69785
1 parent 0eb11e8 commit 0de8d51

File tree

10 files changed

+15
-18
lines changed

10 files changed

+15
-18
lines changed

extensions/npm/src/npmView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { JSONVisitor, visit } from 'jsonc-parser';
77
import * as path from 'path';
88
import {
99
commands, Event, EventEmitter, ExtensionContext,
10-
Selection, Task2 as Task,
10+
Selection, Task,
1111
TaskGroup, tasks, TextDocument, ThemeIcon, TreeDataProvider, TreeItem, TreeItemCollapsibleState, Uri,
1212
window, workspace, WorkspaceFolder
1313
} from 'vscode';

extensions/npm/src/tasks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import {
7-
TaskDefinition, Task2 as Task, TaskGroup, WorkspaceFolder, RelativePattern, ShellExecution, Uri, workspace,
7+
TaskDefinition, Task, TaskGroup, WorkspaceFolder, RelativePattern, ShellExecution, Uri, workspace,
88
DebugConfiguration, debug, TaskProvider, TextDocument, tasks, TaskScope, QuickPickItem
99
} from 'vscode';
1010
import * as path from 'path';

extensions/typescript-language-features/src/task/taskProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class TscTaskProvider implements vscode.TaskProvider {
203203
}
204204

205205
private getBuildTask(workspaceFolder: vscode.WorkspaceFolder | undefined, label: string, command: string, args: string[], buildTaskidentifier: TypeScriptTaskDefinition): vscode.Task {
206-
const buildTask = new vscode.Task2(
206+
const buildTask = new vscode.Task(
207207
buildTaskidentifier,
208208
workspaceFolder || vscode.TaskScope.Workspace,
209209
localize('buildTscLabel', 'build - {0}', label),

extensions/vscode-api-tests/src/singlefolder-tests/workspace.tasks.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as assert from 'assert';
7-
import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomExecution, Pseudoterminal, TaskScope, commands, Task2, env, UIKind, ShellExecution, TaskExecution, Terminal, Event } from 'vscode';
7+
import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomExecution, Pseudoterminal, TaskScope, commands, env, UIKind, ShellExecution, TaskExecution, Terminal, Event } from 'vscode';
88

99
// Disable tasks tests:
1010
// - Web https://github.com/microsoft/vscode/issues/90528
@@ -94,7 +94,7 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx
9494
};
9595
return Promise.resolve(pty);
9696
});
97-
const task = new Task2(kind, TaskScope.Workspace, taskName, taskType, execution);
97+
const task = new Task(kind, TaskScope.Workspace, taskName, taskType, execution);
9898
result.push(task);
9999
return result;
100100
},
@@ -151,7 +151,7 @@ import { window, tasks, Disposable, TaskDefinition, Task, EventEmitter, CustomEx
151151
};
152152
return Promise.resolve(pty);
153153
});
154-
const task = new Task2(kind, TaskScope.Workspace, taskName, taskType, execution);
154+
const task = new Task(kind, TaskScope.Workspace, taskName, taskType, execution);
155155
result.push(task);
156156
return result;
157157
},

src/vs/vscode.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6205,6 +6205,11 @@ declare module 'vscode' {
62056205
*/
62066206
name: string;
62076207

6208+
/**
6209+
* A detail to show for the task on a second line in places where the task's name is displayed.
6210+
*/
6211+
detail?: string;
6212+
62086213
/**
62096214
* The task's execution engine
62106215
*/

src/vs/vscode.proposed.d.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -963,13 +963,6 @@ declare module 'vscode' {
963963
}
964964
//#endregion
965965

966-
/**
967-
* A task to execute
968-
*/
969-
export class Task2 extends Task {
970-
detail?: string;
971-
}
972-
973966
//#region Task presentation group: https://github.com/microsoft/vscode/issues/47265
974967
export interface TaskPresentationOptions {
975968
/**

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
10981098
SymbolKind: extHostTypes.SymbolKind,
10991099
SymbolTag: extHostTypes.SymbolTag,
11001100
Task: extHostTypes.Task,
1101-
Task2: extHostTypes.Task,
11021101
TaskGroup: extHostTypes.TaskGroup,
11031102
TaskPanelKind: extHostTypes.TaskPanelKind,
11041103
TaskRevealKind: extHostTypes.TaskRevealKind,

src/vs/workbench/api/common/extHostTask.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ export namespace TaskDTO {
269269
presentationOptions: TaskPresentationOptionsDTO.from(value.presentationOptions),
270270
problemMatchers: value.problemMatchers,
271271
hasDefinedMatchers: (value as types.Task).hasDefinedMatchers,
272-
runOptions: (<vscode.Task>value).runOptions ? (<vscode.Task>value).runOptions : { reevaluateOnRerun: true },
273-
detail: (<vscode.Task2>value).detail
272+
runOptions: value.runOptions ? value.runOptions : { reevaluateOnRerun: true },
273+
detail: value.detail
274274
};
275275
return result;
276276
}

src/vs/workbench/api/common/extHostTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1875,7 +1875,7 @@ export class CustomExecution implements vscode.CustomExecution {
18751875
}
18761876

18771877
@es5ClassCompat
1878-
export class Task implements vscode.Task2 {
1878+
export class Task implements vscode.Task {
18791879

18801880
private static ExtensionCallbackType: string = 'customExecution';
18811881
private static ProcessType: string = 'process';

src/vs/workbench/api/node/extHostTask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class ExtHostTask extends ExtHostTaskBase {
9999
// The ID is calculated on the main thread task side, so, let's call into it here.
100100
// We need the task id's pre-computed for custom task executions because when OnDidStartTask
101101
// is invoked, we have to be able to map it back to our data.
102-
taskIdPromises.push(this.addCustomExecution(taskDTO, <vscode.Task2>task, true));
102+
taskIdPromises.push(this.addCustomExecution(taskDTO, task, true));
103103
}
104104
}
105105
}

0 commit comments

Comments
 (0)