diff --git a/changelog.d/148.internal.md b/changelog.d/148.internal.md new file mode 100644 index 00000000..cb3beda5 --- /dev/null +++ b/changelog.d/148.internal.md @@ -0,0 +1 @@ +Change link attributions from plugin or cli source to vscode source for notifications from mirrord. \ No newline at end of file diff --git a/src/api.ts b/src/api.ts index 4b9f7ada..443b93c3 100644 --- a/src/api.ts +++ b/src/api.ts @@ -83,6 +83,13 @@ interface IdeMessage { actions: Set } +/** + * Replaces the "plugin" platform query parameter in the given link with "vscode" + */ +function changeQueryParam(link: string): string { + return link.replace("utm_medium=cli", "utm_medium=vscode").replace("utm_medium=plugin", "utm_medium=vscode") +} + /** * Handles the mirrord -> IDE messages that come in json format. * @@ -96,7 +103,7 @@ function handleIdeMessage(message: IdeMessage) { switch (action.kind) { case "Link": { notificationBuilder.withGenericAction(action.label, async () => { - vscode.env.openExternal(vscode.Uri.parse(action.link)); + vscode.env.openExternal(vscode.Uri.parse(changeQueryParam(action.link))); }); break; }