mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 22:41:31 +01:00
Fix VSCode/Extensions for TS 2.3.1 (#25248)
From: https://github.com/Microsoft/TypeScript/issues/15352 TS 2.3.1 introduced a breaking change around checking of generic types. This change tries to fix these compiler errors in the extensions codebase
This commit is contained in:
@@ -20,7 +20,7 @@ export class Askpass implements Disposable {
|
||||
|
||||
try {
|
||||
this.server.listen(0);
|
||||
this.portPromise = new Promise(c => this.server.on('listening', () => c(this.server.address().port)));
|
||||
this.portPromise = new Promise<number>(c => this.server.on('listening', () => c(this.server.address().port)));
|
||||
this.server.on('error', err => console.error(err));
|
||||
} catch (err) {
|
||||
this.enabled = false;
|
||||
|
||||
@@ -533,7 +533,7 @@ export class CommandCenter {
|
||||
}
|
||||
|
||||
private async smartCommit(
|
||||
getCommitMessage: () => Promise<string>,
|
||||
getCommitMessage: () => Promise<string | undefined>,
|
||||
opts?: CommitOptions
|
||||
): Promise<boolean> {
|
||||
if (!opts) {
|
||||
|
||||
@@ -68,7 +68,7 @@ export function once<T>(event: Event<T>): Event<T> {
|
||||
}
|
||||
|
||||
export function eventToPromise<T>(event: Event<T>): Promise<T> {
|
||||
return new Promise(c => once(event)(c));
|
||||
return new Promise<T>(c => once(event)(c));
|
||||
}
|
||||
|
||||
// TODO@Joao: replace with Object.assign
|
||||
@@ -104,11 +104,11 @@ export function groupBy<T>(arr: T[], fn: (el: T) => string): { [key: string]: T[
|
||||
}
|
||||
|
||||
export function denodeify<R>(fn: Function): (...args) => Promise<R> {
|
||||
return (...args) => new Promise((c, e) => fn(...args, (err, r) => err ? e(err) : c(r)));
|
||||
return (...args) => new Promise<R>((c, e) => fn(...args, (err, r) => err ? e(err) : c(r)));
|
||||
}
|
||||
|
||||
export function nfcall<R>(fn: Function, ...args): Promise<R> {
|
||||
return new Promise((c, e) => fn(...args, (err, r) => err ? e(err) : c(r)));
|
||||
return new Promise<R>((c, e) => fn(...args, (err, r) => err ? e(err) : c(r)));
|
||||
}
|
||||
|
||||
export async function mkdirp(path: string, mode?: number): Promise<boolean> {
|
||||
|
||||
Reference in New Issue
Block a user