API feedback (#162704)

* align bundle and uri value to be undefined together
* Document everything
This commit is contained in:
Tyler James Leonhardt
2022-10-04 17:27:23 -07:00
committed by GitHub
parent d19445483e
commit d942736bf1
3 changed files with 43 additions and 7 deletions

View File

@@ -2199,7 +2199,7 @@ export interface ExtHostTestingShape {
export interface ExtHostLocalizationShape {
getMessage(extensionId: string, details: IStringDetails): string;
getBundle(extensionId: string): { [key: string]: string };
getBundle(extensionId: string): { [key: string]: string } | undefined;
getBundleUri(extensionId: string): URI | undefined;
initializeLocalizedMessages(extension: IExtensionDescription): Promise<void>;
}

View File

@@ -49,8 +49,8 @@ export class ExtHostLocalizationService implements ExtHostLocalizationShape {
return format(str ?? key, ...(args ?? []));
}
getBundle(extensionId: string): { [key: string]: string } {
return this.bundleCache.get(extensionId)?.contents ?? {};
getBundle(extensionId: string): { [key: string]: string } | undefined {
return this.bundleCache.get(extensionId)?.contents;
}
getBundleUri(extensionId: string): URI | undefined {