Skip to content

Commit

Permalink
Merge branch 'main' of github.com:metalbear-co/mirrord-vscode into is…
Browse files Browse the repository at this point in the history
…sue/147/sort-targets
  • Loading branch information
meowjesty committed Sep 6, 2024
2 parents 1faa41c + 1edfec2 commit a7f3514
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/148.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change link attributions from plugin or cli source to vscode source for notifications from mirrord.
9 changes: 8 additions & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ interface IdeMessage {
actions: Set<IdeAction>
}

/**
* 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")

Check warning on line 90 in src/api.ts

View workflow job for this annotation

GitHub Actions / lint

Missing semicolon
}

/**
* Handles the mirrord -> IDE messages that come in json format.
*
Expand All @@ -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;
}
Expand Down

0 comments on commit a7f3514

Please sign in to comment.