debt - Thenable -> Promise

This commit is contained in:
Johannes Rieken
2018-12-13 11:30:26 +01:00
parent 29dd4e77de
commit 653280d133
411 changed files with 2370 additions and 2366 deletions

View File

@@ -32,7 +32,7 @@ export class MainThreadCommands implements MainThreadCommandsShape {
this._generateCommandsDocumentationRegistration.dispose();
}
private _generateCommandsDocumentation(): Thenable<void> {
private _generateCommandsDocumentation(): Promise<void> {
return this._proxy.$getContributedCommandHandlerDescriptions().then(result => {
// add local commands
const commands = CommandsRegistry.getCommands();
@@ -70,14 +70,14 @@ export class MainThreadCommands implements MainThreadCommandsShape {
}
}
$executeCommand<T>(id: string, args: any[]): Thenable<T> {
$executeCommand<T>(id: string, args: any[]): Promise<T> {
for (let i = 0; i < args.length; i++) {
args[i] = revive(args[i], 0);
}
return this._commandService.executeCommand<T>(id, ...args);
}
$getCommands(): Thenable<string[]> {
$getCommands(): Promise<string[]> {
return Promise.resolve(Object.keys(CommandsRegistry.getCommands()));
}
}