extensions/json-language-features/client/src/node/jsonClientMain.ts/activate
export async function activate(context: ExtensionContext) {
	const clientPackageJSON = await getPackageInfo(context);
	telemetry = new TelemetryReporter(clientPackageJSON.name, clientPackageJSON.version, clientPackageJSON.aiKey);

	const outputChannel = window.createOutputChannel(languageServerDescription);

	const serverMain = `./server/${clientPackageJSON.main.indexOf('/dist/') !== -1 ? 'dist' : 'out'}/node/jsonServerMain`;
	const serverModule = context.asAbsolutePath(serverMain);

	// The debug options for the server
	const debugOptions = { execArgv: ['--nolazy', '--inspect=' + (6000 + Math.round(Math.random() * 999))] };

	// If the extension is launch in debug mode the debug server options are use
	// Otherwise the run options are used
	const serverOptions: ServerOptions = {
		run: { module: serverModule, transport: TransportKind.ipc },
		debug: { module: serverModule, transport: TransportKind.ipc, options: debugOptions }
	};

	const newLanguageClient: LanguageClientConstructor = (id: string, name: string, clientOptions: LanguageClientOptions) => {
		clientOptions.outputChannel = outputChannel;
		return new LanguageClient(id, name, serverOptions, clientOptions);
	};
	const log = getLog(outputChannel);
	context.subscriptions.push(log);

	const schemaRequests = await getSchemaRequestService(context, log);

	startClient(context, newLanguageClient, { schemaRequests, telemetry });
}