From f104fd7533c2364e0e58c09e016c1c11f6edae03 Mon Sep 17 00:00:00 2001 From: Kai Salmen Date: Wed, 11 Oct 2023 14:35:17 +0200 Subject: [PATCH] Fix json server startup --- package-lock.json | 14 +++++++------- packages/client/package.json | 2 +- packages/examples/package.json | 4 ++-- packages/examples/src/common/server-commons.ts | 2 +- packages/examples/src/json/server/json-server.ts | 9 ++++++--- packages/verify/pnpm/package.json | 2 +- packages/verify/vite/package.json | 4 ++-- packages/verify/webpack/package.json | 4 ++-- packages/verify/yarn/package.json | 2 +- 9 files changed, 23 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index d644f9314..4c8966305 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6449,7 +6449,7 @@ }, "packages/client": { "name": "monaco-languageclient", - "version": "6.5.3-next.0", + "version": "6.5.3-next.2", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -6479,7 +6479,7 @@ }, "packages/examples": { "name": "monaco-languageclient-examples", - "version": "6.5.3-next.0", + "version": "6.5.3-next.2", "license": "MIT", "dependencies": { "@codingame/monaco-vscode-configuration-service-override": "~1.82.5-next.0", @@ -6495,7 +6495,7 @@ "langium": "~2.0.2", "langium-statemachine-dsl": "~2.0.0", "monaco-editor-workers": "~0.43.0", - "monaco-languageclient": "~6.5.3-next.0", + "monaco-languageclient": "~6.5.3-next.2", "pyright": "~1.1.330", "react": "~18.2.0", "react-dom": "~18.2.0", @@ -6521,8 +6521,8 @@ "version": "0.0.0", "dependencies": { "monaco-editor-workers": "~0.43.0", - "monaco-languageclient": "~6.5.3-next.0", - "monaco-languageclient-examples": "~6.5.3-next.0", + "monaco-languageclient": "~6.5.3-next.2", + "monaco-languageclient-examples": "~6.5.3-next.2", "vscode-ws-jsonrpc": "~3.0.0" }, "devDependencies": { @@ -6534,8 +6534,8 @@ "version": "0.0.0", "dependencies": { "monaco-editor-workers": "~0.43.0", - "monaco-languageclient": "~6.5.3-next.0", - "monaco-languageclient-examples": "~6.5.3-next.0", + "monaco-languageclient": "~6.5.3-next.2", + "monaco-languageclient-examples": "~6.5.3-next.2", "vscode-ws-jsonrpc": "~3.0.0" }, "devDependencies": { diff --git a/packages/client/package.json b/packages/client/package.json index 3425d26f3..8887d0135 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "monaco-languageclient", - "version": "6.5.3-next.0", + "version": "6.5.3-next.2", "description": "Monaco Language client implementation", "author": { "name": "TypeFox GmbH", diff --git a/packages/examples/package.json b/packages/examples/package.json index f5ad93fb4..291d1f03b 100644 --- a/packages/examples/package.json +++ b/packages/examples/package.json @@ -1,6 +1,6 @@ { "name": "monaco-languageclient-examples", - "version": "6.5.3-next.0", + "version": "6.5.3-next.2", "description": "Monaco Language client examples", "author": { "name": "TypeFox GmbH", @@ -56,7 +56,7 @@ "langium": "~2.0.2", "langium-statemachine-dsl": "~2.0.0", "monaco-editor-workers": "~0.43.0", - "monaco-languageclient": "~6.5.3-next.0", + "monaco-languageclient": "~6.5.3-next.2", "pyright": "~1.1.330", "react": "~18.2.0", "react-dom": "~18.2.0", diff --git a/packages/examples/src/common/server-commons.ts b/packages/examples/src/common/server-commons.ts index 2bd2f324d..8ebc410b1 100644 --- a/packages/examples/src/common/server-commons.ts +++ b/packages/examples/src/common/server-commons.ts @@ -17,11 +17,11 @@ import { Message, InitializeRequest, InitializeParams } from 'vscode-languageser export const launchLanguageServer = (serverName: string, socket: IWebSocket, baseDir: string, relativeDir: string) => { // start the language server as an external process const ls = resolve(baseDir, relativeDir); - const serverConnection = createServerProcess(serverName, 'node', [ls, '--stdio']); const reader = new WebSocketMessageReader(socket); const writer = new WebSocketMessageWriter(socket); const socketConnection = createConnection(reader, writer, () => socket.dispose()); + const serverConnection = createServerProcess(serverName, 'node', [ls, '--stdio']); if (serverConnection) { forward(socketConnection, serverConnection, message => { if (Message.isRequest(message)) { diff --git a/packages/examples/src/json/server/json-server.ts b/packages/examples/src/json/server/json-server.ts index 840e0c6f2..931ed72ce 100644 --- a/packages/examples/src/json/server/json-server.ts +++ b/packages/examples/src/json/server/json-server.ts @@ -257,6 +257,9 @@ export class JsonServer { } } -const connection = createConnection(ProposedFeatures.all); -const ls = new JsonServer(connection); -ls.start(); +const scriptExec = process.argv[2]; +if (scriptExec === '--stdio') { + const connection = createConnection(ProposedFeatures.all); + const ls = new JsonServer(connection); + ls.start(); +} diff --git a/packages/verify/pnpm/package.json b/packages/verify/pnpm/package.json index e94654a8c..0e21b8e9d 100644 --- a/packages/verify/pnpm/package.json +++ b/packages/verify/pnpm/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": "true", "dependencies": { - "monaco-languageclient": "~6.5.3-next.0", + "monaco-languageclient": "~6.5.3-next.2", "monaco-editor": "~0.43.0", "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.5-next.0 <1.83.0" }, diff --git a/packages/verify/vite/package.json b/packages/verify/vite/package.json index 934f08fd8..de47876d7 100644 --- a/packages/verify/vite/package.json +++ b/packages/verify/vite/package.json @@ -5,8 +5,8 @@ "type": "module", "dependencies": { "monaco-editor-workers": "~0.43.0", - "monaco-languageclient": "~6.5.3-next.0", - "monaco-languageclient-examples": "~6.5.3-next.0", + "monaco-languageclient": "~6.5.3-next.2", + "monaco-languageclient-examples": "~6.5.3-next.2", "vscode-ws-jsonrpc": "~3.0.0" }, "devDependencies": { diff --git a/packages/verify/webpack/package.json b/packages/verify/webpack/package.json index 54ebdb6b7..7e8a4107d 100644 --- a/packages/verify/webpack/package.json +++ b/packages/verify/webpack/package.json @@ -5,8 +5,8 @@ "type": "module", "dependencies": { "monaco-editor-workers": "~0.43.0", - "monaco-languageclient": "~6.5.3-next.0", - "monaco-languageclient-examples": "~6.5.3-next.0", + "monaco-languageclient": "~6.5.3-next.2", + "monaco-languageclient-examples": "~6.5.3-next.2", "vscode-ws-jsonrpc": "~3.0.0" }, "devDependencies": { diff --git a/packages/verify/yarn/package.json b/packages/verify/yarn/package.json index 9beb7cfd3..b1a83e89f 100644 --- a/packages/verify/yarn/package.json +++ b/packages/verify/yarn/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": "true", "dependencies": { - "monaco-languageclient": "~6.5.3-next.0" + "monaco-languageclient": "~6.5.3-next.2" }, "devDependencies": { "shx": "~0.3.4"