mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Fix TS 2.3.1 Compiler Errors in VSCode src/workbench (#25249)
TS 2.3.1 introduced a breaking change by [switching to covariant types for callbacks](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#covariance-in-callback-parameters). This change tries to fix these compiler errors in the workbench codebase
This commit is contained in:
@@ -457,7 +457,7 @@ class RenameAdapter {
|
||||
rejectReason: err
|
||||
};
|
||||
}
|
||||
return TPromise.wrapError(err);
|
||||
return TPromise.wrapError<modes.WorkspaceEdit>(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -716,7 +716,7 @@ export class ExtHostLanguageFeatures extends ExtHostLanguageFeaturesShape {
|
||||
private _withAdapter<A, R>(handle: number, ctor: { new (...args: any[]): A }, callback: (adapter: A) => TPromise<R>): TPromise<R> {
|
||||
let adapter = this._adapter.get(handle);
|
||||
if (!(adapter instanceof ctor)) {
|
||||
return TPromise.wrapError(new Error('no adapter found'));
|
||||
return TPromise.wrapError<R>(new Error('no adapter found'));
|
||||
}
|
||||
return callback(<any>adapter);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user