Skip to content

Commit

Permalink
More code comments and add Langium link in README
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisalmen committed Aug 18, 2023
1 parent 323145d commit d121def
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ There are a couple of different examples that demonstrate how the `monaco-langua

- The **client** example located in [./packages/examples/main/src/client](./packages/examples/main/src/client) contains the [client web app](./packages/examples/main/src/client/main.ts) which connects to the language server therefore requires the node server app to be run in parallel.

- Langium grammar language **langium-web-worker-language-server** example located in [./packages/examples/main/src/langium](./packages/examples/main/src/langium) contains both the [language client](./packages/examples/main/src/langium/langiumClient.ts) and the [langauge server (web worker)](./packages/examples/main/src/langium/langiumServerWorker.ts).
- [Langium](https://github.com/eclipse-langium/langium) grammar language **langium-web-worker-language-server** example located in [./packages/examples/main/src/langium](./packages/examples/main/src/langium) contains both the [language client](./packages/examples/main/src/langium/langiumClient.ts) and the [langauge server (web worker)](./packages/examples/main/src/langium/langiumServerWorker.ts).

- Statemachine DSL **statemachine-web-worker-language-server** example located in [./packages/examples/main/src/langium](./packages/examples/main/src/langium) contains both the [language client](./packages/examples/main/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).
- Statemachine DSL (created with Langium) **statemachine-web-worker-language-server** example located in [./packages/examples/main/src/langium](./packages/examples/main/src/langium) contains both the [language client](./packages/examples/main/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).

Both web worker examples communicate via `vscode-languageserver-protocol/browser` instead of a web socket used in the **server/client** examples.

Expand Down
3 changes: 3 additions & 0 deletions packages/examples/main/src/langium/langiumClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ let textModelRef: IReference<ITextFileEditorModel>;

const setup = async () => {
console.log('Setting up Langium client configuration ...');
// define this client as vscode extension, required for textmate grammars
const extension = {
name: 'langium-client',
publisher: 'monaco-languageclient-project',
Expand All @@ -39,11 +40,13 @@ const setup = async () => {
aliases: [
languageId
],
// files are loaded below and bind below
configuration: './langium-configuration.json'
}],
grammars: [{
language: languageId,
scopeName: 'source.langium',
// files are loaded below and bind below
path: './langium-grammar.json'
}]
}
Expand Down

0 comments on commit d121def

Please sign in to comment.