mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
Use I prefix for task interfaces (#151350)
This commit is contained in:
@@ -1111,14 +1111,14 @@ export interface MainThreadSearchShape extends IDisposable {
|
||||
}
|
||||
|
||||
export interface MainThreadTaskShape extends IDisposable {
|
||||
$createTaskId(task: tasks.TaskDTO): Promise<string>;
|
||||
$createTaskId(task: tasks.ITaskDTO): Promise<string>;
|
||||
$registerTaskProvider(handle: number, type: string): Promise<void>;
|
||||
$unregisterTaskProvider(handle: number): Promise<void>;
|
||||
$fetchTasks(filter?: tasks.TaskFilterDTO): Promise<tasks.TaskDTO[]>;
|
||||
$getTaskExecution(value: tasks.TaskHandleDTO | tasks.TaskDTO): Promise<tasks.TaskExecutionDTO>;
|
||||
$executeTask(task: tasks.TaskHandleDTO | tasks.TaskDTO): Promise<tasks.TaskExecutionDTO>;
|
||||
$fetchTasks(filter?: tasks.ITaskFilterDTO): Promise<tasks.ITaskDTO[]>;
|
||||
$getTaskExecution(value: tasks.ITaskHandleDTO | tasks.ITaskDTO): Promise<tasks.ITaskExecutionDTO>;
|
||||
$executeTask(task: tasks.ITaskHandleDTO | tasks.ITaskDTO): Promise<tasks.ITaskExecutionDTO>;
|
||||
$terminateTask(id: string): Promise<void>;
|
||||
$registerTaskSystem(scheme: string, info: tasks.TaskSystemInfoDTO): void;
|
||||
$registerTaskSystem(scheme: string, info: tasks.ITaskSystemInfoDTO): void;
|
||||
$customExecutionComplete(id: string, result?: number): Promise<void>;
|
||||
$registerSupportedExecutions(custom?: boolean, shell?: boolean, process?: boolean): Promise<void>;
|
||||
}
|
||||
@@ -1841,12 +1841,12 @@ export interface ExtHostSCMShape {
|
||||
}
|
||||
|
||||
export interface ExtHostTaskShape {
|
||||
$provideTasks(handle: number, validTypes: { [key: string]: boolean }): Promise<tasks.TaskSetDTO>;
|
||||
$resolveTask(handle: number, taskDTO: tasks.TaskDTO): Promise<tasks.TaskDTO | undefined>;
|
||||
$onDidStartTask(execution: tasks.TaskExecutionDTO, terminalId: number, resolvedDefinition: tasks.TaskDefinitionDTO): void;
|
||||
$onDidStartTaskProcess(value: tasks.TaskProcessStartedDTO): void;
|
||||
$onDidEndTaskProcess(value: tasks.TaskProcessEndedDTO): void;
|
||||
$OnDidEndTask(execution: tasks.TaskExecutionDTO): void;
|
||||
$provideTasks(handle: number, validTypes: { [key: string]: boolean }): Promise<tasks.ITaskSetDTO>;
|
||||
$resolveTask(handle: number, taskDTO: tasks.ITaskDTO): Promise<tasks.ITaskDTO | undefined>;
|
||||
$onDidStartTask(execution: tasks.ITaskExecutionDTO, terminalId: number, resolvedDefinition: tasks.ITaskDefinitionDTO): void;
|
||||
$onDidStartTaskProcess(value: tasks.ITaskProcessStartedDTO): void;
|
||||
$onDidEndTaskProcess(value: tasks.ITaskProcessEndedDTO): void;
|
||||
$OnDidEndTask(execution: tasks.ITaskExecutionDTO): void;
|
||||
$resolveVariables(workspaceFolder: UriComponents, toResolve: { process?: { name: string; cwd?: string }; variables: string[] }): Promise<{ process?: string; variables: { [key: string]: string } }>;
|
||||
$jsonTasksSupported(): Promise<boolean>;
|
||||
$findExecutable(command: string, cwd?: string, paths?: string[]): Promise<string | undefined>;
|
||||
|
||||
@@ -38,20 +38,20 @@ export interface IExtHostTask extends ExtHostTaskShape {
|
||||
onDidEndTaskProcess: Event<vscode.TaskProcessEndEvent>;
|
||||
|
||||
registerTaskProvider(extension: IExtensionDescription, type: string, provider: vscode.TaskProvider): vscode.Disposable;
|
||||
registerTaskSystem(scheme: string, info: tasks.TaskSystemInfoDTO): void;
|
||||
registerTaskSystem(scheme: string, info: tasks.ITaskSystemInfoDTO): void;
|
||||
fetchTasks(filter?: vscode.TaskFilter): Promise<vscode.Task[]>;
|
||||
executeTask(extension: IExtensionDescription, task: vscode.Task): Promise<vscode.TaskExecution>;
|
||||
terminateTask(execution: vscode.TaskExecution): Promise<void>;
|
||||
}
|
||||
|
||||
export namespace TaskDefinitionDTO {
|
||||
export function from(value: vscode.TaskDefinition): tasks.TaskDefinitionDTO | undefined {
|
||||
export function from(value: vscode.TaskDefinition): tasks.ITaskDefinitionDTO | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
export function to(value: tasks.TaskDefinitionDTO): vscode.TaskDefinition | undefined {
|
||||
export function to(value: tasks.ITaskDefinitionDTO): vscode.TaskDefinition | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -60,13 +60,13 @@ export namespace TaskDefinitionDTO {
|
||||
}
|
||||
|
||||
export namespace TaskPresentationOptionsDTO {
|
||||
export function from(value: vscode.TaskPresentationOptions): tasks.TaskPresentationOptionsDTO | undefined {
|
||||
export function from(value: vscode.TaskPresentationOptions): tasks.ITaskPresentationOptionsDTO | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
export function to(value: tasks.TaskPresentationOptionsDTO): vscode.TaskPresentationOptions | undefined {
|
||||
export function to(value: tasks.ITaskPresentationOptionsDTO): vscode.TaskPresentationOptions | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -75,13 +75,13 @@ export namespace TaskPresentationOptionsDTO {
|
||||
}
|
||||
|
||||
export namespace ProcessExecutionOptionsDTO {
|
||||
export function from(value: vscode.ProcessExecutionOptions): tasks.ProcessExecutionOptionsDTO | undefined {
|
||||
export function from(value: vscode.ProcessExecutionOptions): tasks.IProcessExecutionOptionsDTO | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
export function to(value: tasks.ProcessExecutionOptionsDTO): vscode.ProcessExecutionOptions | undefined {
|
||||
export function to(value: tasks.IProcessExecutionOptionsDTO): vscode.ProcessExecutionOptions | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -90,19 +90,19 @@ export namespace ProcessExecutionOptionsDTO {
|
||||
}
|
||||
|
||||
export namespace ProcessExecutionDTO {
|
||||
export function is(value: tasks.ShellExecutionDTO | tasks.ProcessExecutionDTO | tasks.CustomExecutionDTO | undefined): value is tasks.ProcessExecutionDTO {
|
||||
export function is(value: tasks.IShellExecutionDTO | tasks.IProcessExecutionDTO | tasks.ICustomExecutionDTO | undefined): value is tasks.IProcessExecutionDTO {
|
||||
if (value) {
|
||||
const candidate = value as tasks.ProcessExecutionDTO;
|
||||
const candidate = value as tasks.IProcessExecutionDTO;
|
||||
return candidate && !!candidate.process;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
export function from(value: vscode.ProcessExecution): tasks.ProcessExecutionDTO | undefined {
|
||||
export function from(value: vscode.ProcessExecution): tasks.IProcessExecutionDTO | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
const result: tasks.ProcessExecutionDTO = {
|
||||
const result: tasks.IProcessExecutionDTO = {
|
||||
process: value.process,
|
||||
args: value.args
|
||||
};
|
||||
@@ -111,7 +111,7 @@ export namespace ProcessExecutionDTO {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export function to(value: tasks.ProcessExecutionDTO): types.ProcessExecution | undefined {
|
||||
export function to(value: tasks.IProcessExecutionDTO): types.ProcessExecution | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -120,13 +120,13 @@ export namespace ProcessExecutionDTO {
|
||||
}
|
||||
|
||||
export namespace ShellExecutionOptionsDTO {
|
||||
export function from(value: vscode.ShellExecutionOptions): tasks.ShellExecutionOptionsDTO | undefined {
|
||||
export function from(value: vscode.ShellExecutionOptions): tasks.IShellExecutionOptionsDTO | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
export function to(value: tasks.ShellExecutionOptionsDTO): vscode.ShellExecutionOptions | undefined {
|
||||
export function to(value: tasks.IShellExecutionOptionsDTO): vscode.ShellExecutionOptions | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -135,19 +135,19 @@ export namespace ShellExecutionOptionsDTO {
|
||||
}
|
||||
|
||||
export namespace ShellExecutionDTO {
|
||||
export function is(value: tasks.ShellExecutionDTO | tasks.ProcessExecutionDTO | tasks.CustomExecutionDTO | undefined): value is tasks.ShellExecutionDTO {
|
||||
export function is(value: tasks.IShellExecutionDTO | tasks.IProcessExecutionDTO | tasks.ICustomExecutionDTO | undefined): value is tasks.IShellExecutionDTO {
|
||||
if (value) {
|
||||
const candidate = value as tasks.ShellExecutionDTO;
|
||||
const candidate = value as tasks.IShellExecutionDTO;
|
||||
return candidate && (!!candidate.commandLine || !!candidate.command);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
export function from(value: vscode.ShellExecution): tasks.ShellExecutionDTO | undefined {
|
||||
export function from(value: vscode.ShellExecution): tasks.IShellExecutionDTO | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
const result: tasks.ShellExecutionDTO = {
|
||||
const result: tasks.IShellExecutionDTO = {
|
||||
};
|
||||
if (value.commandLine !== undefined) {
|
||||
result.commandLine = value.commandLine;
|
||||
@@ -160,7 +160,7 @@ export namespace ShellExecutionDTO {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
export function to(value: tasks.ShellExecutionDTO): types.ShellExecution | undefined {
|
||||
export function to(value: tasks.IShellExecutionDTO): types.ShellExecution | undefined {
|
||||
if (value === undefined || value === null || (value.command === undefined && value.commandLine === undefined)) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -173,16 +173,16 @@ export namespace ShellExecutionDTO {
|
||||
}
|
||||
|
||||
export namespace CustomExecutionDTO {
|
||||
export function is(value: tasks.ShellExecutionDTO | tasks.ProcessExecutionDTO | tasks.CustomExecutionDTO | undefined): value is tasks.CustomExecutionDTO {
|
||||
export function is(value: tasks.IShellExecutionDTO | tasks.IProcessExecutionDTO | tasks.ICustomExecutionDTO | undefined): value is tasks.ICustomExecutionDTO {
|
||||
if (value) {
|
||||
let candidate = value as tasks.CustomExecutionDTO;
|
||||
let candidate = value as tasks.ICustomExecutionDTO;
|
||||
return candidate && candidate.customExecution === 'customExecution';
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export function from(value: vscode.CustomExecution): tasks.CustomExecutionDTO {
|
||||
export function from(value: vscode.CustomExecution): tasks.ICustomExecutionDTO {
|
||||
return {
|
||||
customExecution: 'customExecution'
|
||||
};
|
||||
@@ -195,7 +195,7 @@ export namespace CustomExecutionDTO {
|
||||
|
||||
|
||||
export namespace TaskHandleDTO {
|
||||
export function from(value: types.Task, workspaceService?: IExtHostWorkspace): tasks.TaskHandleDTO {
|
||||
export function from(value: types.Task, workspaceService?: IExtHostWorkspace): tasks.ITaskHandleDTO {
|
||||
let folder: UriComponents | string;
|
||||
if (value.scope !== undefined && typeof value.scope !== 'number') {
|
||||
folder = value.scope.uri;
|
||||
@@ -213,7 +213,7 @@ export namespace TaskHandleDTO {
|
||||
}
|
||||
}
|
||||
export namespace TaskGroupDTO {
|
||||
export function from(value: vscode.TaskGroup): tasks.TaskGroupDTO | undefined {
|
||||
export function from(value: vscode.TaskGroup): tasks.ITaskGroupDTO | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -222,11 +222,11 @@ export namespace TaskGroupDTO {
|
||||
}
|
||||
|
||||
export namespace TaskDTO {
|
||||
export function fromMany(tasks: vscode.Task[], extension: IExtensionDescription): tasks.TaskDTO[] {
|
||||
export function fromMany(tasks: vscode.Task[], extension: IExtensionDescription): tasks.ITaskDTO[] {
|
||||
if (tasks === undefined || tasks === null) {
|
||||
return [];
|
||||
}
|
||||
const result: tasks.TaskDTO[] = [];
|
||||
const result: tasks.ITaskDTO[] = [];
|
||||
for (let task of tasks) {
|
||||
const converted = from(task, extension);
|
||||
if (converted) {
|
||||
@@ -236,11 +236,11 @@ export namespace TaskDTO {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function from(value: vscode.Task, extension: IExtensionDescription): tasks.TaskDTO | undefined {
|
||||
export function from(value: vscode.Task, extension: IExtensionDescription): tasks.ITaskDTO | undefined {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
let execution: tasks.ShellExecutionDTO | tasks.ProcessExecutionDTO | tasks.CustomExecutionDTO | undefined;
|
||||
let execution: tasks.IShellExecutionDTO | tasks.IProcessExecutionDTO | tasks.ICustomExecutionDTO | undefined;
|
||||
if (value.execution instanceof types.ProcessExecution) {
|
||||
execution = ProcessExecutionDTO.from(value.execution);
|
||||
} else if (value.execution instanceof types.ShellExecution) {
|
||||
@@ -249,7 +249,7 @@ export namespace TaskDTO {
|
||||
execution = CustomExecutionDTO.from(<types.CustomExecution>value.execution);
|
||||
}
|
||||
|
||||
const definition: tasks.TaskDefinitionDTO | undefined = TaskDefinitionDTO.from(value.definition);
|
||||
const definition: tasks.ITaskDefinitionDTO | undefined = TaskDefinitionDTO.from(value.definition);
|
||||
let scope: number | UriComponents;
|
||||
if (value.scope) {
|
||||
if (typeof value.scope === 'number') {
|
||||
@@ -264,7 +264,7 @@ export namespace TaskDTO {
|
||||
if (!definition || !scope) {
|
||||
return undefined;
|
||||
}
|
||||
const result: tasks.TaskDTO = {
|
||||
const result: tasks.ITaskDTO = {
|
||||
_id: (value as types.Task)._id!,
|
||||
definition,
|
||||
name: value.name,
|
||||
@@ -284,7 +284,7 @@ export namespace TaskDTO {
|
||||
};
|
||||
return result;
|
||||
}
|
||||
export async function to(value: tasks.TaskDTO | undefined, workspace: IExtHostWorkspaceProvider, providedCustomExeutions: Map<string, types.CustomExecution>): Promise<types.Task | undefined> {
|
||||
export async function to(value: tasks.ITaskDTO | undefined, workspace: IExtHostWorkspaceProvider, providedCustomExeutions: Map<string, types.CustomExecution>): Promise<types.Task | undefined> {
|
||||
if (value === undefined || value === null) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -339,11 +339,11 @@ export namespace TaskDTO {
|
||||
}
|
||||
|
||||
export namespace TaskFilterDTO {
|
||||
export function from(value: vscode.TaskFilter | undefined): tasks.TaskFilterDTO | undefined {
|
||||
export function from(value: vscode.TaskFilter | undefined): tasks.ITaskFilterDTO | undefined {
|
||||
return value;
|
||||
}
|
||||
|
||||
export function to(value: tasks.TaskFilterDTO): vscode.TaskFilter | undefined {
|
||||
export function to(value: tasks.ITaskFilterDTO): vscode.TaskFilter | undefined {
|
||||
if (!value) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -367,15 +367,15 @@ class TaskExecutionImpl implements vscode.TaskExecution {
|
||||
this.#tasks.terminateTask(this);
|
||||
}
|
||||
|
||||
public fireDidStartProcess(value: tasks.TaskProcessStartedDTO): void {
|
||||
public fireDidStartProcess(value: tasks.ITaskProcessStartedDTO): void {
|
||||
}
|
||||
|
||||
public fireDidEndProcess(value: tasks.TaskProcessEndedDTO): void {
|
||||
public fireDidEndProcess(value: tasks.ITaskProcessEndedDTO): void {
|
||||
}
|
||||
}
|
||||
|
||||
export namespace TaskExecutionDTO {
|
||||
export function from(value: vscode.TaskExecution): tasks.TaskExecutionDTO {
|
||||
export function from(value: vscode.TaskExecution): tasks.ITaskExecutionDTO {
|
||||
return {
|
||||
id: (value as TaskExecutionImpl)._id,
|
||||
task: undefined
|
||||
@@ -453,7 +453,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
});
|
||||
}
|
||||
|
||||
public registerTaskSystem(scheme: string, info: tasks.TaskSystemInfoDTO): void {
|
||||
public registerTaskSystem(scheme: string, info: tasks.ITaskSystemInfoDTO): void {
|
||||
this._proxy.$registerTaskSystem(scheme, info);
|
||||
}
|
||||
|
||||
@@ -489,7 +489,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
return this._onDidExecuteTask.event;
|
||||
}
|
||||
|
||||
public async $onDidStartTask(execution: tasks.TaskExecutionDTO, terminalId: number, resolvedDefinition: tasks.TaskDefinitionDTO): Promise<void> {
|
||||
public async $onDidStartTask(execution: tasks.ITaskExecutionDTO, terminalId: number, resolvedDefinition: tasks.ITaskDefinitionDTO): Promise<void> {
|
||||
const customExecution: types.CustomExecution | undefined = this._providedCustomExecutions2.get(execution.id);
|
||||
if (customExecution) {
|
||||
// Clone the custom execution to keep the original untouched. This is important for multiple runs of the same task.
|
||||
@@ -507,7 +507,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
return this._onDidTerminateTask.event;
|
||||
}
|
||||
|
||||
public async $OnDidEndTask(execution: tasks.TaskExecutionDTO): Promise<void> {
|
||||
public async $OnDidEndTask(execution: tasks.ITaskExecutionDTO): Promise<void> {
|
||||
const _execution = await this.getTaskExecution(execution);
|
||||
this._taskExecutionPromises.delete(execution.id);
|
||||
this._taskExecutions.delete(execution.id);
|
||||
@@ -521,7 +521,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
return this._onDidTaskProcessStarted.event;
|
||||
}
|
||||
|
||||
public async $onDidStartTaskProcess(value: tasks.TaskProcessStartedDTO): Promise<void> {
|
||||
public async $onDidStartTaskProcess(value: tasks.ITaskProcessStartedDTO): Promise<void> {
|
||||
const execution = await this.getTaskExecution(value.id);
|
||||
this._onDidTaskProcessStarted.fire({
|
||||
execution: execution,
|
||||
@@ -533,7 +533,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
return this._onDidTaskProcessEnded.event;
|
||||
}
|
||||
|
||||
public async $onDidEndTaskProcess(value: tasks.TaskProcessEndedDTO): Promise<void> {
|
||||
public async $onDidEndTaskProcess(value: tasks.ITaskProcessEndedDTO): Promise<void> {
|
||||
const execution = await this.getTaskExecution(value.id);
|
||||
this._onDidTaskProcessEnded.fire({
|
||||
execution: execution,
|
||||
@@ -541,9 +541,9 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
});
|
||||
}
|
||||
|
||||
protected abstract provideTasksInternal(validTypes: { [key: string]: boolean }, taskIdPromises: Promise<void>[], handler: HandlerData, value: vscode.Task[] | null | undefined): { tasks: tasks.TaskDTO[]; extension: IExtensionDescription };
|
||||
protected abstract provideTasksInternal(validTypes: { [key: string]: boolean }, taskIdPromises: Promise<void>[], handler: HandlerData, value: vscode.Task[] | null | undefined): { tasks: tasks.ITaskDTO[]; extension: IExtensionDescription };
|
||||
|
||||
public $provideTasks(handle: number, validTypes: { [key: string]: boolean }): Promise<tasks.TaskSetDTO> {
|
||||
public $provideTasks(handle: number, validTypes: { [key: string]: boolean }): Promise<tasks.ITaskSetDTO> {
|
||||
const handler = this._handlers.get(handle);
|
||||
if (!handler) {
|
||||
return Promise.reject(new Error('no handler found'));
|
||||
@@ -571,9 +571,9 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
});
|
||||
}
|
||||
|
||||
protected abstract resolveTaskInternal(resolvedTaskDTO: tasks.TaskDTO): Promise<tasks.TaskDTO | undefined>;
|
||||
protected abstract resolveTaskInternal(resolvedTaskDTO: tasks.ITaskDTO): Promise<tasks.ITaskDTO | undefined>;
|
||||
|
||||
public async $resolveTask(handle: number, taskDTO: tasks.TaskDTO): Promise<tasks.TaskDTO | undefined> {
|
||||
public async $resolveTask(handle: number, taskDTO: tasks.ITaskDTO): Promise<tasks.ITaskDTO | undefined> {
|
||||
const handler = this._handlers.get(handle);
|
||||
if (!handler) {
|
||||
return Promise.reject(new Error('no handler found'));
|
||||
@@ -595,7 +595,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
|
||||
this.checkDeprecation(resolvedTask, handler);
|
||||
|
||||
const resolvedTaskDTO: tasks.TaskDTO | undefined = TaskDTO.from(resolvedTask, handler.extension);
|
||||
const resolvedTaskDTO: tasks.ITaskDTO | undefined = TaskDTO.from(resolvedTask, handler.extension);
|
||||
if (!resolvedTaskDTO) {
|
||||
throw new Error('Unexpected: Task cannot be resolved.');
|
||||
}
|
||||
@@ -617,7 +617,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
return this._handleCounter++;
|
||||
}
|
||||
|
||||
protected async addCustomExecution(taskDTO: tasks.TaskDTO, task: vscode.Task, isProvided: boolean): Promise<void> {
|
||||
protected async addCustomExecution(taskDTO: tasks.ITaskDTO, task: vscode.Task, isProvided: boolean): Promise<void> {
|
||||
const taskId = await this._proxy.$createTaskId(taskDTO);
|
||||
if (!isProvided && !this._providedCustomExecutions2.has(taskId)) {
|
||||
this._notProvidedCustomExecutions.add(taskId);
|
||||
@@ -627,7 +627,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
this._providedCustomExecutions2.set(taskId, <types.CustomExecution>task.execution);
|
||||
}
|
||||
|
||||
protected async getTaskExecution(execution: tasks.TaskExecutionDTO | string, task?: vscode.Task): Promise<TaskExecutionImpl> {
|
||||
protected async getTaskExecution(execution: tasks.ITaskExecutionDTO | string, task?: vscode.Task): Promise<TaskExecutionImpl> {
|
||||
if (typeof execution === 'string') {
|
||||
const taskExecution = this._taskExecutionPromises.get(execution);
|
||||
if (!taskExecution) {
|
||||
@@ -641,7 +641,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
return result;
|
||||
}
|
||||
const createdResult: Promise<TaskExecutionImpl> = new Promise((resolve, reject) => {
|
||||
function resolvePromiseWithCreatedTask(that: ExtHostTaskBase, execution: tasks.TaskExecutionDTO, taskToCreate: vscode.Task | types.Task | undefined) {
|
||||
function resolvePromiseWithCreatedTask(that: ExtHostTaskBase, execution: tasks.ITaskExecutionDTO, taskToCreate: vscode.Task | types.Task | undefined) {
|
||||
if (!taskToCreate) {
|
||||
reject('Unexpected: Task does not exist.');
|
||||
} else {
|
||||
@@ -673,7 +673,7 @@ export abstract class ExtHostTaskBase implements ExtHostTaskShape, IExtHostTask
|
||||
}
|
||||
}
|
||||
|
||||
private customExecutionComplete(execution: tasks.TaskExecutionDTO): void {
|
||||
private customExecutionComplete(execution: tasks.ITaskExecutionDTO): void {
|
||||
const extensionCallback2: vscode.CustomExecution | undefined = this._activeCustomExecutions2.get(execution.id);
|
||||
if (extensionCallback2) {
|
||||
this._activeCustomExecutions2.delete(execution.id);
|
||||
@@ -747,8 +747,8 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
|
||||
return execution;
|
||||
}
|
||||
|
||||
protected provideTasksInternal(validTypes: { [key: string]: boolean }, taskIdPromises: Promise<void>[], handler: HandlerData, value: vscode.Task[] | null | undefined): { tasks: tasks.TaskDTO[]; extension: IExtensionDescription } {
|
||||
const taskDTOs: tasks.TaskDTO[] = [];
|
||||
protected provideTasksInternal(validTypes: { [key: string]: boolean }, taskIdPromises: Promise<void>[], handler: HandlerData, value: vscode.Task[] | null | undefined): { tasks: tasks.ITaskDTO[]; extension: IExtensionDescription } {
|
||||
const taskDTOs: tasks.ITaskDTO[] = [];
|
||||
if (value) {
|
||||
for (let task of value) {
|
||||
this.checkDeprecation(task, handler);
|
||||
@@ -756,7 +756,7 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
|
||||
this._logService.warn(`The task [${task.source}, ${task.name}] uses an undefined task type. The task will be ignored in the future.`);
|
||||
}
|
||||
|
||||
const taskDTO: tasks.TaskDTO | undefined = TaskDTO.from(task, handler.extension);
|
||||
const taskDTO: tasks.ITaskDTO | undefined = TaskDTO.from(task, handler.extension);
|
||||
if (taskDTO && CustomExecutionDTO.is(taskDTO.execution)) {
|
||||
taskDTOs.push(taskDTO);
|
||||
// The ID is calculated on the main thread task side, so, let's call into it here.
|
||||
@@ -774,7 +774,7 @@ export class WorkerExtHostTask extends ExtHostTaskBase {
|
||||
};
|
||||
}
|
||||
|
||||
protected async resolveTaskInternal(resolvedTaskDTO: tasks.TaskDTO): Promise<tasks.TaskDTO | undefined> {
|
||||
protected async resolveTaskInternal(resolvedTaskDTO: tasks.ITaskDTO): Promise<tasks.ITaskDTO | undefined> {
|
||||
if (CustomExecutionDTO.is(resolvedTaskDTO.execution)) {
|
||||
return resolvedTaskDTO;
|
||||
} else {
|
||||
|
||||
@@ -7,12 +7,12 @@ import { UriComponents } from 'vs/base/common/uri';
|
||||
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import type { Dto } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
|
||||
export interface TaskDefinitionDTO {
|
||||
export interface ITaskDefinitionDTO {
|
||||
type: string;
|
||||
[name: string]: any;
|
||||
}
|
||||
|
||||
export interface TaskPresentationOptionsDTO {
|
||||
export interface ITaskPresentationOptionsDTO {
|
||||
reveal?: number;
|
||||
echo?: boolean;
|
||||
focus?: boolean;
|
||||
@@ -23,25 +23,25 @@ export interface TaskPresentationOptionsDTO {
|
||||
close?: boolean;
|
||||
}
|
||||
|
||||
export interface RunOptionsDTO {
|
||||
export interface IRunOptionsDTO {
|
||||
reevaluateOnRerun?: boolean;
|
||||
}
|
||||
|
||||
export interface ExecutionOptionsDTO {
|
||||
export interface IExecutionOptionsDTO {
|
||||
cwd?: string;
|
||||
env?: { [key: string]: string };
|
||||
}
|
||||
|
||||
export interface ProcessExecutionOptionsDTO extends ExecutionOptionsDTO {
|
||||
export interface IProcessExecutionOptionsDTO extends IExecutionOptionsDTO {
|
||||
}
|
||||
|
||||
export interface ProcessExecutionDTO {
|
||||
export interface IProcessExecutionDTO {
|
||||
process: string;
|
||||
args: string[];
|
||||
options?: ProcessExecutionOptionsDTO;
|
||||
options?: IProcessExecutionOptionsDTO;
|
||||
}
|
||||
|
||||
export interface ShellQuotingOptionsDTO {
|
||||
export interface IShellQuotingOptionsDTO {
|
||||
escape?: string | {
|
||||
escapeChar: string;
|
||||
charsToEscape: string;
|
||||
@@ -50,86 +50,86 @@ export interface ShellQuotingOptionsDTO {
|
||||
weak?: string;
|
||||
}
|
||||
|
||||
export interface ShellExecutionOptionsDTO extends ExecutionOptionsDTO {
|
||||
export interface IShellExecutionOptionsDTO extends IExecutionOptionsDTO {
|
||||
executable?: string;
|
||||
shellArgs?: string[];
|
||||
shellQuoting?: ShellQuotingOptionsDTO;
|
||||
shellQuoting?: IShellQuotingOptionsDTO;
|
||||
}
|
||||
|
||||
export interface ShellQuotedStringDTO {
|
||||
export interface IShellQuotedStringDTO {
|
||||
value: string;
|
||||
quoting: number;
|
||||
}
|
||||
|
||||
export interface ShellExecutionDTO {
|
||||
export interface IShellExecutionDTO {
|
||||
commandLine?: string;
|
||||
command?: string | ShellQuotedStringDTO;
|
||||
args?: Array<string | ShellQuotedStringDTO>;
|
||||
options?: ShellExecutionOptionsDTO;
|
||||
command?: string | IShellQuotedStringDTO;
|
||||
args?: Array<string | IShellQuotedStringDTO>;
|
||||
options?: IShellExecutionOptionsDTO;
|
||||
}
|
||||
|
||||
export interface CustomExecutionDTO {
|
||||
export interface ICustomExecutionDTO {
|
||||
customExecution: 'customExecution';
|
||||
}
|
||||
|
||||
export interface TaskSourceDTO {
|
||||
export interface ITaskSourceDTO {
|
||||
label: string;
|
||||
extensionId?: string;
|
||||
scope?: number | UriComponents;
|
||||
}
|
||||
|
||||
export interface TaskHandleDTO {
|
||||
export interface ITaskHandleDTO {
|
||||
id: string;
|
||||
workspaceFolder: UriComponents | string;
|
||||
}
|
||||
|
||||
export interface TaskGroupDTO {
|
||||
export interface ITaskGroupDTO {
|
||||
isDefault?: boolean;
|
||||
_id: string;
|
||||
}
|
||||
|
||||
export interface TaskDTO {
|
||||
export interface ITaskDTO {
|
||||
_id: string;
|
||||
name?: string;
|
||||
execution: ProcessExecutionDTO | ShellExecutionDTO | CustomExecutionDTO | undefined;
|
||||
definition: TaskDefinitionDTO;
|
||||
execution: IProcessExecutionDTO | IShellExecutionDTO | ICustomExecutionDTO | undefined;
|
||||
definition: ITaskDefinitionDTO;
|
||||
isBackground?: boolean;
|
||||
source: TaskSourceDTO;
|
||||
group?: TaskGroupDTO;
|
||||
source: ITaskSourceDTO;
|
||||
group?: ITaskGroupDTO;
|
||||
detail?: string;
|
||||
presentationOptions?: TaskPresentationOptionsDTO;
|
||||
presentationOptions?: ITaskPresentationOptionsDTO;
|
||||
problemMatchers: string[];
|
||||
hasDefinedMatchers: boolean;
|
||||
runOptions?: RunOptionsDTO;
|
||||
runOptions?: IRunOptionsDTO;
|
||||
}
|
||||
|
||||
export interface TaskSetDTO {
|
||||
tasks: TaskDTO[];
|
||||
export interface ITaskSetDTO {
|
||||
tasks: ITaskDTO[];
|
||||
extension: Dto<IExtensionDescription>;
|
||||
}
|
||||
|
||||
export interface TaskExecutionDTO {
|
||||
export interface ITaskExecutionDTO {
|
||||
id: string;
|
||||
task: TaskDTO | undefined;
|
||||
task: ITaskDTO | undefined;
|
||||
}
|
||||
|
||||
export interface TaskProcessStartedDTO {
|
||||
export interface ITaskProcessStartedDTO {
|
||||
id: string;
|
||||
processId: number;
|
||||
}
|
||||
|
||||
export interface TaskProcessEndedDTO {
|
||||
export interface ITaskProcessEndedDTO {
|
||||
id: string;
|
||||
exitCode: number | undefined;
|
||||
}
|
||||
|
||||
|
||||
export interface TaskFilterDTO {
|
||||
export interface ITaskFilterDTO {
|
||||
version?: string;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface TaskSystemInfoDTO {
|
||||
export interface ITaskSystemInfoDTO {
|
||||
scheme: string;
|
||||
authority: string;
|
||||
platform: string;
|
||||
|
||||
Reference in New Issue
Block a user