You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -134,15 +137,17 @@ There are a couple of different examples that demonstrate how the `monaco-langua
134
137
### Main Examples
135
138
136
139
-[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)).
139
141
- 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.
140
142
141
143
-[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)).
144
145
- 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.
145
146
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
+
146
151
- Langium example:
147
152
- 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.
148
153
@@ -169,20 +174,48 @@ There are a couple of different examples that demonstrate how the `monaco-langua
169
174
170
175
#### Server processes
171
176
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:
173
180
174
181
```shell
175
182
# start the express server with the language server running in the same process.
176
183
npm run start:example:server:json
177
184
```
178
185
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:
180
189
181
190
```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.
183
192
npm run start:example:server:python
184
193
```
185
194
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):
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
+
186
219
#### Verification Example Servers
187
220
188
221
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 });
301
334
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.
0 commit comments