import { ExtensionContext } from 'vscode' ; import { startClient , LanguageClientConstructor , RuntimeEnvironment } from '../extension' ; import { ServerOptions , TransportKind , LanguageClientOptions , LanguageClient } from 'vscode-languageclient/node' ; import { SchemaExtensionAPI } from '../schema-extension-api' ; import { getRedHatService } from '@redhat-developer/vscode-redhat-telemetry' ; import { JSONSchemaCache } from '../json-schema-cache' ; export async function activate ( context ) { const telemetry = await ( await getRedHatService ( context ) ) . getTelemetryService ( ) ; telemetry . sendStartupEvent ( ) ; const serverModule = context . asAbsolutePath ( './dist/languageserver.js' ) ; const debugOptions = { execArgv : [ '--nolazy' , '--inspect=6009' ] } ; const serverOptions = { run : { module : serverModule , transport : TransportKind . ipc } , debug : { module : serverModule , transport : TransportKind . ipc , options : debugOptions } , } ; const newLanguageClient = ( id , name , clientOptions ) => { return new LanguageClient ( id , name , serverOptions , clientOptions ) ; } ; const runtime = { telemetry , schemaCache : new JSONSchemaCache ( context . globalStorageUri . fsPath , context . globalState ) , } ; return startClient ( context , newLanguageClient , runtime ) ; }