@codingame/monaco-vscode-api 18.2.0 → 18.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extensions.js +5 -1
- package/l10n.d.ts +4 -2
- package/l10n.js +8 -3
- package/missing-services.js +4526 -4884
- package/package.json +8 -8
- package/services.d.ts +206 -0
- package/services.js +209 -5
- package/vscode/src/vs/platform/product/common/product.js +1 -1
package/extensions.js
CHANGED
|
@@ -19,7 +19,7 @@ import '@codingame/monaco-vscode-extensions-service-override';
|
|
|
19
19
|
import { registerExtensionFile, RegisteredUriFile, CustomSchemas } from '@codingame/monaco-vscode-files-service-override';
|
|
20
20
|
import { waitServicesReady } from './lifecycle.js';
|
|
21
21
|
import { throttle } from './tools.js';
|
|
22
|
-
import { getBuiltInExtensionTranslationsUris } from './l10n.js';
|
|
22
|
+
import { getBuiltInExtensionTranslationsUris, getLocalizationManifest } from './l10n.js';
|
|
23
23
|
|
|
24
24
|
let apiFactory;
|
|
25
25
|
function registerLocalApiFactory(_apiFactory) {
|
|
@@ -150,5 +150,9 @@ function registerExtension(manifest, extHostKind, { path = '/extension', system
|
|
|
150
150
|
}
|
|
151
151
|
return api;
|
|
152
152
|
}
|
|
153
|
+
const localizationManifest = getLocalizationManifest();
|
|
154
|
+
if (localizationManifest != null) {
|
|
155
|
+
registerExtension(localizationManifest, ExtensionHostKind.LocalWebWorker, { system: true });
|
|
156
|
+
}
|
|
153
157
|
|
|
154
158
|
export { ExtensionHostKind, getExtensionManifests, getForcedExtensionHostKind, registerDefaultApiHandler, registerExtension, registerLocalApiFactory, registerRemoteExtension };
|
package/l10n.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IExtensionManifest } from "./extensions.js";
|
|
1
2
|
declare function setAvailableLocales(locales: Set<string>): void;
|
|
2
3
|
declare function isLocaleAvailable(locale: string): boolean;
|
|
3
4
|
declare global {
|
|
@@ -12,7 +13,8 @@ declare global {
|
|
|
12
13
|
*/
|
|
13
14
|
var _VSCODE_NLS_LANGUAGE: string | undefined;
|
|
14
15
|
}
|
|
15
|
-
declare function registerLocalization(
|
|
16
|
+
declare function registerLocalization(manifest: IExtensionManifest, language: string, main: string[], extensionTranslationsUris: Record<string, string>): void;
|
|
16
17
|
declare function getBuiltInExtensionTranslationsUris(language: string): Record<string, string> | undefined;
|
|
17
18
|
declare function getExtensionIdProvidingCurrentLocale(): string | undefined;
|
|
18
|
-
|
|
19
|
+
declare function getLocalizationManifest(): IExtensionManifest | undefined;
|
|
20
|
+
export { registerLocalization, getBuiltInExtensionTranslationsUris, getExtensionIdProvidingCurrentLocale, getLocalizationManifest, setAvailableLocales, isLocaleAvailable };
|
package/l10n.js
CHANGED
|
@@ -10,14 +10,16 @@ function setAvailableLocales(locales) {
|
|
|
10
10
|
function isLocaleAvailable(locale) {
|
|
11
11
|
return availableLocales.has(locale);
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
let localizationManifest;
|
|
14
|
+
function registerLocalization(manifest, language, main, extensionTranslationsUris) {
|
|
14
15
|
if (isInitialized()) {
|
|
15
16
|
console.error('Some parts of VSCode are already initialized, make sure the language pack is loaded before anything else or some translations will be missing');
|
|
16
17
|
}
|
|
17
18
|
globalThis._VSCODE_NLS_MESSAGES = main;
|
|
18
19
|
globalThis._VSCODE_NLS_LANGUAGE = language;
|
|
19
20
|
extensionTranslationsUri[language] = extensionTranslationsUris;
|
|
20
|
-
currentLocaleExtensionId =
|
|
21
|
+
currentLocaleExtensionId = `${manifest.publisher}.${manifest.name}`;
|
|
22
|
+
localizationManifest = manifest;
|
|
21
23
|
}
|
|
22
24
|
function getBuiltInExtensionTranslationsUris(language) {
|
|
23
25
|
return extensionTranslationsUri[language];
|
|
@@ -25,5 +27,8 @@ function getBuiltInExtensionTranslationsUris(language) {
|
|
|
25
27
|
function getExtensionIdProvidingCurrentLocale() {
|
|
26
28
|
return currentLocaleExtensionId;
|
|
27
29
|
}
|
|
30
|
+
function getLocalizationManifest() {
|
|
31
|
+
return localizationManifest;
|
|
32
|
+
}
|
|
28
33
|
|
|
29
|
-
export { getBuiltInExtensionTranslationsUris, getExtensionIdProvidingCurrentLocale, isLocaleAvailable, registerLocalization, setAvailableLocales };
|
|
34
|
+
export { getBuiltInExtensionTranslationsUris, getExtensionIdProvidingCurrentLocale, getLocalizationManifest, isLocaleAvailable, registerLocalization, setAvailableLocales };
|