mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 21:11:38 +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:
@@ -513,7 +513,7 @@ export class ExtHostTextEditor implements vscode.TextEditor {
|
||||
private _runOnProxy(callback: () => TPromise<any>, silent: boolean): TPromise<ExtHostTextEditor> {
|
||||
if (this._disposed) {
|
||||
if (!silent) {
|
||||
return TPromise.wrapError(silent);
|
||||
return TPromise.wrapError<ExtHostTextEditor>(silent);
|
||||
} else {
|
||||
console.warn('TextEditor is closed/disposed');
|
||||
return TPromise.as(undefined);
|
||||
@@ -521,7 +521,7 @@ export class ExtHostTextEditor implements vscode.TextEditor {
|
||||
}
|
||||
return callback().then(() => this, err => {
|
||||
if (!silent) {
|
||||
return TPromise.wrapError(silent);
|
||||
return TPromise.wrapError<ExtHostTextEditor>(silent);
|
||||
}
|
||||
console.warn(err);
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user