From 1faa41c69580fdb3b4493513f728d0e6904e2cf9 Mon Sep 17 00:00:00 2001 From: meowjesty Date: Thu, 5 Sep 2024 14:50:15 -0300 Subject: [PATCH 1/3] Dont sort targets here. --- src/api.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/api.ts b/src/api.ts index 007eb408..4b9f7ada 100644 --- a/src/api.ts +++ b/src/api.ts @@ -343,7 +343,7 @@ export class MirrordAPI { /** * Uses `mirrord ls` to get a list of all targets. - * Targets are sorted, with an exception of the last used target being the first on the list. + * Targets come sorted, with an exception of the last used target being the first on the list. */ async listTargets(configPath: string | null | undefined): Promise { const args = ['ls']; @@ -354,7 +354,6 @@ export class MirrordAPI { const stdout = await this.exec(args, {}); const targets: string[] = JSON.parse(stdout); - targets.sort(); let lastTarget: string | undefined = globalContext.workspaceState.get(LAST_TARGET_KEY) || globalContext.globalState.get(LAST_TARGET_KEY); @@ -582,4 +581,4 @@ function tickDiscordCounter() { .withDisableAction('promptDiscord') .info(); } -} \ No newline at end of file +} From 5dcf4bc5e1ed7eaf95df11618dd5a03bf4a31485 Mon Sep 17 00:00:00 2001 From: meowjesty Date: Fri, 6 Sep 2024 12:04:03 -0300 Subject: [PATCH 2/3] changelog --- changelog.d/147.changed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/147.changed.md diff --git a/changelog.d/147.changed.md b/changelog.d/147.changed.md new file mode 100644 index 00000000..7a834ca3 --- /dev/null +++ b/changelog.d/147.changed.md @@ -0,0 +1 @@ +Do not sort targets when showing them to the user, they come pre-sorted from mirrord ls. \ No newline at end of file From f7ac73d039ac9b485e901bc53346e092a79c98c6 Mon Sep 17 00:00:00 2001 From: meowjesty Date: Fri, 6 Sep 2024 12:06:03 -0300 Subject: [PATCH 3/3] missing semicolon --- src/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api.ts b/src/api.ts index 443b93c3..727ab603 100644 --- a/src/api.ts +++ b/src/api.ts @@ -87,7 +87,7 @@ interface IdeMessage { * 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") + return link.replace("utm_medium=cli", "utm_medium=vscode").replace("utm_medium=plugin", "utm_medium=vscode"); } /**