[html/css/json] pass the location of the localization bundle to the server (#168111)

pass the location of the localization bundle to the server
This commit is contained in:
Martin Aeschlimann
2022-12-05 23:49:27 +01:00
committed by GitHub
parent 6e3976f744
commit b27ee6b7b5
15 changed files with 88 additions and 12 deletions

View File

@@ -13,7 +13,7 @@ const path = require('path');
const serverConfig = withBrowserDefaults({
context: __dirname,
entry: {
extension: './src/browser/htmlServerMain.ts',
extension: './src/browser/htmlServerWorkerMain.ts',
},
output: {
filename: 'htmlServerMain.js',

View File

@@ -13,7 +13,8 @@
"vscode-html-languageservice": "^5.0.3",
"vscode-languageserver": "^8.1.0-next.2",
"vscode-languageserver-textdocument": "^1.0.7",
"vscode-uri": "^3.0.6"
"vscode-uri": "^3.0.6",
"@vscode/l10n": "^0.0.10"
},
"devDependencies": {
"@types/mocha": "^9.1.1",

View File

@@ -0,0 +1,19 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
declare let self: any;
import * as l10n from '@vscode/l10n';
let initialized = false;
self.onmessage = async (e: any) => {
if (!initialized) {
initialized = true;
const i10lLocation = e.data.i10lLocation;
if (i10lLocation) {
await l10n.config({ uri: i10lLocation });
}
await import('./htmlServerMain');
}
};