Skip to content

Commit ed82493

Browse files
plugin: align provideTasks
The commit updates the `provideTasks` (ext side) to omit the cancellation token which is not present in vscode, and instead pass it when directly calling the method from the task provider adpater. Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
1 parent 907a9c2 commit ed82493

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/plugin-ext/src/common/plugin-api-rpc.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ export const MAIN_RPC_CONTEXT = {
17731773
};
17741774

17751775
export interface TasksExt {
1776-
$provideTasks(handle: number, token?: CancellationToken): Promise<TaskDto[] | undefined>;
1776+
$provideTasks(handle: number): Promise<TaskDto[] | undefined>;
17771777
$resolveTask(handle: number, task: TaskDto, token?: CancellationToken): Promise<TaskDto | undefined>;
17781778
$onDidStartTask(execution: TaskExecutionDto, terminalId: number): void;
17791779
$onDidEndTask(id: number): void;

packages/plugin-ext/src/plugin/tasks/tasks.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { TaskProviderAdapter } from './task-provider';
2929
import { Emitter, Event } from '@theia/core/lib/common/event';
3030
import { TerminalServiceExtImpl } from '../terminal-ext';
3131
import { UUID } from '@theia/core/shared/@phosphor/coreutils';
32+
import { CancellationToken } from '@theia/core/lib/common/cancellation';
3233

3334
type ExecutionCallback = (resolvedDefinition: theia.TaskDefinition) => Thenable<theia.Pseudoterminal>;
3435
export class TasksExtImpl implements TasksExt {
@@ -164,10 +165,10 @@ export class TasksExtImpl implements TasksExt {
164165
throw new Error('Task was not successfully transformed into a task config');
165166
}
166167

167-
$provideTasks(handle: number, token: theia.CancellationToken): Promise<TaskDto[] | undefined> {
168+
$provideTasks(handle: number): Promise<TaskDto[] | undefined> {
168169
const adapter = this.adaptersMap.get(handle);
169170
if (adapter) {
170-
return adapter.provideTasks(token).then(tasks => {
171+
return adapter.provideTasks(CancellationToken.None).then(tasks => {
171172
if (tasks) {
172173
for (const task of tasks) {
173174
if (task.taskType === 'customExecution') {

0 commit comments

Comments
 (0)