Skip to content

Commit

Permalink
Pick up latest TS for building VS Code
Browse files Browse the repository at this point in the history
Also adds fixes for microsoft/TypeScript#48468
  • Loading branch information
mjbvz committed Mar 29, 2022
1 parent 55e005e commit 46abb2b
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/vs/base/parts/ipc/common/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,7 @@ export namespace ProxyChannel {
properties?: Map<string, unknown>;
}

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

return new Proxy({}, {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/browser/config/editorConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ class EditorOptionsUtil {
if (Array.isArray(a) || Array.isArray(b)) {
return (Array.isArray(a) && Array.isArray(b) ? arrays.equals(a, b) : false);
}
if (Object.keys(a).length !== Object.keys(b).length) {
if (Object.keys(a as unknown as object).length !== Object.keys(b as unknown as object).length) {
return false;
}
for (const key in a) {
Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/browser/services/webWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ILanguageConfigurationService } from 'vs/editor/common/languages/langua
* Create a new web worker that has model syncing capabilities built in.
* Specify an AMD module to load that will `create` an object that will be proxied.
*/
export function createWebWorker<T>(modelService: IModelService, languageConfigurationService: ILanguageConfigurationService, opts: IWebWorkerOptions): MonacoWebWorker<T> {
export function createWebWorker<T extends object>(modelService: IModelService, languageConfigurationService: ILanguageConfigurationService, opts: IWebWorkerOptions): MonacoWebWorker<T> {
return new MonacoWebWorkerImpl<T>(modelService, languageConfigurationService, opts);
}

Expand Down Expand Up @@ -61,7 +61,7 @@ export interface IWebWorkerOptions {
keepIdleModels?: boolean;
}

class MonacoWebWorkerImpl<T> extends EditorWorkerClient implements MonacoWebWorker<T> {
class MonacoWebWorkerImpl<T extends object> extends EditorWorkerClient implements MonacoWebWorker<T> {

private readonly _foreignModuleId: string;
private readonly _foreignModuleHost: { [method: string]: Function } | null;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/standalone/browser/standaloneEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export function onDidChangeModelLanguage(listener: (e: { readonly model: ITextMo
* Create a new web worker that has model syncing capabilities built in.
* Specify an AMD module to load that will `create` an object that will be proxied.
*/
export function createWebWorker<T>(opts: IWebWorkerOptions): MonacoWebWorker<T> {
export function createWebWorker<T extends object>(opts: IWebWorkerOptions): MonacoWebWorker<T> {
return actualCreateWebWorker<T>(StandaloneServices.get(IModelService), StandaloneServices.get(ILanguageConfigurationService), opts);
}

Expand Down
2 changes: 1 addition & 1 deletion src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ declare namespace monaco.editor {
* Create a new web worker that has model syncing capabilities built in.
* Specify an AMD module to load that will `create` an object that will be proxied.
*/
export function createWebWorker<T>(opts: IWebWorkerOptions): MonacoWebWorker<T>;
export function createWebWorker<T extends object>(opts: IWebWorkerOptions): MonacoWebWorker<T>;

/**
* Colorize the contents of `domNode` using attribute `data-lang`.
Expand Down
6 changes: 3 additions & 3 deletions src/vs/platform/ipc/electron-sandbox/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createDecorator, ServiceIdentifier } from 'vs/platform/instantiation/co
type ChannelClientCtor<T> = { new(channel: IChannel): T };
type Remote = { getChannel(channelName: string): IChannel };

abstract class RemoteServiceStub<T> {
abstract class RemoteServiceStub<T extends object> {
constructor(
channelName: string,
options: IRemoteServiceWithChannelClientOptions<T> | IRemoteServiceWithProxyOptions | undefined,
Expand Down Expand Up @@ -55,7 +55,7 @@ export interface IMainProcessService {
registerChannel(channelName: string, channel: IServerChannel<string>): void;
}

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

class SharedProcessRemoteServiceStub<T> extends RemoteServiceStub<T> {
class SharedProcessRemoteServiceStub<T extends object> extends RemoteServiceStub<T> {
constructor(channelName: string, options: IRemoteServiceWithChannelClientOptions<T> | IRemoteServiceWithProxyOptions | undefined, @ISharedProcessService ipcService: ISharedProcessService) {
super(channelName, options, ipcService);
}
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/api/common/extHostExtensionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
}

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

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

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

Expand Down Expand Up @@ -897,7 +897,7 @@ export interface IExtHostExtensionService extends AbstractExtHostExtensionServic
getRemoteConnectionData(): IRemoteConnectionData | null;
}

export class Extension<T> implements vscode.Extension<T> {
export class Extension<T extends object | null | undefined> implements vscode.Extension<T> {

#extensionService: IExtHostExtensionService;
#originExtensionId: ExtensionIdentifier;
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/worker/extHostExtensionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class ExtHostExtensionService extends AbstractExtHostExtensionService {
return extensionDescription.browser;
}

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

0 comments on commit 46abb2b

Please sign in to comment.