Skip to content

Commit d459a78

Browse files
jamalcgopherbot
authored andcommitted
src/goExplorer.ts: show go explorer on extension activation
Fixes #2202. Change-Id: I330092739089031848cf9f17a6b031590b9d61c3 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/401614 Run-TryBot: Jamal Carvalho <[email protected]> Reviewed-by: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Jamal Carvalho <[email protected]> Auto-Submit: Jamal Carvalho <[email protected]>
1 parent 8b84a39 commit d459a78

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2742,7 +2742,8 @@
27422742
{
27432743
"id": "go.explorer",
27442744
"name": "go",
2745-
"icon": "media/go-logo-white.svg"
2745+
"icon": "media/go-logo-white.svg",
2746+
"when": "go.showExplorer"
27462747
}
27472748
],
27482749
"test": [

src/goExplorer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ export class GoExplorerProvider implements vscode.TreeDataProvider<vscode.TreeIt
2626
const provider = new this();
2727
const {
2828
window: { registerTreeDataProvider },
29-
commands: { registerCommand }
29+
commands: { registerCommand, executeCommand }
3030
} = vscode;
3131
subscriptions.push(registerTreeDataProvider('go.explorer', provider));
3232
subscriptions.push(registerCommand('go.explorer.refresh', () => provider.update(true)));
3333
subscriptions.push(registerCommand('go.explorer.open', (item) => provider.open(item)));
3434
subscriptions.push(registerCommand('go.workspace.editEnv', (item) => provider.editEnv(item)));
3535
subscriptions.push(registerCommand('go.workspace.resetEnv', (item) => provider.resetEnv(item)));
36+
executeCommand('setContext', 'go.showExplorer', true);
3637
return provider;
3738
}
3839

0 commit comments

Comments
 (0)