mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
Add test for #107739
This commit is contained in:
@@ -149,7 +149,7 @@ export abstract class Command {
|
||||
*
|
||||
* @return `true` if the command was successfully run. This stops other overrides from being executed.
|
||||
*/
|
||||
export type CommandImplementation = (accessor: ServicesAccessor, args: unknown) => boolean;
|
||||
export type CommandImplementation = (accessor: ServicesAccessor, args: unknown) => boolean | Promise<void>;
|
||||
|
||||
export class MultiCommand extends Command {
|
||||
|
||||
@@ -175,8 +175,12 @@ export class MultiCommand extends Command {
|
||||
|
||||
public runCommand(accessor: ServicesAccessor, args: any): void | Promise<void> {
|
||||
for (const impl of this._implementations) {
|
||||
if (impl[1](accessor, args)) {
|
||||
return;
|
||||
const result = impl[1](accessor, args);
|
||||
if (result) {
|
||||
if (typeof result === 'boolean') {
|
||||
return;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user