diff --git a/packages/test-utils/index.ts b/packages/test-utils/index.ts index 3447b2f5..69ada950 100644 --- a/packages/test-utils/index.ts +++ b/packages/test-utils/index.ts @@ -12,16 +12,17 @@ export function startLanguageServer(serverModule: string, cwd?: string | URL) { const childProcess = cp.fork( serverModule, - ['--node-ipc', `--clientProcessId=${process.pid.toString()}`], + ['--stdio', `--clientProcessId=${process.pid.toString()}`], { execArgv: ['--nolazy'], env: process.env, cwd, + stdio: 'pipe', } ); const connection = _.createProtocolConnection( - new _.IPCMessageReader(childProcess), - new _.IPCMessageWriter(childProcess) + childProcess.stdout!, + childProcess.stdin! ); const openedDocuments = new Map(); const settings: any = {}; @@ -34,7 +35,7 @@ export function startLanguageServer(serverModule: string, cwd?: string | URL) { connection.onUnhandledNotification(e => console.log(e)); connection.onError(e => console.log(e)); connection.onDispose(() => { - childProcess.kill(); + connection.end(); }); connection.onRequest(_.ConfigurationRequest.type, ({ items }) => { return items.map(item => {