Skip to content

Commit b912f12

Browse files
authored
Merge pull request #594 from TypeFox/mva-next
Updated to @codingame/[email protected]
2 parents 4996609 + 93f7ef5 commit b912f12

File tree

21 files changed

+531
-412
lines changed

21 files changed

+531
-412
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Linked packages are problenatic during build, npm i during start will fix it
2+
node_modules/example-client-vite
3+
node_modules/example-client-webpack
4+
node_modules/monaco-languageclient
5+
node_modules/monaco-languageclient-examples
6+
node_modules/vscode-ws-jsonrpc

README.md

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Click [here](https://www.typefox.io/blog/teaching-the-language-server-protocol-t
2424
- [Pure bundler verification](#pure-bundler-verification)
2525
- [Example usage](#example-usage)
2626
- [Server processes](#server-processes)
27+
- [JSON Language Server](#json-language-server)
28+
- [Pyright Language Server](#pyright-language-server)
29+
- [Groovy Language Server](#groovy-language-server)
2730
- [Verification Example Servers](#verification-example-servers)
2831
- [VSCode integration](#vscode-integration)
2932
- [Featured projects](#featured-projects)
@@ -86,12 +89,12 @@ With v7 we decided to use readily treemended version of monaco-editor called [@c
8689

8790
```yaml
8891
"overrides": {
89-
"monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.85.0 <1.86.0",
90-
"vscode": "npm:@codingame/monaco-vscode-api@>=1.85.0 <1.86.0"
92+
"monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.85.5 <1.86.0",
93+
"vscode": "npm:@codingame/monaco-vscode-api@>=1.85.5 <1.86.0"
9194
},
9295
"resolutions": {
93-
"monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.85.0 <1.86.0",
94-
"vscode": "npm:@codingame/monaco-vscode-api@>=1.85.0 <1.86.0"
96+
"monaco-editor": "npm:@codingame/monaco-editor-treemended@>=1.85.5 <1.86.0",
97+
"vscode": "npm:@codingame/monaco-vscode-api@>=1.85.5 <1.86.0"
9598
}
9699
```
97100

@@ -134,15 +137,17 @@ There are a couple of different examples that demonstrate how the `monaco-langua
134137
### Main Examples
135138

136139
- [JSON Language client and language server example](./packages/examples/src/json):
137-
- The **json-server** runs a Node.js [Express app](./packages/examples/src/json/server/main.ts) where web sockets are used to enable communication between the language server process and the client web application. The language server can be started as internal or external process. Use `npm run start:example:server:json` to start the language server (see [Server processes](#server-processes)).
138-
140+
- The **json-server** runs an external Node.js [Express app](./packages/examples/src/json/server/main.ts) where web sockets are used to enable communication between the language server process and the client web application (see [JSON Language Server](#json-language-server)).
139141
- The **json-client** contains the [client web app](./packages/examples/src/json/client/main.ts) which connects to the language server therefore requires the node server app to be run in parallel.
140142

141143
- [Python Language client and pyright language server example](./packages/examples/src/python):
142-
- The **python-server** runs a Node.js [Express app](./packages/examples/src/python/server/main.ts) where web sockets are used to enable communication between the language server process and the client web application. The language server can be started as internal or external process. Use `npm run start:example:server:python` to start the language server (see [Server processes](#server-processes)).
143-
144+
- The **python-server** runs an external Node.js [Express app](./packages/examples/src/python/server/main.ts) where web sockets are used to enable communication between the language server process and the client web application (see [Pyright Language Server](#pyright-language-server)).
144145
- The **python-client** contains the [client web app](./packages/examples/src/python/client/main.ts) which connects to the language server therefore requires the node server app to be run in parallel.
145146

147+
- [Groovy Language client and language server example](./packages/examples/src/groovy):
148+
- The **groovy-server** runs an external [Java app](./packages/examples/src/groovy/server/main.ts) where web sockets are used to enable communication between the language server process and the client web application ([Groovy Language Server](#groovy-language-server)).
149+
- The **groovy-client** contains the [client web app](./packages/examples/src/python/client/main.ts) which connects to the language server therefore requires the node server app to be run in parallel.
150+
146151
- Langium example:
147152
- Statemachine DSL (created with Langium) **statemachine-web-worker-language-server** example located in [./packages/examples/src/langium](./packages/examples/src/langium) contains both the [language client](./packages/examples/src/langium/statemachineClient.ts) and the [langauge server (web worker)](https://github.com/langium/langium/blob/main/examples/statemachine/src/language-server/main-browser.ts). The web worker example communicate via `vscode-languageserver-protocol/browser` instead of a web socket used in the **JSON examples** examples.
148153

@@ -169,20 +174,48 @@ There are a couple of different examples that demonstrate how the `monaco-langua
169174

170175
#### Server processes
171176

172-
For the **json-client** or the **client-webpack** examples you need to ensure the **json-server** example is running:
177+
##### JSON Language Server
178+
179+
For the **json-client**, **react-client** or the **client-webpack** examples you need to ensure the **json-server** example is running:
173180

174181
```shell
175182
# start the express server with the language server running in the same process.
176183
npm run start:example:server:json
177184
```
178185

179-
For the **python-client** example you need to ensure the **paython-server** example is running:
186+
##### Pyright Language Server
187+
188+
For the **python-client** example you need to ensure the **python-server** example is running:
180189

181190
```shell
182-
# start the express server with the language server running in an external node process.
191+
# start the express server with the language server running as external node process.
183192
npm run start:example:server:python
184193
```
185194

195+
##### Groovy Language Server
196+
197+
For the **groovy-client** example you need to ensure the **groovy-server** example is running:
198+
199+
**Preferred option**
200+
201+
Use **docker-compose** which does not require any manual setup (Java/Gradle). From the project root run `docker-compose -f ./packages/examples/resources/groovy/docker-compose.yml up -d`. First start up will take longer as the container is built. Use `docker-compose -f ./packages/examples/resources/groovy/docker-compose.yml down` to stop it.
202+
203+
**Secondary option**
204+
205+
**Preperation**: In another directory run (Requires Gradle 7 and OpenJDK 17):
206+
207+
```shell
208+
git clone https://github.com/GroovyLanguageServer/groovy-language-server
209+
./gradlew build
210+
```
211+
212+
Afterwards copy the jar file from from `groovy-language-server/build/libs/groovy-language-server-all.jar` to `packages/examples/resources/external/groovy`
213+
214+
```shell
215+
# start the express server with the language server running as external Java process.
216+
npm run start:example:server:groovy
217+
```
218+
186219
#### Verification Example Servers
187220

188221
If you want to reach the verification examples from the vite dev server index page you need to run the following additional http-servers beforehand (this is also indicated on the page itself):
@@ -301,7 +334,7 @@ loader.config({ monaco });
301334
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.
302335

303336
```json
304-
"vscode": "npm:@codingame/monaco-vscode-api@>=1.85.0 <1.86.0"
337+
"vscode": "npm:@codingame/monaco-vscode-api@>=1.85.5 <1.86.0"
305338
```
306339

307340
## Monaco-editor / @codingame/monaco-vscode-api compatibility table

docs/versions-and-history.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ The following table describes which version of **monaco-languageclient** and **@
66

77
| monaco-languageclient | monaco-vscode-api | monaco-editor-treemended | monaco-editor | release date | comment |
88
| :---- | :---- | :--- | :--- | :--- | :--- |
9+
| 7.4.0 | 1.85.5 | 1.85.5 | 0.45.0 | 2024-01-2x | |
910
| 7.3.0 | 1.85.0 | 1.85.0 | 0.45.0 | 2024-01-04 | |
1011
| 7.2.0 | 1.83.16 | 1.83.16 | 0.44.0 | 2023-12-07 | |
1112
| 7.1.0 | 1.83.12 | 1.83.12 | 0.44.0 | 2023-11-27 | |

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h3>Python language client and language server</h3>
2323
Please execute <b><code>npm run start:example:server:python</code></b> beforehand:<br>
2424
<a href="packages/examples/python.html">Client for Python Pyright Language Server</a>
2525
<h3>Groovy language client and language server</h3>
26-
Please execute <b><code>npm run start:example:server:groovy</code></b> beforehand:<br>
26+
Requires docker. Please execute <b><code>docker-compose -f ./packages/examples/resources/groovy/docker-compose.yml up -d</code></b> beforehand:<br>
2727
<a href="packages/examples/groovy.html">Client for Groovy Language Server</a>
2828
<h3>Langium client and language server</h3>
2929
<a href="packages/examples/statemachine_client.html">Client & Statemachine LS (Web Worker)</a><br>

0 commit comments

Comments
 (0)