Skip to content

Commit e49bbc8

Browse files
authored
Merge pull request #599 from badsyntax/hide-container-view
Only show view container if extension is activated. Fixes #542
2 parents 04e4510 + cd8b804 commit e49bbc8

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

extension/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,23 @@
5959
"gradleContainerView": [
6060
{
6161
"id": "gradleTasksView",
62-
"name": "Gradle Tasks"
62+
"name": "Gradle Tasks",
63+
"when": "gradle:activated"
6364
},
6465
{
6566
"id": "pinnedTasksView",
66-
"name": "Pinned Tasks"
67+
"name": "Pinned Tasks",
68+
"when": "gradle:activated"
6769
},
6870
{
6971
"id": "recentTasksView",
70-
"name": "Recent Tasks"
72+
"name": "Recent Tasks",
73+
"when": "gradle:activated"
7174
},
7275
{
7376
"id": "gradleDaemonsView",
74-
"name": "Gradle Daemons"
77+
"name": "Gradle Daemons",
78+
"when": "gradle:activated"
7579
}
7680
]
7781
},

extension/src/extension/Extension.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export class Extension {
143143
);
144144
this.api = new Api(this.client, this.gradleTasksTreeDataProvider);
145145

146+
this.activate();
146147
this.storeSubscriptions();
147148
this.registerCommands();
148149
this.handleTaskEvents();
@@ -172,6 +173,12 @@ export class Extension {
172173
);
173174
}
174175

176+
private activate(): void {
177+
// Used for showing the view container in the activity bar
178+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
179+
vscode.commands.executeCommand('setContext', 'gradle:activated', true);
180+
}
181+
175182
private registerCommands(): void {
176183
registerCommands(this.context);
177184
}

0 commit comments

Comments
 (0)