css/html/json update to lsp 8 (#148715)

This commit is contained in:
Martin Aeschlimann
2022-05-19 12:48:53 +02:00
committed by GitHub
parent 14925e336d
commit e783fdc25e
30 changed files with 603 additions and 533 deletions

View File

@@ -5,7 +5,7 @@
import { ExtensionContext, OutputChannel, window, workspace } from 'vscode';
import { startClient, LanguageClientConstructor, SchemaRequestService, languageServerDescription } from '../jsonClient';
import { ServerOptions, TransportKind, LanguageClientOptions, LanguageClient } from 'vscode-languageclient/node';
import { ServerOptions, TransportKind, LanguageClientOptions, LanguageClient, BaseLanguageClient } from 'vscode-languageclient/node';
import { promises as fs } from 'fs';
import * as path from 'path';
@@ -15,6 +15,7 @@ import TelemetryReporter from '@vscode/extension-telemetry';
import { JSONSchemaCache } from './schemaCache';
let telemetry: TelemetryReporter | undefined;
let client: BaseLanguageClient | undefined;
// this method is called when vs code is activated
export async function activate(context: ExtensionContext) {
@@ -45,11 +46,15 @@ export async function activate(context: ExtensionContext) {
const schemaRequests = await getSchemaRequestService(context, log);
startClient(context, newLanguageClient, { schemaRequests, telemetry });
client = await startClient(context, newLanguageClient, { schemaRequests, telemetry });
}
export function deactivate(): Promise<any> {
return telemetry ? telemetry.dispose() : Promise.resolve(null);
export async function deactivate(): Promise<any> {
if (client) {
await client.stop();
client = undefined;
}
telemetry?.dispose();
}
interface IPackageInfo {