[css/json/html] adopt latest lsp, update to module: node16 (#230371)

* adopt latest language-server/client

* update package-locks

* transpiler to support Node16
This commit is contained in:
Martin Aeschlimann
2024-10-03 13:49:56 +02:00
committed by GitHub
parent 52b181c2ce
commit fc6d94b806
35 changed files with 164 additions and 137 deletions

View File

@@ -22,7 +22,7 @@ const messageHandler = async (e: any) => {
} else {
l10nLog.push(`l10n: No bundle configured.`);
}
await import('./htmlServerMain');
await import('./htmlServerMain.js');
if (self.onmessage !== messageHandler) {
pendingMessages.forEach(msg => self.onmessage?.(msg));
pendingMessages.length = 0;

View File

@@ -22,7 +22,7 @@ function getLanguageServiceHost(scriptKind: ts.ScriptKind) {
const compilerOptions: ts.CompilerOptions = { allowNonTsExtensions: true, allowJs: true, lib: ['lib.es2020.full.d.ts'], target: ts.ScriptTarget.Latest, moduleResolution: ts.ModuleResolutionKind.Classic, experimentalDecorators: false };
let currentTextDocument = TextDocument.create('init', 'javascript', 1, '');
const jsLanguageService = import(/* webpackChunkName: "javascriptLibs" */ './javascriptLibs').then(libs => {
const jsLanguageService = import(/* webpackChunkName: "javascriptLibs" */ './javascriptLibs.js').then(libs => {
const host: ts.LanguageServiceHost = {
getCompilationSettings: () => compilerOptions,
getScriptFileNames: () => [currentTextDocument.uri, 'jquery'],

View File

@@ -16,7 +16,7 @@ async function setupMain() {
l10nLog.push(`l10n: Problems loading ${i10lLocation.toString()} : ${e}`);
}
}
await import('./htmlServerMain');
await import('./htmlServerMain.js');
l10nLog.forEach(console.log);
}
setupMain();

View File

@@ -24,8 +24,8 @@ suite('HTML Language Configuration', () => {
value = value.substr(0, offset) + value.substring(offset + 1);
const actualRange = words.getWordAtText(value, offset, wordRegex);
assert(actualRange.start <= offset);
assert(actualRange.start + actualRange.length >= offset);
assert.ok(actualRange.start <= offset);
assert.ok(actualRange.start + actualRange.length >= offset);
assert.strictEqual(value.substr(actualRange.start, actualRange.length), expected);
}