From b26a03153f1fdeb03cc682aa47e0559d0ab67d3f Mon Sep 17 00:00:00 2001 From: meowjesty <43983236+meowjesty@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:17:31 -0300 Subject: [PATCH] Do not sort targets from `mirrord ls`, they already come in a neat order. (#150) * Dont sort targets here. * changelog * missing semicolon --- changelog.d/147.changed.md | 1 + src/api.ts | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) 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 diff --git a/src/api.ts b/src/api.ts index 17d1c98a..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"); } /** @@ -350,7 +350,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']; @@ -361,7 +361,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); @@ -589,4 +588,4 @@ function tickDiscordCounter() { .withDisableAction('promptDiscord') .info(); } -} \ No newline at end of file +}