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

@@ -78,7 +78,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
});
}
executeCommand<T>(id: string, ...args: any[]): Thenable<T> {
executeCommand<T>(id: string, ...args: any[]): Promise<T> {
this._logService.trace('ExtHostCommands#executeCommand', id);
if (this._commands.has(id)) {
@@ -108,7 +108,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
}
}
private _executeContributedCommand<T>(id: string, args: any[]): Thenable<T> {
private _executeContributedCommand<T>(id: string, args: any[]): Promise<T> {
let { callback, thisArg, description } = this._commands.get(id);
if (description) {
for (let i = 0; i < description.args.length; i++) {
@@ -129,7 +129,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
}
}
$executeContributedCommand<T>(id: string, ...args: any[]): Thenable<T> {
$executeContributedCommand<T>(id: string, ...args: any[]): Promise<T> {
this._logService.trace('ExtHostCommands#$executeContributedCommand', id);
if (!this._commands.has(id)) {
@@ -140,7 +140,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
}
}
getCommands(filterUnderscoreCommands: boolean = false): Thenable<string[]> {
getCommands(filterUnderscoreCommands: boolean = false): Promise<string[]> {
this._logService.trace('ExtHostCommands#getCommands', filterUnderscoreCommands);
return this._proxy.$getCommands().then(result => {
@@ -151,7 +151,7 @@ export class ExtHostCommands implements ExtHostCommandsShape {
});
}
$getContributedCommandHandlerDescriptions(): Thenable<{ [id: string]: string | ICommandHandlerDescription }> {
$getContributedCommandHandlerDescriptions(): Promise<{ [id: string]: string | ICommandHandlerDescription }> {
const result: { [id: string]: string | ICommandHandlerDescription } = Object.create(null);
this._commands.forEach((command, id) => {
let { description } = command;
@@ -226,7 +226,7 @@ export class CommandsConverter {
}
}
private _executeConvertedCommand<R>(...args: any[]): Thenable<R> {
private _executeConvertedCommand<R>(...args: any[]): Promise<R> {
const actualCmd = this._heap.get<vscode.Command>(args[0]);
return this._commands.executeCommand(actualCmd.command, ...actualCmd.arguments);
}