extensions/typescript-language-features/web/webServer.ts/startWebSession
function startWebSession(options: StartSessionOptions, logger: ts.server.Logger, cancellationToken: ts.server.ServerCancellationToken) {
	class WorkerSession extends ServerWorkerSession {
		constructor() {
			super(
				ts.sys as ts.server.ServerHost & { tryEnableSourceMapsForHost?(): void; getEnvironmentVariable(name: string): string },
				{ writeMessage },
				options,
				logger,
				cancellationToken,
				hrtime);
		}

		override exit() {
			this.logger.info('Exiting...');
			this.projectService.closeLog();
			close();
		}

		listen() {
			addEventListener('message', (message: any) => {
				this.onMessage(message.data);
			});
		}
	}

	const session = new WorkerSession();

	// Start listening
	session.listen();
}