Skip to content

Commit

Permalink
Added action that navigates to extension docs (#162)
Browse files Browse the repository at this point in the history
* Added redirect action

* Changelog entry

* my english bad
  • Loading branch information
Razz4780 authored Jan 8, 2025
1 parent 8ceb6e8 commit 7269323
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/161.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added dropdown menu action that redirects to extension docs.
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
"command": "mirrord.help",
"category": "mirrord",
"title": "Show mirrord walkthrough"
},
{
"command": "mirrord.documentation",
"category": "mirrord",
"title": "Open mirrord documentation"
}
],
"configuration": {
Expand Down Expand Up @@ -178,6 +183,10 @@
{
"command": "mirrord.help",
"when": "true"
},
{
"command": "mirrord.documentation",
"when": "true"
}
]
},
Expand Down
9 changes: 8 additions & 1 deletion src/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class MirrordStatus {
static readonly mirrordForTeamsCommandId = 'mirrord.mirrordForTeams';
static readonly selectActiveConfigId = 'mirrord.selectActiveConfig';
static readonly helpCommandId = 'mirrord.help';
static readonly documentationCommandId = 'mirrord.documentation';

constructor(statusBar: vscode.StatusBarItem) {
this.statusBar = statusBar;
Expand Down Expand Up @@ -49,6 +50,7 @@ export class MirrordStatus {
if (!getOperatorUsed()) {
statusBar.tooltip.appendMarkdown(`\n\n[mirrord for Teams](command:${MirrordStatus.mirrordForTeamsCommandId})`);
}
statusBar.tooltip.appendMarkdown(`\n\n[Documentation](command:${MirrordStatus.documentationCommandId})`);
statusBar.tooltip.appendMarkdown(`\n\n[Get help on Discord](command:${MirrordStatus.joinDiscordCommandId})`);
statusBar.tooltip.appendMarkdown(`\n\n[Walkthrough](command:${MirrordStatus.helpCommandId})`);

Expand All @@ -71,6 +73,7 @@ export class MirrordStatus {
globalContext.subscriptions.push(vscode.commands.registerCommand(MirrordStatus.helpCommandId, async () => {
vscode.commands.executeCommand(`workbench.action.openWalkthrough`, `MetalBear.mirrord#mirrord.welcome`, false);
}));
globalContext.subscriptions.push(vscode.commands.registerCommand(MirrordStatus.documentationCommandId, this.documentation.bind(this)));

globalContext.subscriptions.push(this.statusBar);

Expand Down Expand Up @@ -103,6 +106,10 @@ export class MirrordStatus {
}

mirrordForTeams() {
vscode.env.openExternal(vscode.Uri.parse('https://app.metalbear.co/'));
vscode.env.openExternal(vscode.Uri.parse('https://app.metalbear.co/?utm_medium=vscode&utm_source=ui_action'));
}

documentation() {
vscode.env.openExternal(vscode.Uri.parse('https://mirrord.dev/docs/using-mirrord/vscode-extension/?utm_medium=vscode&utm_source=ui_action'));
}
}

0 comments on commit 7269323

Please sign in to comment.