Skip to content

Commit

Permalink
Expose gradleTaskProvider in API
Browse files Browse the repository at this point in the history
  • Loading branch information
badsyntax committed Oct 17, 2020
1 parent 8d44e02 commit 7902842
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions extension/src/Extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ export class Extension {
this.api = new Api(
this.client,
this.gradleTasksTreeDataProvider,
this.gradleTaskProvider,
this.icons
);

Expand Down
6 changes: 6 additions & 0 deletions extension/src/api/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { GradleTasksTreeDataProvider } from '../views';
import { GradleClient } from '../client';
import { Icons } from '../icons';
import { getRunBuildCancellationKey } from '../client/CancellationKeys';
import { GradleTaskProvider } from '../tasks';

export interface RunTaskOpts {
projectFolder: string;
Expand Down Expand Up @@ -41,6 +42,7 @@ export class Api {
constructor(
private readonly client: GradleClient,
private readonly tasksTreeDataProvider: GradleTasksTreeDataProvider,
private readonly gradleTaskProvider: GradleTaskProvider,
private readonly icons: Icons
) {}

Expand Down Expand Up @@ -107,6 +109,10 @@ export class Api {
return this.tasksTreeDataProvider;
}

public getTaskProvider(): GradleTaskProvider {
return this.gradleTaskProvider;
}

public getIcons(): Icons {
return this.icons;
}
Expand Down
2 changes: 0 additions & 2 deletions extension/src/tasks/GradleTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ export class GradleTaskProvider
}

public async loadTasks(): Promise<vscode.Task[]> {
// To accomodate calling loadTasks() on extension activate (when client is connected)
// and opening the treeview.
if (this.loadTasksPromise) {
return this.loadTasksPromise;
}
Expand Down

0 comments on commit 7902842

Please sign in to comment.