Skip to content

Commit 46abb2b

Browse files
committed
Pick up latest TS for building VS Code
Also adds fixes for microsoft/TypeScript#48468
1 parent 55e005e commit 46abb2b

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

src/vs/base/parts/ipc/common/ipc.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ export namespace ProxyChannel {
11091109
properties?: Map<string, unknown>;
11101110
}
11111111

1112-
export function toService<T>(channel: IChannel, options?: ICreateProxyServiceOptions): T {
1112+
export function toService<T extends object>(channel: IChannel, options?: ICreateProxyServiceOptions): T {
11131113
const disableMarshalling = options && options.disableMarshalling;
11141114

11151115
return new Proxy({}, {

src/vs/editor/browser/config/editorConfiguration.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ class EditorOptionsUtil {
291291
if (Array.isArray(a) || Array.isArray(b)) {
292292
return (Array.isArray(a) && Array.isArray(b) ? arrays.equals(a, b) : false);
293293
}
294-
if (Object.keys(a).length !== Object.keys(b).length) {
294+
if (Object.keys(a as unknown as object).length !== Object.keys(b as unknown as object).length) {
295295
return false;
296296
}
297297
for (const key in a) {

src/vs/editor/browser/services/webWorker.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ILanguageConfigurationService } from 'vs/editor/common/languages/langua
1313
* Create a new web worker that has model syncing capabilities built in.
1414
* Specify an AMD module to load that will `create` an object that will be proxied.
1515
*/
16-
export function createWebWorker<T>(modelService: IModelService, languageConfigurationService: ILanguageConfigurationService, opts: IWebWorkerOptions): MonacoWebWorker<T> {
16+
export function createWebWorker<T extends object>(modelService: IModelService, languageConfigurationService: ILanguageConfigurationService, opts: IWebWorkerOptions): MonacoWebWorker<T> {
1717
return new MonacoWebWorkerImpl<T>(modelService, languageConfigurationService, opts);
1818
}
1919

@@ -61,7 +61,7 @@ export interface IWebWorkerOptions {
6161
keepIdleModels?: boolean;
6262
}
6363

64-
class MonacoWebWorkerImpl<T> extends EditorWorkerClient implements MonacoWebWorker<T> {
64+
class MonacoWebWorkerImpl<T extends object> extends EditorWorkerClient implements MonacoWebWorker<T> {
6565

6666
private readonly _foreignModuleId: string;
6767
private readonly _foreignModuleHost: { [method: string]: Function } | null;

src/vs/editor/standalone/browser/standaloneEditor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export function onDidChangeModelLanguage(listener: (e: { readonly model: ITextMo
178178
* Create a new web worker that has model syncing capabilities built in.
179179
* Specify an AMD module to load that will `create` an object that will be proxied.
180180
*/
181-
export function createWebWorker<T>(opts: IWebWorkerOptions): MonacoWebWorker<T> {
181+
export function createWebWorker<T extends object>(opts: IWebWorkerOptions): MonacoWebWorker<T> {
182182
return actualCreateWebWorker<T>(StandaloneServices.get(IModelService), StandaloneServices.get(ILanguageConfigurationService), opts);
183183
}
184184

src/vs/monaco.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ declare namespace monaco.editor {
973973
* Create a new web worker that has model syncing capabilities built in.
974974
* Specify an AMD module to load that will `create` an object that will be proxied.
975975
*/
976-
export function createWebWorker<T>(opts: IWebWorkerOptions): MonacoWebWorker<T>;
976+
export function createWebWorker<T extends object>(opts: IWebWorkerOptions): MonacoWebWorker<T>;
977977

978978
/**
979979
* Colorize the contents of `domNode` using attribute `data-lang`.

src/vs/platform/ipc/electron-sandbox/services.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/co
1111
type ChannelClientCtor<T> = { new(channel: IChannel): T };
1212
type Remote = { getChannel(channelName: string): IChannel };
1313

14-
abstract class RemoteServiceStub<T> {
14+
abstract class RemoteServiceStub<T extends object> {
1515
constructor(
1616
channelName: string,
1717
options: IRemoteServiceWithChannelClientOptions<T> | IRemoteServiceWithProxyOptions | undefined,
@@ -55,7 +55,7 @@ export interface IMainProcessService {
5555
registerChannel(channelName: string, channel: IServerChannel<string>): void;
5656
}
5757

58-
class MainProcessRemoteServiceStub<T> extends RemoteServiceStub<T> {
58+
class MainProcessRemoteServiceStub<T extends object> extends RemoteServiceStub<T> {
5959
constructor(channelName: string, options: IRemoteServiceWithChannelClientOptions<T> | IRemoteServiceWithProxyOptions | undefined, @IMainProcessService ipcService: IMainProcessService) {
6060
super(channelName, options, ipcService);
6161
}
@@ -81,7 +81,7 @@ export interface ISharedProcessService {
8181
notifyRestored(): void;
8282
}
8383

84-
class SharedProcessRemoteServiceStub<T> extends RemoteServiceStub<T> {
84+
class SharedProcessRemoteServiceStub<T extends object> extends RemoteServiceStub<T> {
8585
constructor(channelName: string, options: IRemoteServiceWithChannelClientOptions<T> | IRemoteServiceWithProxyOptions | undefined, @ISharedProcessService ipcService: ISharedProcessService) {
8686
super(channelName, options, ipcService);
8787
}

src/vs/workbench/api/common/extHostExtensionService.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
611611
}
612612

613613
// Require the test runner via node require from the provided path
614-
const testRunner: ITestRunner | INewTestRunner | undefined = await this._loadCommonJSModule(null, extensionTestsLocationURI, new ExtensionActivationTimesBuilder(false));
614+
const testRunner = await this._loadCommonJSModule<ITestRunner | INewTestRunner | undefined>(null, extensionTestsLocationURI, new ExtensionActivationTimesBuilder(false));
615615

616616
if (!testRunner || typeof testRunner.run !== 'function') {
617617
throw new Error(nls.localize('extensionTestError', "Path {0} does not point to a valid extension test runner.", extensionTestsLocationURI.toString()));
@@ -848,7 +848,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
848848

849849
protected abstract _beforeAlmostReadyToRunExtensions(): Promise<void>;
850850
protected abstract _getEntryPoint(extensionDescription: IExtensionDescription): string | undefined;
851-
protected abstract _loadCommonJSModule<T>(extensionId: ExtensionIdentifier | null, module: URI, activationTimesBuilder: ExtensionActivationTimesBuilder): Promise<T>;
851+
protected abstract _loadCommonJSModule<T extends object | undefined>(extensionId: ExtensionIdentifier | null, module: URI, activationTimesBuilder: ExtensionActivationTimesBuilder): Promise<T>;
852852
public abstract $setRemoteEnvironment(env: { [key: string]: string | null }): Promise<void>;
853853
}
854854

@@ -897,7 +897,7 @@ export interface IExtHostExtensionService extends AbstractExtHostExtensionServic
897897
getRemoteConnectionData(): IRemoteConnectionData | null;
898898
}
899899

900-
export class Extension<T> implements vscode.Extension<T> {
900+
export class Extension<T extends object | null | undefined> implements vscode.Extension<T> {
901901

902902
#extensionService: IExtHostExtensionService;
903903
#originExtensionId: ExtensionIdentifier;

src/vs/workbench/api/worker/extHostExtensionService.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService {
5555
return extensionDescription.browser;
5656
}
5757

58-
protected async _loadCommonJSModule<T>(extensionId: ExtensionIdentifier | null, module: URI, activationTimesBuilder: ExtensionActivationTimesBuilder): Promise<T> {
58+
protected async _loadCommonJSModule<T extends object | undefined>(extensionId: ExtensionIdentifier | null, module: URI, activationTimesBuilder: ExtensionActivationTimesBuilder): Promise<T> {
5959
module = module.with({ path: ensureSuffix(module.path, '.js') });
6060
if (extensionId) {
6161
performance.mark(`code/extHost/willFetchExtensionCode/${extensionId.value}`);

0 commit comments

Comments
 (0)