mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
Also make getEditorActions return an iterable instead of an array (#163320)
This lets us avoid an extra `.slice(0)` when returning the actions
This commit is contained in:
@@ -487,7 +487,7 @@ export namespace EditorExtensionsRegistry {
|
||||
return EditorContributionRegistry.INSTANCE.getEditorCommand(commandId);
|
||||
}
|
||||
|
||||
export function getEditorActions(): EditorAction[] {
|
||||
export function getEditorActions(): Iterable<EditorAction> {
|
||||
return EditorContributionRegistry.INSTANCE.getEditorActions();
|
||||
}
|
||||
|
||||
@@ -546,8 +546,8 @@ class EditorContributionRegistry {
|
||||
this.editorActions.push(action);
|
||||
}
|
||||
|
||||
public getEditorActions(): EditorAction[] {
|
||||
return this.editorActions.slice(0);
|
||||
public getEditorActions(): Iterable<EditorAction> {
|
||||
return this.editorActions;
|
||||
}
|
||||
|
||||
public registerEditorCommand(editorCommand: EditorCommand) {
|
||||
|
||||
Reference in New Issue
Block a user