diff --git a/.gitpod.yml b/.gitpod.yml index a9c6e3d53..26f0b24fa 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,5 +1,6 @@ ports: - - port: 3000 + - port: 30000 + - port: 30001 - port: 8080 tasks: - before: bash scripts/auth.sh diff --git a/README.md b/README.md index fb2b1b77e..7631cec3c 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,7 @@ The following table describes which version of **monaco-languageclient** and **@ | monaco-languageclient | @codingame/monaco-vscode-api | monaco-editor | comment | | :---- | :---- | :--- | :--- | +| 6.5.3 | 1.82.5 | 0.43.0 | Released 2023-10-11 | | 6.5.2 | 1.82.4 | 0.43.0 | Released 2023-10-07 | | 6.5.1 | 1.82.3 | 0.43.0 | Released 2023-10-04 | | 6.5.0 | 1.82.2 | 0.43.0 | Released 2023-09-29 | @@ -324,7 +325,7 @@ loader.config({ monaco }); If you use pnpm, you have to add `vscode` / `@codingame/monaco-vscode-api` as direct dependency (see the [following table](#monaco-editor--codingamemonaco-vscode-api-compatibility-table)), otherwise the installation will fail. ```json -"vscode": "npm:@codingame/monaco-vscode-api@>=1.82.4 <1.83.0" +"vscode": "npm:@codingame/monaco-vscode-api@>=1.82.5 <1.83.0" ``` ## Changelogs diff --git a/package-lock.json b/package-lock.json index 051a15360..1389dee4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -71,92 +71,101 @@ "integrity": "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ==" }, "node_modules/@codingame/monaco-vscode-configuration-service-override": { - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-configuration-service-override/-/monaco-vscode-configuration-service-override-1.82.4.tgz", - "integrity": "sha512-czLqSL8TpFOXlHC0xCZcHkCk7b8pCeFw4nZIgNPqaVxhgwBdhBUXhRlRPZSAigWca9kPmMf9+rIfEgeM9Xmf8w==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-configuration-service-override/-/monaco-vscode-configuration-service-override-1.82.5.tgz", + "integrity": "sha512-Oas1EdniEZbvDrxBcVxTemoJYMHwWpD2PLTlFv37aeRVpuyk5DKqQu5HUhNVdN1epwCFRZ8efGpJ6nV+d5hh+A==", "dependencies": { "monaco-editor": "0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@1.82.4" + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5" } }, "node_modules/@codingame/monaco-vscode-editor-service-override": { - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-editor-service-override/-/monaco-vscode-editor-service-override-1.82.4.tgz", - "integrity": "sha512-w88Lq0rBSBr9nLf2YRvxafHvloz0TKT2b3tfoNo+W+IlChdvIT2RvxjWPrI7w/HFOe/IkmxNQ7Pi243Gr/2p7A==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-editor-service-override/-/monaco-vscode-editor-service-override-1.82.5.tgz", + "integrity": "sha512-IU3oEPdxJHgfzVKPEow4tzt0lA1p+oQrVAErAP/Fz02DHKydDI/Zjdn65dqGqc3jNaBq8DZGdrvLwMcL0jwb1Q==", "dependencies": { "monaco-editor": "0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@1.82.4" + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5" + } + }, + "node_modules/@codingame/monaco-vscode-files-service-override": { + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-files-service-override/-/monaco-vscode-files-service-override-1.82.5.tgz", + "integrity": "sha512-vQ3RuzcXaD6q+9VbaDvg8f1Xt/w3+CyEBYim3xDpZyz/XrRGTPkRUX88w/KoNQIDVL9CIZGqKE7S2YsIl/BAjw==", + "dependencies": { + "monaco-editor": "0.43.0", + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5" } }, "node_modules/@codingame/monaco-vscode-json-default-extension": { - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-json-default-extension/-/monaco-vscode-json-default-extension-1.82.4.tgz", - "integrity": "sha512-i3drKeFAUaI+wnWurBqB2XlYod+aVGzpacxQyRd6ERXF4IwEQ0gwOktneipJs4pjmMFYI/X3/xAGVjVi2BaLyQ==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-json-default-extension/-/monaco-vscode-json-default-extension-1.82.5.tgz", + "integrity": "sha512-0OzbW76ViMVHhc5SsxgU4HNgVzgxLO5SBN2WXmBcRCTN2peWmjXmTMLqfiGoMsgj07hPP9WayFpbUSsIi/csBA==", "dependencies": { - "vscode": "npm:@codingame/monaco-vscode-api@1.82.4" + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5" } }, "node_modules/@codingame/monaco-vscode-keybindings-service-override": { - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-keybindings-service-override/-/monaco-vscode-keybindings-service-override-1.82.4.tgz", - "integrity": "sha512-a2wVRUJP3cLnsPnyGLhALp2Y6oLlo/2+GsPjMrkYMBk1ZOMh63P8129qnN+9ZtgGNjlqLBuBqmJUqYJd3ToGww==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-keybindings-service-override/-/monaco-vscode-keybindings-service-override-1.82.5.tgz", + "integrity": "sha512-rDBNwUkrcgyRRKyF9CedQEI7ek0eeOeEtYs6X9+dzMlwLoz2CNa9R+S6l8BI2B+3kK2J+46Ph4OrDay3gTSWwA==", "dependencies": { "monaco-editor": "0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@1.82.4" + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5" } }, "node_modules/@codingame/monaco-vscode-languages-service-override": { - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-languages-service-override/-/monaco-vscode-languages-service-override-1.82.4.tgz", - "integrity": "sha512-+UbK0iLL+yOGYodlB9vC09qWzgzGEwqef6rstVSwpf7c86SlH6WOAtrb4s+lfCnyvYkauvmgcElvL+wO89PrxQ==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-languages-service-override/-/monaco-vscode-languages-service-override-1.82.5.tgz", + "integrity": "sha512-zxwoi1dtwG7b2NLN6+uRG6rhBFvpB+7zpB6GmegOhdx8USMiVNejaPLbNrcYqDw8hObFr9WC465JK3LbJA+JHQ==", "dependencies": { "monaco-editor": "0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@1.82.4" + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5" } }, "node_modules/@codingame/monaco-vscode-model-service-override": { - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-model-service-override/-/monaco-vscode-model-service-override-1.82.4.tgz", - "integrity": "sha512-1mr6+5GF+V/Ny98hONC/Amubf71mVn9aY/AeX1LQCCnRTJg5SrZtSTbZk6x+5Fp4zweOm9FoNYvr5/kA6qYXuw==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-model-service-override/-/monaco-vscode-model-service-override-1.82.5.tgz", + "integrity": "sha512-D/6KK0wwPcdQE9cax48tgMFopqHCliUcgqk2n7iPv3Cch0gVFdIIVfWiJQbZ7VUVz5Ig/UeeRcXfqGRHUqwzWQ==", "dependencies": { "monaco-editor": "0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@1.82.4" + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5" } }, "node_modules/@codingame/monaco-vscode-python-default-extension": { - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-python-default-extension/-/monaco-vscode-python-default-extension-1.82.4.tgz", - "integrity": "sha512-VtSzhTJEKdMeJTWcoD/36WkgVMwD2MpdDqWufu9vukca3MQyWu9KS2H28QN6w0VkKcLY4GtUilqMH6EuPPdPsw==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-python-default-extension/-/monaco-vscode-python-default-extension-1.82.5.tgz", + "integrity": "sha512-cQBsGAPIV4M6twV5sEWKlm7UWp2/ANxlF51V2vyOziyKUzBl/kPXWThyU4O6dD1SunbyR9Gr1WY+jq68zgmtLA==", "dependencies": { - "vscode": "npm:@codingame/monaco-vscode-api@1.82.4" + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5" } }, "node_modules/@codingame/monaco-vscode-textmate-service-override": { - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-textmate-service-override/-/monaco-vscode-textmate-service-override-1.82.4.tgz", - "integrity": "sha512-h/S1S+4ZqY2CcGfmTdIPhYc/2l0OYARWSC/GBnHLSnmOi3R+AgmZCnZtQvest9ZfRBjsu7RWPNiJO5U2O5VM/Q==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-textmate-service-override/-/monaco-vscode-textmate-service-override-1.82.5.tgz", + "integrity": "sha512-5mUVYKyxftEmOJvjZl5QSVv7RCTRBOL0mGTQZVsElkrvWfwwkvxSZo1ug9Ot6quuRrxuZ4tk/i9VnrnU+U4PeA==", "dependencies": { "monaco-editor": "0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@1.82.4", + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5", "vscode-oniguruma": "^2.0.0", "vscode-textmate": "^9.0.0" } }, "node_modules/@codingame/monaco-vscode-theme-defaults-default-extension": { - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-theme-defaults-default-extension/-/monaco-vscode-theme-defaults-default-extension-1.82.4.tgz", - "integrity": "sha512-2uCHJGXqtA21pQKfgq+nlc5g6RoBLrjvFID0xhjYKOjRbFywV/YGNfNtFVRIXy0SP8ZK2M9ownNbcewbt3mEjQ==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-theme-defaults-default-extension/-/monaco-vscode-theme-defaults-default-extension-1.82.5.tgz", + "integrity": "sha512-8bDhQtNlmNG0GHmSNuEwHDN5eaU50LYhS+R0FvKhQQ1Gg+w1VKliguS4YtWekNjfCpM4MfI9tg3nMc0GTcXgoQ==", "dependencies": { - "vscode": "npm:@codingame/monaco-vscode-api@1.82.4" + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5" } }, "node_modules/@codingame/monaco-vscode-theme-service-override": { - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-theme-service-override/-/monaco-vscode-theme-service-override-1.82.4.tgz", - "integrity": "sha512-Clp4aRWF1NNvJftrKbZkn2G5YK2rl7wFEttLHLoZkp7NWIbdmdDvW+Ylg1riE2KZRVD11mGvt5EWvsOyHxYYhA==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-theme-service-override/-/monaco-vscode-theme-service-override-1.82.5.tgz", + "integrity": "sha512-CJX0+e6DNKs+QFkI69otp4VpqJFRifY/OGhEd6QsEN56n6wHT/mRSZtoft3Tg581GZ1EFhQkkn7G5KuHrx+CPA==", "dependencies": { "monaco-editor": "0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@1.82.4" + "vscode": "npm:@codingame/monaco-vscode-api@1.82.5" } }, "node_modules/@cspotcode/source-map-support": { @@ -6014,9 +6023,9 @@ }, "node_modules/vscode": { "name": "@codingame/monaco-vscode-api", - "version": "1.82.4", - "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-api/-/monaco-vscode-api-1.82.4.tgz", - "integrity": "sha512-hyqKIlucXSmT2YRgQPdfo6rchDPG8W3S2rSvRtrzQRBdLgbzjPf8p5yEcMDWrry3YQgFvVzPCIs81W7052JeUQ==", + "version": "1.82.5", + "resolved": "https://registry.npmjs.org/@codingame/monaco-vscode-api/-/monaco-vscode-api-1.82.5.tgz", + "integrity": "sha512-FkIETLRm2BrjOraRuM+VcTcDkvf59TVLfRfj9wUUbK/i9Zm/yof6RQZSXaPTf9ECC6effg0CBd0VmM2zIeVxWg==", "dependencies": { "monaco-editor": "0.43.0" }, @@ -6440,15 +6449,15 @@ }, "packages/client": { "name": "monaco-languageclient", - "version": "6.5.2", + "version": "6.5.3-next.3", "hasInstallScript": true, "license": "MIT", "dependencies": { - "@codingame/monaco-vscode-languages-service-override": "~1.82.4", - "@codingame/monaco-vscode-model-service-override": "~1.82.4", + "@codingame/monaco-vscode-editor-service-override": "~1.82.5", + "@codingame/monaco-vscode-languages-service-override": "~1.82.5", + "@codingame/monaco-vscode-model-service-override": "~1.82.5", "monaco-editor": "~0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.4 <1.83.0", - "vscode-jsonrpc": "~8.1.0", + "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.5 <1.83.0", "vscode-languageclient": "~8.1.0" }, "engines": { @@ -6457,7 +6466,7 @@ }, "peerDependencies": { "monaco-editor": "~0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.4 <1.83.0" + "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.5 <1.83.0" }, "peerDependenciesMeta": { "monaco-editor": { @@ -6470,22 +6479,23 @@ }, "packages/examples": { "name": "monaco-languageclient-examples", - "version": "6.5.2", + "version": "6.5.3-next.3", "license": "MIT", "dependencies": { - "@codingame/monaco-vscode-configuration-service-override": "~1.82.4", - "@codingame/monaco-vscode-editor-service-override": "~1.82.4", - "@codingame/monaco-vscode-json-default-extension": "~1.82.4", - "@codingame/monaco-vscode-keybindings-service-override": "~1.82.4", - "@codingame/monaco-vscode-python-default-extension": "~1.82.4", - "@codingame/monaco-vscode-textmate-service-override": "~1.82.4", - "@codingame/monaco-vscode-theme-defaults-default-extension": "~1.82.4", - "@codingame/monaco-vscode-theme-service-override": "~1.82.4", + "@codingame/monaco-vscode-configuration-service-override": "~1.82.5", + "@codingame/monaco-vscode-editor-service-override": "~1.82.5", + "@codingame/monaco-vscode-files-service-override": "~1.82.5", + "@codingame/monaco-vscode-json-default-extension": "~1.82.5", + "@codingame/monaco-vscode-keybindings-service-override": "~1.82.5", + "@codingame/monaco-vscode-python-default-extension": "~1.82.5", + "@codingame/monaco-vscode-textmate-service-override": "~1.82.5", + "@codingame/monaco-vscode-theme-defaults-default-extension": "~1.82.5", + "@codingame/monaco-vscode-theme-service-override": "~1.82.5", "express": "~4.18.2", "langium": "~2.0.2", "langium-statemachine-dsl": "~2.0.0", "monaco-editor-workers": "~0.43.0", - "monaco-languageclient": "~6.5.2", + "monaco-languageclient": "~6.5.3-next.3", "pyright": "~1.1.330", "react": "~18.2.0", "react-dom": "~18.2.0", @@ -6498,6 +6508,7 @@ }, "devDependencies": { "@types/express": "~4.17.18", + "@types/node": "~18.18.3", "@types/react": "~18.2.24", "@types/react-dom": "~18.2.9", "@types/ws": "~8.5.6", @@ -6510,8 +6521,8 @@ "version": "0.0.0", "dependencies": { "monaco-editor-workers": "~0.43.0", - "monaco-languageclient": "~6.5.2", - "monaco-languageclient-examples": "~6.5.2", + "monaco-languageclient": "~6.5.3-next.3", + "monaco-languageclient-examples": "~6.5.3-next.3", "vscode-ws-jsonrpc": "~3.0.0" }, "devDependencies": { @@ -6523,8 +6534,8 @@ "version": "0.0.0", "dependencies": { "monaco-editor-workers": "~0.43.0", - "monaco-languageclient": "~6.5.2", - "monaco-languageclient-examples": "~6.5.2", + "monaco-languageclient": "~6.5.3-next.3", + "monaco-languageclient-examples": "~6.5.3-next.3", "vscode-ws-jsonrpc": "~3.0.0" }, "devDependencies": { diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 0acff66f1..3a0673911 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this npm module are documented in this file. +## [6.5.3] - 2023-10-11 + +- Updated to `monaco-vscode-api` `1.82.5`. Fixes requirung `"skipLibCheck": true` with previous versions of 1.82. + ## [6.5.2] - 2023-10-07 - Updated to `monaco-vscode-api` `1.82.4` diff --git a/packages/client/package.json b/packages/client/package.json index 51cc39a5c..4a943fd49 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "monaco-languageclient", - "version": "6.5.2", + "version": "6.5.3-next.3", "description": "Monaco Language client implementation", "author": { "name": "TypeFox GmbH", @@ -49,15 +49,15 @@ ], "dependencies": { "monaco-editor": "~0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.4 <1.83.0", - "@codingame/monaco-vscode-languages-service-override": "~1.82.4", - "@codingame/monaco-vscode-model-service-override": "~1.82.4", - "vscode-jsonrpc": "~8.1.0", + "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.5 <1.83.0", + "@codingame/monaco-vscode-editor-service-override": "~1.82.5", + "@codingame/monaco-vscode-languages-service-override": "~1.82.5", + "@codingame/monaco-vscode-model-service-override": "~1.82.5", "vscode-languageclient": "~8.1.0" }, "peerDependencies": { "monaco-editor": "~0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.4 <1.83.0" + "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.5 <1.83.0" }, "peerDependenciesMeta": { "monaco-editor": { diff --git a/packages/client/tsconfig.src.json b/packages/client/tsconfig.src.json index 9fb25b703..8852c5c83 100644 --- a/packages/client/tsconfig.src.json +++ b/packages/client/tsconfig.src.json @@ -3,8 +3,7 @@ "compilerOptions": { "rootDir": "src", "outDir": "lib", - "declarationDir": "lib", - "skipLibCheck": true + "declarationDir": "lib" }, "references": [{ "path": "../vscode-ws-jsonrpc/tsconfig.src.json" diff --git a/packages/examples/CHANGELOG.md b/packages/examples/CHANGELOG.md index fabeaf783..40fa99207 100644 --- a/packages/examples/CHANGELOG.md +++ b/packages/examples/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this npm module are documented in this file. +## [6.5.3] - 2023-10-11 + +- Updated to `monaco-languageclient@6.5.3` +- Unify python and json language server. Extract common function. + ## [6.5.2] - 2023-10-07 - Updated to `monaco-languageclient@6.5.2` diff --git a/packages/examples/package.json b/packages/examples/package.json index 67b6cbb14..907faad01 100644 --- a/packages/examples/package.json +++ b/packages/examples/package.json @@ -1,6 +1,6 @@ { "name": "monaco-languageclient-examples", - "version": "6.5.2", + "version": "6.5.3-next.3", "description": "Monaco Language client examples", "author": { "name": "TypeFox GmbH", @@ -43,19 +43,20 @@ } }, "dependencies": { - "@codingame/monaco-vscode-configuration-service-override": "~1.82.4", - "@codingame/monaco-vscode-editor-service-override": "~1.82.4", - "@codingame/monaco-vscode-json-default-extension": "~1.82.4", - "@codingame/monaco-vscode-keybindings-service-override": "~1.82.4", - "@codingame/monaco-vscode-python-default-extension": "~1.82.4", - "@codingame/monaco-vscode-textmate-service-override": "~1.82.4", - "@codingame/monaco-vscode-theme-defaults-default-extension": "~1.82.4", - "@codingame/monaco-vscode-theme-service-override": "~1.82.4", + "@codingame/monaco-vscode-configuration-service-override": "~1.82.5", + "@codingame/monaco-vscode-editor-service-override": "~1.82.5", + "@codingame/monaco-vscode-files-service-override": "~1.82.5", + "@codingame/monaco-vscode-json-default-extension": "~1.82.5", + "@codingame/monaco-vscode-keybindings-service-override": "~1.82.5", + "@codingame/monaco-vscode-python-default-extension": "~1.82.5", + "@codingame/monaco-vscode-textmate-service-override": "~1.82.5", + "@codingame/monaco-vscode-theme-defaults-default-extension": "~1.82.5", + "@codingame/monaco-vscode-theme-service-override": "~1.82.5", "express": "~4.18.2", "langium": "~2.0.2", "langium-statemachine-dsl": "~2.0.0", "monaco-editor-workers": "~0.43.0", - "monaco-languageclient": "~6.5.2", + "monaco-languageclient": "~6.5.3-next.3", "pyright": "~1.1.330", "react": "~18.2.0", "react-dom": "~18.2.0", @@ -69,6 +70,7 @@ "devDependencies": { "@types/ws": "~8.5.6", "@types/express": "~4.17.18", + "@types/node": "~18.18.3", "@types/react": "~18.2.24", "@types/react-dom": "~18.2.9", "ts-node": "~10.9.1", diff --git a/packages/examples/src/browser/main.ts b/packages/examples/src/browser/main.ts index 1eee23e78..d9da956c0 100644 --- a/packages/examples/src/browser/main.ts +++ b/packages/examples/src/browser/main.ts @@ -6,7 +6,7 @@ import { languages, workspace, TextDocument as VsCodeTextDocument } from 'vscode import { getLanguageService, TextDocument } from 'vscode-json-languageservice'; import { createConverter as createCodeConverter } from 'vscode-languageclient/lib/common/codeConverter.js'; import { createConverter as createProtocolConverter } from 'vscode-languageclient/lib/common/protocolConverter.js'; -import { createDefaultJsonContent, createJsonEditor, performInit } from '../common.js'; +import { createDefaultJsonContent, createJsonEditor, performInit } from '../common/client-commons.js'; import '@codingame/monaco-vscode-theme-defaults-default-extension'; import '@codingame/monaco-vscode-json-default-extension'; import { buildWorkerDefinition } from 'monaco-editor-workers'; diff --git a/packages/examples/src/common.ts b/packages/examples/src/common/client-commons.ts similarity index 98% rename from packages/examples/src/common.ts rename to packages/examples/src/common/client-commons.ts index 9c75c69f3..240040784 100644 --- a/packages/examples/src/common.ts +++ b/packages/examples/src/common/client-commons.ts @@ -121,7 +121,8 @@ export const createJsonEditor = async (config: { lightbulb: { enabled: true }, - automaticLayout: true + automaticLayout: true, + wordBasedSuggestions: false }); const result = { diff --git a/packages/examples/src/common/server-commons.ts b/packages/examples/src/common/server-commons.ts new file mode 100644 index 000000000..8ebc410b1 --- /dev/null +++ b/packages/examples/src/common/server-commons.ts @@ -0,0 +1,82 @@ +/* -------------------------------------------------------------------------------------------- + * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ +import { resolve } from 'path'; +import { WebSocketServer } from 'ws'; +import { IncomingMessage, Server } from 'http'; +import { URL } from 'url'; +import { Socket } from 'net'; +import { IWebSocket, WebSocketMessageReader, WebSocketMessageWriter } from 'vscode-ws-jsonrpc'; +import { createConnection, createServerProcess, forward } from 'vscode-ws-jsonrpc/server'; +import { Message, InitializeRequest, InitializeParams } from 'vscode-languageserver'; + +/** + * start the language server inside the current process + */ +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 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)) { + console.log(`${serverName} Server received:`); + console.log(message); + if (message.method === InitializeRequest.type.method) { + const initializeParams = message.params as InitializeParams; + initializeParams.processId = process.pid; + } + } + if (Message.isResponse(message)) { + console.log(`${serverName} Server sent:`); + console.log(message); + } + return message; + }); + } +}; + +export const upgradeWsServer = (config: { + serverName: string, + pathName: string, + server: Server, + wss: WebSocketServer, + baseDir: string, + relativeDir: string +}) => { + config.server.on('upgrade', (request: IncomingMessage, socket: Socket, head: Buffer) => { + const baseURL = `http://${request.headers.host}/`; + const pathName = request.url ? new URL(request.url, baseURL).pathname : undefined; + if (pathName === config.pathName) { + config.wss.handleUpgrade(request, socket, head, webSocket => { + const socket: IWebSocket = { + send: content => webSocket.send(content, error => { + if (error) { + throw error; + } + }), + onMessage: cb => webSocket.on('message', (data) => { + console.log(data.toString()); + cb(data); + }), + onError: cb => webSocket.on('error', cb), + onClose: cb => webSocket.on('close', cb), + dispose: () => webSocket.close() + }; + // launch the server when the web socket is opened + if (webSocket.readyState === webSocket.OPEN) { + launchLanguageServer(config.serverName, socket, config.baseDir, config.relativeDir); + } else { + webSocket.on('open', () => { + launchLanguageServer(config.serverName, socket, config.baseDir, config.relativeDir); + }); + } + }); + } + }); +}; diff --git a/packages/examples/src/index.ts b/packages/examples/src/index.ts index 36dcab7ca..a46932cf7 100644 --- a/packages/examples/src/index.ts +++ b/packages/examples/src/index.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ -export * from './common.js'; +export * from './common/client-commons.js'; export * from './browser/main.js'; export * from './json/client/main.js'; export * from './langium/statemachineClient.js'; diff --git a/packages/examples/src/json/client/main.ts b/packages/examples/src/json/client/main.ts index 018755c33..4a7417c65 100644 --- a/packages/examples/src/json/client/main.ts +++ b/packages/examples/src/json/client/main.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ -import { createDefaultJsonContent, createJsonEditor, createUrl, createWebSocketAndStartClient, performInit } from '../../common.js'; +import { createDefaultJsonContent, createJsonEditor, createUrl, createWebSocketAndStartClient, performInit } from '../../common/client-commons.js'; import { buildWorkerDefinition } from 'monaco-editor-workers'; buildWorkerDefinition('../../node_modules/monaco-editor-workers/dist/workers/', new URL('', window.location.href).href, false); @@ -15,6 +15,6 @@ export const startJsonClient = async () => { content: createDefaultJsonContent() }); - const url = createUrl('localhost', 3000, '/sampleServer'); + const url = createUrl('localhost', 30000, '/sampleServer'); createWebSocketAndStartClient(url); }; diff --git a/packages/examples/src/json/server/direct.ts b/packages/examples/src/json/server/direct.ts index d93fa01e2..c50a050b3 100644 --- a/packages/examples/src/json/server/direct.ts +++ b/packages/examples/src/json/server/direct.ts @@ -2,6 +2,10 @@ * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ +import { resolve } from 'path'; import { runJsonServer } from './main.js'; +import { getLocalDirectory } from '../../utils/fs-utils.js'; -runJsonServer(); +const baseDir = resolve(getLocalDirectory(import.meta.url)); +const relativeDir = '../../../dist/json/server/json-server.js'; +runJsonServer(baseDir, relativeDir); diff --git a/packages/examples/src/json/server/json-server.ts b/packages/examples/src/json/server/json-server.ts index bd4d18c46..931ed72ce 100644 --- a/packages/examples/src/json/server/json-server.ts +++ b/packages/examples/src/json/server/json-server.ts @@ -6,7 +6,7 @@ import { readFile } from 'fs'; import requestLight from 'request-light'; import * as URI from 'vscode-uri'; import 'vscode-ws-jsonrpc'; -import { _Connection, TextDocuments, DocumentSymbolParams } from 'vscode-languageserver/lib/node/main.js'; +import { createConnection, _Connection, TextDocuments, DocumentSymbolParams, ProposedFeatures } from 'vscode-languageserver/lib/node/main.js'; import { Diagnostic, Command, CompletionList, CompletionItem, Hover, SymbolInformation, TextEdit, FoldingRange, ColorInformation, ColorPresentation @@ -256,3 +256,10 @@ export class JsonServer { return this.jsonService.parseJSONDocument(document); } } + +const scriptExec = process.argv[2]; +if (scriptExec === '--stdio') { + const connection = createConnection(ProposedFeatures.all); + const ls = new JsonServer(connection); + ls.start(); +} diff --git a/packages/examples/src/json/server/main.ts b/packages/examples/src/json/server/main.ts index 6b1a63f37..eba73577e 100644 --- a/packages/examples/src/json/server/main.ts +++ b/packages/examples/src/json/server/main.ts @@ -3,28 +3,12 @@ * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ import { WebSocketServer } from 'ws'; -import { IncomingMessage } from 'http'; -import { URL } from 'url'; -import { Socket } from 'net'; +import { Server } from 'http'; import express from 'express'; -import { IWebSocket, WebSocketMessageReader, WebSocketMessageWriter } from 'vscode-ws-jsonrpc'; -import { createConnection } from 'vscode-languageserver/lib/node/main.js'; import { getLocalDirectory } from '../../utils/fs-utils.js'; -import { JsonServer } from './json-server.js'; +import { upgradeWsServer } from '../../common/server-commons.js'; -/** - * start the language server inside the current process - */ -const launchLanguageServer = (socket: IWebSocket): JsonServer => { - const reader = new WebSocketMessageReader(socket); - const writer = new WebSocketMessageWriter(socket); - const connection = createConnection(reader, writer); - const server = new JsonServer(connection); - server.start(); - return server; -}; - -export const runJsonServer = () => { +export const runJsonServer = (baseDir: string, relativeDir: string) => { process.on('uncaughtException', function(err: any) { console.error('Uncaught Exception: ', err.toString()); if (err.stack) { @@ -38,38 +22,18 @@ export const runJsonServer = () => { const dir = getLocalDirectory(import.meta.url); app.use(express.static(dir)); // start the server - const server = app.listen(3000); + const server: Server = app.listen(30000); // create the web socket const wss = new WebSocketServer({ noServer: true, perMessageDeflate: false }); - server.on('upgrade', (request: IncomingMessage, socket: Socket, head: Buffer) => { - const baseURL = `http://${request.headers.host}/`; - const pathname = request.url ? new URL(request.url, baseURL).pathname : undefined; - if (pathname === '/sampleServer') { - wss.handleUpgrade(request, socket, head, webSocket => { - const socket: IWebSocket = { - send: content => webSocket.send(content, error => { - if (error) { - throw error; - } - }), - onMessage: cb => webSocket.on('message', (data) => { - console.log(data.toString()); - cb(data); - }), - onError: cb => webSocket.on('error', cb), - onClose: cb => webSocket.on('close', cb), - dispose: () => webSocket.close() - }; - // launch the server when the web socket is opened - if (webSocket.readyState === webSocket.OPEN) { - launchLanguageServer(socket); - } else { - webSocket.on('open', () => launchLanguageServer(socket)); - } - }); - } + upgradeWsServer({ + serverName: 'JSON', + pathName: '/sampleServer', + server, + wss, + baseDir, + relativeDir }); }; diff --git a/packages/examples/src/node.ts b/packages/examples/src/node.ts index bc508ce17..d7d70e673 100644 --- a/packages/examples/src/node.ts +++ b/packages/examples/src/node.ts @@ -3,6 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ +export * from './common/server-commons.js'; export * from './json/server/json-server.js'; export * from './json/server/main.js'; export * from './python/server/main.js'; diff --git a/packages/examples/src/python/client/main.ts b/packages/examples/src/python/client/main.ts index afb654598..c7df7d0b1 100644 --- a/packages/examples/src/python/client/main.ts +++ b/packages/examples/src/python/client/main.ts @@ -17,9 +17,9 @@ import getTextmateServiceOverride from '@codingame/monaco-vscode-textmate-servic import { initServices, MonacoLanguageClient } from 'monaco-languageclient'; import { CloseAction, ErrorAction, MessageTransports } from 'vscode-languageclient'; import { WebSocketMessageReader, WebSocketMessageWriter, toSocket } from 'vscode-ws-jsonrpc'; -import { RegisteredFileSystemProvider, registerFileSystemOverlay, RegisteredMemoryFile } from 'vscode/service-override/files'; +import { RegisteredFileSystemProvider, registerFileSystemOverlay, RegisteredMemoryFile } from '@codingame/monaco-vscode-files-service-override'; import { Uri } from 'vscode'; -import { createUrl } from '../../common.js'; +import { createUrl } from '../../common/client-commons.js'; import { buildWorkerDefinition } from 'monaco-editor-workers'; buildWorkerDefinition('../../../node_modules/monaco-editor-workers/dist/workers/', new URL('', window.location.href).href, false); @@ -140,7 +140,7 @@ export const startPythonClient = async () => { registerFileSystemOverlay(1, fileSystemProvider); // create the web socket and configure to start the language client on open, can add extra parameters to the url if needed. - createWebSocket(createUrl('localhost', 30000, '/pyright', { + createWebSocket(createUrl('localhost', 30001, '/pyright', { // Used to parse an auth token or additional parameters such as import IDs to the language server authorization: 'UserAuth' // By commenting above line out and commenting below line in, connection to language server will be denied. diff --git a/packages/examples/src/python/server/main.ts b/packages/examples/src/python/server/main.ts index 22c85f961..0d2581d81 100644 --- a/packages/examples/src/python/server/main.ts +++ b/packages/examples/src/python/server/main.ts @@ -5,41 +5,9 @@ import { WebSocketServer } from 'ws'; import { IncomingMessage } from 'http'; import { URL } from 'url'; -import { Socket } from 'net'; import express from 'express'; -import { resolve } from 'path'; -import { IWebSocket, WebSocketMessageReader, WebSocketMessageWriter } from 'vscode-ws-jsonrpc'; -import { createConnection, createServerProcess, forward } from 'vscode-ws-jsonrpc/server'; -import { Message, InitializeRequest, InitializeParams } from 'vscode-languageserver'; import { getLocalDirectory } from '../../utils/fs-utils.js'; - -const launchLanguageServer = (socket: IWebSocket, baseDir: string, relativeDir: string) => { - const serverName = 'PYRIGHT'; - // 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()); - if (serverConnection) { - forward(socketConnection, serverConnection, message => { - if (Message.isRequest(message)) { - console.log(`${serverName} Server received:`); - console.log(message); - if (message.method === InitializeRequest.type.method) { - const initializeParams = message.params as InitializeParams; - initializeParams.processId = process.pid; - } - } - if (Message.isResponse(message)) { - console.log(`${serverName} Server sent:`); - console.log(message); - } - return message; - }); - } -}; +import { upgradeWsServer } from '../../common/server-commons.js'; export const runPythonServer = (baseDir: string, relativeDir: string) => { process.on('uncaughtException', function(err: any) { @@ -55,7 +23,7 @@ export const runPythonServer = (baseDir: string, relativeDir: string) => { const dir = getLocalDirectory(import.meta.url); app.use(express.static(dir)); // start the server - const server = app.listen(30000); + const server = app.listen(30001); // create the web socket const wss = new WebSocketServer({ noServer: true, @@ -76,34 +44,12 @@ export const runPythonServer = (baseDir: string, relativeDir: string) => { } } }); - - server.on('upgrade', (request: IncomingMessage, socket: Socket, head: Buffer) => { - const baseURL = `http://${request.headers.host}/`; - const pathname = request.url ? new URL(request.url, baseURL).pathname : undefined; - if (pathname === '/pyright') { - wss.handleUpgrade(request, socket, head, webSocket => { - const socket: IWebSocket = { - send: content => webSocket.send(content, error => { - if (error) { - throw error; - } - }), - onMessage: cb => webSocket.on('message', (data) => { - cb(data); - }), - onError: cb => webSocket.on('error', cb), - onClose: cb => webSocket.on('close', cb), - dispose: () => webSocket.close() - }; - // launch the server when the web socket is opened - if (webSocket.readyState === webSocket.OPEN) { - launchLanguageServer(socket, baseDir, relativeDir); - } else { - webSocket.on('open', () => { - launchLanguageServer(socket, baseDir, relativeDir); - }); - } - }); - } + upgradeWsServer({ + serverName: 'PYRIGHT', + pathName: '/pyright', + server, + wss, + baseDir, + relativeDir }); }; diff --git a/packages/examples/src/react/app.tsx b/packages/examples/src/react/app.tsx index 007306934..b08c3f0dd 100644 --- a/packages/examples/src/react/app.tsx +++ b/packages/examples/src/react/app.tsx @@ -2,7 +2,7 @@ * Copyright (c) 2018-2022 TypeFox GmbH (http://www.typefox.io). All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. * ------------------------------------------------------------------------------------------ */ -import { createJsonEditor, createUrl, createWebSocketAndStartClient, performInit } from '../common.js'; +import { createJsonEditor, createUrl, createWebSocketAndStartClient, performInit } from '../common/client-commons.js'; import { editor } from 'monaco-editor'; import React, { createRef, useEffect, useMemo, useRef } from 'react'; diff --git a/packages/examples/src/react/main.tsx b/packages/examples/src/react/main.tsx index 9c69da7b7..dec9885b4 100644 --- a/packages/examples/src/react/main.tsx +++ b/packages/examples/src/react/main.tsx @@ -17,5 +17,5 @@ export const startReactJsonClient = () => { defaultCode={defaultCode} hostname={'localhost'} path={'/sampleServer'} - port={3000} />); + port={30000} />); }; diff --git a/packages/examples/tsconfig.src.json b/packages/examples/tsconfig.src.json index e74c4cdb9..291cbb204 100644 --- a/packages/examples/tsconfig.src.json +++ b/packages/examples/tsconfig.src.json @@ -4,14 +4,13 @@ "rootDir": "src", "outDir": "dist", "declarationDir": "dist", + "lib": [ + "ES2022", + "DOM", + "WebWorker" + ], "skipLibCheck": true }, - "types": [ - "react/next", - "react-dom/next", - "vite/client", - "node" - ], "references": [{ "path": "../client/tsconfig.src.json", }, diff --git a/packages/verify/pnpm/package.json b/packages/verify/pnpm/package.json index a43608cd3..cb56decd0 100644 --- a/packages/verify/pnpm/package.json +++ b/packages/verify/pnpm/package.json @@ -3,9 +3,9 @@ "version": "0.0.0", "private": "true", "dependencies": { - "monaco-languageclient": "~6.5.2", + "monaco-languageclient": "~6.5.3-next.3", "monaco-editor": "~0.43.0", - "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.4 <1.83.0" + "vscode": "npm:@codingame/monaco-vscode-api@>=1.82.5 <1.83.0" }, "devDependencies": { "shx": "~0.3.4" diff --git a/packages/verify/vite/package.json b/packages/verify/vite/package.json index 62556f7b1..e5c93048c 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.2", - "monaco-languageclient-examples": "~6.5.2", + "monaco-languageclient": "~6.5.3-next.3", + "monaco-languageclient-examples": "~6.5.3-next.3", "vscode-ws-jsonrpc": "~3.0.0" }, "devDependencies": { diff --git a/packages/verify/vite/src/client/main.ts b/packages/verify/vite/src/client/main.ts index bd15bd057..6397621ce 100644 --- a/packages/verify/vite/src/client/main.ts +++ b/packages/verify/vite/src/client/main.ts @@ -16,7 +16,7 @@ const start = async () => { }); // create the web socket - const url = createUrl('localhost', 3000, '/sampleServer'); + const url = createUrl('localhost', 30000, '/sampleServer'); createWebSocketAndStartClient(url); }; diff --git a/packages/verify/webpack/package.json b/packages/verify/webpack/package.json index 3eaec6c60..6be98db0a 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.2", - "monaco-languageclient-examples": "~6.5.2", + "monaco-languageclient": "~6.5.3-next.3", + "monaco-languageclient-examples": "~6.5.3-next.3", "vscode-ws-jsonrpc": "~3.0.0" }, "devDependencies": { diff --git a/packages/verify/webpack/src/client/main.ts b/packages/verify/webpack/src/client/main.ts index 65d9ce0d9..d2b6f5f56 100644 --- a/packages/verify/webpack/src/client/main.ts +++ b/packages/verify/webpack/src/client/main.ts @@ -16,7 +16,7 @@ const start = async () => { }); // create the web socket - const url = createUrl('localhost', 3000, '/sampleServer'); + const url = createUrl('localhost', 30000, '/sampleServer'); createWebSocketAndStartClient(url); }; diff --git a/packages/verify/webpack/tsconfig.json b/packages/verify/webpack/tsconfig.json index 3e84bb137..6790dc47e 100644 --- a/packages/verify/webpack/tsconfig.json +++ b/packages/verify/webpack/tsconfig.json @@ -3,8 +3,7 @@ "compilerOptions": { "rootDir": "src", "outDir": "dist", - "declarationDir": "dist", - "skipLibCheck": true + "declarationDir": "dist" }, "references": [{ "path": "../../client/tsconfig.src.json" diff --git a/packages/verify/yarn/package.json b/packages/verify/yarn/package.json index 99f0a439b..75381b4fa 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.2" + "monaco-languageclient": "~6.5.3-next.3" }, "devDependencies": { "shx": "~0.3.4"