From 6a6227bc3e665837616bb736058eb9ef55f2df76 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Wed, 21 Sep 2022 14:24:45 -0400 Subject: [PATCH] Use any for the args since we will stringify whatever is passed in (#161421) * Use any for the args since we will stringify whatever is passed in * args should also be optional --- src/vs/workbench/api/common/extHost.api.impl.ts | 4 ++-- src/vs/workbench/api/common/extHost.protocol.ts | 2 +- src/vscode-dts/vscode.proposed.localization.d.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index bc36be915ff..413b1ff5505 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -1171,12 +1171,12 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I // namespace: l10n const l10n: typeof vscode.l10n = { - t(...params: [message: string, ...args: string[]] | [{ message: string; args: string[]; comment: string[] }]): string { + t(...params: [message: string, ...args: any[]] | [{ message: string; args?: any[]; comment: string[] }]): string { checkProposedApiEnabled(extension, 'localization'); if (typeof params[0] === 'string') { const key = params.shift() as string; - return extHostLocalization.getMessage(extension.identifier.value, { message: key, args: params as string[] }); + return extHostLocalization.getMessage(extension.identifier.value, { message: key, args: params as any[] | undefined }); } return extHostLocalization.getMessage(extension.identifier.value, params[0]); diff --git a/src/vs/workbench/api/common/extHost.protocol.ts b/src/vs/workbench/api/common/extHost.protocol.ts index 4d64d0b672f..5e21c84cd15 100644 --- a/src/vs/workbench/api/common/extHost.protocol.ts +++ b/src/vs/workbench/api/common/extHost.protocol.ts @@ -2206,7 +2206,7 @@ export interface ExtHostLocalizationShape { export interface IStringDetails { message: string; - args?: string[]; + args?: any[]; comment?: string[]; } diff --git a/src/vscode-dts/vscode.proposed.localization.d.ts b/src/vscode-dts/vscode.proposed.localization.d.ts index 538dc68d108..e57d4477b74 100644 --- a/src/vscode-dts/vscode.proposed.localization.d.ts +++ b/src/vscode-dts/vscode.proposed.localization.d.ts @@ -8,11 +8,11 @@ declare module 'vscode' { /** * A string that can be pulled out of a localization bundle if it exists. */ - export function t(message: string, ...args: string[]): string; + export function t(message: string, ...args: any[]): string; /** * A string that can be pulled out of a localization bundle if it exists. */ - export function t(options: { message: string; args: string[]; comment: string[] }): string; + export function t(options: { message: string; args?: any[]; comment: string[] }): string; /** * The bundle of localized strings that have been loaded for the extension. */