From 7269323e23fd733e3181409e7d3f381e11051dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Smolarek?= <34063647+Razz4780@users.noreply.github.com> Date: Wed, 8 Jan 2025 16:42:06 +0100 Subject: [PATCH] Added action that navigates to extension docs (#162) * Added redirect action * Changelog entry * my english bad --- changelog.d/161.added.md | 1 + package.json | 9 +++++++++ src/status.ts | 9 ++++++++- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 changelog.d/161.added.md diff --git a/changelog.d/161.added.md b/changelog.d/161.added.md new file mode 100644 index 00000000..1bea1223 --- /dev/null +++ b/changelog.d/161.added.md @@ -0,0 +1 @@ +Added dropdown menu action that redirects to extension docs. \ No newline at end of file diff --git a/package.json b/package.json index 10b0b921..ff12b488 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,11 @@ "command": "mirrord.help", "category": "mirrord", "title": "Show mirrord walkthrough" + }, + { + "command": "mirrord.documentation", + "category": "mirrord", + "title": "Open mirrord documentation" } ], "configuration": { @@ -178,6 +183,10 @@ { "command": "mirrord.help", "when": "true" + }, + { + "command": "mirrord.documentation", + "when": "true" } ] }, diff --git a/src/status.ts b/src/status.ts index 15bcc3bc..423cbd5b 100644 --- a/src/status.ts +++ b/src/status.ts @@ -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; @@ -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})`); @@ -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); @@ -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')); } }