web: css language server not working when display language is set (#172430)

This commit is contained in:
Martin Aeschlimann 2023-01-25 20:19:40 +01:00 committed by GitHub
parent 7a04589c16
commit 49e696c011
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 6 deletions

View file

@ -13,6 +13,9 @@ const messageWriter = new BrowserMessageWriter(self);
const connection = createConnection(messageReader, messageWriter);
console.log = connection.console.log.bind(connection.console);
console.error = connection.console.error.bind(connection.console);
const runtime: RuntimeEnvironment = {
timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable {

View file

@ -7,13 +7,30 @@ declare let self: any;
import * as l10n from '@vscode/l10n';
let initialized = false;
self.onmessage = async (e: any) => {
const pendingMessages: any[] = [];
const messageHandler = async (e: any) => {
if (!initialized) {
const l10nLog: string[] = [];
initialized = true;
const i10lLocation = e.data.i10lLocation;
if (i10lLocation) {
await l10n.config({ uri: i10lLocation });
try {
await l10n.config({ uri: i10lLocation });
l10nLog.push(`l10n: Configured to ${i10lLocation.toString()}.`);
} catch (e) {
l10nLog.push(`l10n: Problems loading ${i10lLocation.toString()} : ${e}.`);
}
} else {
l10nLog.push(`l10n: No bundle configured.`);
}
await import('./cssServerMain');
if (self.onmessage !== messageHandler) {
pendingMessages.forEach(self.onmessage);
pendingMessages.length = 0;
}
l10nLog.forEach(console.log);
} else {
pendingMessages.push(e);
}
};
self.onmessage = messageHandler;

View file

@ -13,6 +13,9 @@ const messageWriter = new BrowserMessageWriter(self);
const connection = createConnection(messageReader, messageWriter);
console.log = connection.console.log.bind(connection.console);
console.error = connection.console.error.bind(connection.console);
const runtime: RuntimeEnvironment = {
timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable {

View file

@ -7,13 +7,30 @@ declare let self: any;
import * as l10n from '@vscode/l10n';
let initialized = false;
self.onmessage = async (e: any) => {
const pendingMessages: any[] = [];
const messageHandler = async (e: any) => {
if (!initialized) {
const l10nLog: string[] = [];
initialized = true;
const i10lLocation = e.data.i10lLocation;
if (i10lLocation) {
await l10n.config({ uri: i10lLocation });
try {
await l10n.config({ uri: i10lLocation });
l10nLog.push(`l10n: Configured to ${i10lLocation.toString()}.`);
} catch (e) {
l10nLog.push(`l10n: Problems loading ${i10lLocation.toString()} : ${e}.`);
}
} else {
l10nLog.push(`l10n: No bundle configured.`);
}
await import('./htmlServerMain');
if (self.onmessage !== messageHandler) {
pendingMessages.forEach(self.onmessage);
pendingMessages.length = 0;
}
l10nLog.forEach(console.log);
} else {
pendingMessages.push(e);
}
};
self.onmessage = messageHandler;

View file

@ -13,6 +13,9 @@ const messageWriter = new BrowserMessageWriter(self);
const connection = createConnection(messageReader, messageWriter);
console.log = connection.console.log.bind(connection.console);
console.error = connection.console.error.bind(connection.console);
const runtime: RuntimeEnvironment = {
timer: {
setImmediate(callback: (...args: any[]) => void, ...args: any[]): Disposable {

View file

@ -7,13 +7,30 @@ declare let self: any;
import * as l10n from '@vscode/l10n';
let initialized = false;
self.onmessage = async (e: any) => {
const pendingMessages: any[] = [];
const messageHandler = async (e: any) => {
if (!initialized) {
const l10nLog: string[] = [];
initialized = true;
const i10lLocation = e.data.i10lLocation;
if (i10lLocation) {
await l10n.config({ uri: i10lLocation });
try {
await l10n.config({ uri: i10lLocation });
l10nLog.push(`l10n: Configured to ${i10lLocation.toString()}.`);
} catch (e) {
l10nLog.push(`l10n: Problems loading ${i10lLocation.toString()} : ${e}.`);
}
} else {
l10nLog.push(`l10n: No bundle configured.`);
}
await import('./jsonServerMain');
if (self.onmessage !== messageHandler) {
pendingMessages.forEach(self.onmessage);
pendingMessages.length = 0;
}
l10nLog.forEach(console.log);
} else {
pendingMessages.push(e);
}
};
self.onmessage = messageHandler;