Skip to content

Commit 5e3e2e8

Browse files
committed
Fix #591: Sort "editor commands" by their name for menu display
1 parent 10395d7 commit 5e3e2e8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: src/features/ExtensionCommands.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class ExtensionCommandsFeature implements IFeature {
156156

157157
private command: vscode.Disposable;
158158
private languageClient: LanguageClient;
159-
private extensionCommands = [];
159+
private extensionCommands: ExtensionCommand[] = [];
160160

161161
constructor() {
162162
this.command = vscode.commands.registerCommand('PowerShell.ShowAdditionalCommands', () => {
@@ -235,6 +235,10 @@ export class ExtensionCommandsFeature implements IFeature {
235235
name: command.name,
236236
displayName: command.displayName
237237
});
238+
239+
this.extensionCommands.sort(
240+
(a: ExtensionCommand, b: ExtensionCommand) =>
241+
a.name.localeCompare(b.name));
238242
}
239243

240244
private showExtensionCommands(client: LanguageClient) : Thenable<InvokeExtensionCommandRequestArguments> {
@@ -251,7 +255,7 @@ export class ExtensionCommandsFeature implements IFeature {
251255
this.extensionCommands.map<ExtensionCommandQuickPickItem>(command => {
252256
return {
253257
label: command.displayName,
254-
description: "",
258+
description: command.name,
255259
command: command
256260
}
257261
});

0 commit comments

Comments
 (0)