From 50e4ce3d50a7771e8553e664c309372821563de4 Mon Sep 17 00:00:00 2001 From: Rikki Schulte Date: Sat, 22 Jun 2024 21:24:44 +0200 Subject: [PATCH] fix: lsp stdin/stdout interface (neovim, etc) --- .changeset/dull-numbers-run.md | 6 ++++++ .../src/startServer.ts | 13 +++---------- 2 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 .changeset/dull-numbers-run.md diff --git a/.changeset/dull-numbers-run.md b/.changeset/dull-numbers-run.md new file mode 100644 index 00000000000..1212c86ebdb --- /dev/null +++ b/.changeset/dull-numbers-run.md @@ -0,0 +1,6 @@ +--- +'graphql-language-service-server': patch +'graphql-language-service-cli': patch +--- + +fix the lsp stream interface for stdin/out (neovim, etc) diff --git a/packages/graphql-language-service-server/src/startServer.ts b/packages/graphql-language-service-server/src/startServer.ts index eb0c999bc5c..b3a3b054c85 100644 --- a/packages/graphql-language-service-server/src/startServer.ts +++ b/packages/graphql-language-service-server/src/startServer.ts @@ -116,16 +116,9 @@ export default async function startServer( break; case 'stream': - const server = createLanguageServerConnection( - // @ts-expect-error this still works, just a type mismatch - process.stdin, - process.stderr, - { - connectionStrategy: 'stdio', - }, - ); - server.listen(); - return server; + reader = new StreamMessageReader(process.stdin); + writer = new StreamMessageWriter(process.stdout); + break; default: reader = new IPCMessageReader(process);