css/json/html web: adopt LanguageClient API change (#218060)

This commit is contained in:
Martin Aeschlimann 2024-06-25 16:26:48 +02:00 committed by GitHub
parent 1b27e602ed
commit a28cbc207a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 15 additions and 26 deletions

View File

@ -8,13 +8,6 @@ import { BaseLanguageClient, LanguageClientOptions } from 'vscode-languageclient
import { startClient, LanguageClientConstructor } from '../cssClient';
import { LanguageClient } from 'vscode-languageclient/browser';
declare const Worker: {
new(stringUrl: string): any;
};
declare const TextDecoder: {
new(encoding?: string): { decode(buffer: ArrayBuffer): string };
};
let client: BaseLanguageClient | undefined;
// this method is called when vs code is activated
@ -25,7 +18,7 @@ export async function activate(context: ExtensionContext) {
worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' });
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
return new LanguageClient(id, name, clientOptions, worker);
return new LanguageClient(id, name, worker, clientOptions);
};
client = await startClient(context, newLanguageClient, { TextDecoder });

View File

@ -1,7 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
"outDir": "./out",
"lib": [
"webworker"
]
},
"include": [
"src/**/*",

View File

@ -8,13 +8,6 @@ import { LanguageClientOptions } from 'vscode-languageclient';
import { startClient, LanguageClientConstructor, AsyncDisposable } from '../htmlClient';
import { LanguageClient } from 'vscode-languageclient/browser';
declare const Worker: {
new(stringUrl: string): any;
};
declare const TextDecoder: {
new(encoding?: string): { decode(buffer: ArrayBuffer): string };
};
let client: AsyncDisposable | undefined;
// this method is called when vs code is activated
@ -25,7 +18,7 @@ export async function activate(context: ExtensionContext) {
worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' });
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
return new LanguageClient(id, name, clientOptions, worker);
return new LanguageClient(id, name, worker, clientOptions);
};
const timer = {

View File

@ -1,7 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
"outDir": "./out",
"lib": [
"webworker"
]
},
"include": [
"src/**/*",

View File

@ -8,12 +8,6 @@ import { LanguageClientOptions } from 'vscode-languageclient';
import { startClient, LanguageClientConstructor, SchemaRequestService, AsyncDisposable, languageServerDescription } from '../jsonClient';
import { LanguageClient } from 'vscode-languageclient/browser';
declare const Worker: {
new(stringUrl: string): any;
};
declare function fetch(uri: string, options: any): any;
let client: AsyncDisposable | undefined;
// this method is called when vs code is activated
@ -24,7 +18,7 @@ export async function activate(context: ExtensionContext) {
worker.postMessage({ i10lLocation: l10n.uri?.toString(false) ?? '' });
const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
return new LanguageClient(id, name, clientOptions, worker);
return new LanguageClient(id, name, worker, clientOptions);
};
const schemaRequests: SchemaRequestService = {

View File

@ -1,7 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"outDir": "./out"
"outDir": "./out",
"lib": [
"webworker"
]
},
"include": [
"src/**/*",