From 90bf20d9d8b5481129f1243034248c558ae40745 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 17 Sep 2025 15:02:27 -0700 Subject: [PATCH] Remove Thenable --- src/browser/tsconfig.json | 3 +-- src/vs/base/common/async.ts | 2 +- src/vs/typings/thenable.d.ts | 12 ------------ 3 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 src/vs/typings/thenable.d.ts diff --git a/src/browser/tsconfig.json b/src/browser/tsconfig.json index 38854e26..d8f3a189 100644 --- a/src/browser/tsconfig.json +++ b/src/browser/tsconfig.json @@ -7,8 +7,7 @@ ], "outDir": "../../out", "types": [ - "../../node_modules/@types/mocha", - "../vs/typings/thenable.d.ts" + "../../node_modules/@types/mocha" ], "baseUrl": "..", "paths": { diff --git a/src/vs/base/common/async.ts b/src/vs/base/common/async.ts index 20f15f32..c0b2669f 100644 --- a/src/vs/base/common/async.ts +++ b/src/vs/base/common/async.ts @@ -124,7 +124,7 @@ export function raceTimeout(promise: Promise, timeout: number, onTimeout?: ]); } -export function asPromise(callback: () => T | Thenable): Promise { +export function asPromise(callback: () => T | PromiseLike): Promise { return new Promise((resolve, reject) => { const item = callback(); if (isThenable(item)) { diff --git a/src/vs/typings/thenable.d.ts b/src/vs/typings/thenable.d.ts deleted file mode 100644 index 73373ead..00000000 --- a/src/vs/typings/thenable.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -/** - * Thenable is a common denominator between ES6 promises, Q, jquery.Deferred, WinJS.Promise, - * and others. This API makes no assumption about what promise library is being used which - * enables reusing existing code without migrating to a specific promise implementation. Still, - * we recommend the use of native promises which are available in VS Code. - */ -interface Thenable extends PromiseLike { }