-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: Update generator documentation inside the repo
- Loading branch information
Showing
9 changed files
with
120 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Workspace overview | ||
|
||
Depending on the selection during the project generation you will have one or more packages contained in the packages directory. Check the : | ||
|
||
- [packages/language](./packages/language/README.md) is always available and contains the language definition. | ||
- [packages/cli](./packages/cli/README.md) *Optional* Is only available if you chose to use the command-line interface. | ||
- [packages/extension](./packages/extension/langium-quickstart.md) *Optional* Contains the VSCode extension if you chose to create it. | ||
- [packages/web](./packages/web/README.md) *Optional* if selected contains the language server running in a web browser and a monaco-editor with language support similar to the onm from VSCode. | ||
|
||
## What's in the folder? | ||
|
||
- [.eslintrc.json](.eslintrc.json) - Configuration file for eslint | ||
- [.gitignore](.gitignore) - Files ignored by git | ||
- [package.json](./package.json) - The manifest file the main workspace package | ||
- [tsconfig.json](./tsconfig.json) - The base TypeScript compiler configuration | ||
- [tsconfig.build.json](./package.json) - Configuration used to build the complete source code. |
19 changes: 19 additions & 0 deletions
19
packages/generator-langium/templates/packages/cli/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Command-line interface (CLI) | ||
|
||
Check [this part](https://langium.org/docs/learn/minilogo/customizing_cli/) of the Langium Minilogo Tutorial as a useful guide to the CLI. | ||
|
||
## What's in the folder? | ||
|
||
- [package.json](./package.json) - The manifest file of your cli package. | ||
- [tsconfig.src.json](./tsconfig.src.json) - The package specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) | ||
- [tsconfig.json](./tsconfig.json) - TypeScript compiler configuration options required for proper functionality of VSCode. | ||
- [src/cli/main.ts](src/cli/main.ts) - the entry point of the command line interface (CLI) of your language. | ||
- [src/cli/generator.ts](src/cli/generator.ts) - the code generator used by the CLI to write output files from DSL documents. | ||
- [src/cli/util.ts](src/cli/util.ts) - utility code for the CLI. | ||
|
||
If you selected the test option as well, then you have the following for file as well: | ||
|
||
- [tsconfig.test.json](./tsconfig.test.json) - The package specific TypeScript compiler configuration for the unit tests extending the [tsconfig.src.config](tsconfig.src.json) | ||
- [test/linking.test.ts](test/linking.test.ts) - Unit tests checking linking. | ||
- [test/parsing.test.ts](test/parsing.test.ts) - Unit tests regarding parsing. | ||
- [test/validating.test.ts](test/validating.test.ts) - Unit tests regarding validation. |
37 changes: 37 additions & 0 deletions
37
packages/generator-langium/templates/packages/extension/langium-quickstart.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Langium VS Code Extension | ||
|
||
Welcome to your Langium VSCode extension. This folder contains all necessary files for your language extension. | ||
|
||
## What's in the folder? | ||
|
||
- [package.json](./package.json) - the manifest file in which you declare your language support. | ||
- [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) | ||
- [esbuid.mjs](esbuild.mjs) - Configuration file for esbuild that is used to create the VSCode extension bundle. | ||
- [language-configuration.json](language-configuration.json) - the language configuration used in the VS Code editor, defining the tokens that are used for comments and brackets. | ||
- [src/language/main.ts](src/language/main.ts) - the entry point of the language server process. | ||
- [src/extension/main.ts](src/extension/main.ts) - the main code of the extension, which is responsible for launching a language server and client. | ||
|
||
## Get up and running straight away | ||
|
||
- Run `npm run langium:generate` to generate TypeScript code from the grammar definition. | ||
- Run `npm run build` to compile all TypeScript code. | ||
- Press `F5` to open a new window with your extension loaded. | ||
- Create a new file with a file name suffix matching your language. | ||
- Verify that syntax highlighting, validation, completion etc. are working as expected. | ||
- Run `node ./bin/cli` to see options for the CLI; `node ./bin/cli generate <file>` generates code for a given DSL file. | ||
|
||
## Make changes | ||
|
||
- Run `npm run watch` to have the TypeScript compiler run automatically after every change of the source files. | ||
- Run `npm run langium:watch` to have the Langium generator run automatically after every change of the grammar declaration. | ||
- You can relaunch the extension from the debug toolbar after making changes to the files listed above. | ||
- You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. | ||
|
||
## Install your extension | ||
|
||
- To start using your extension with VS Code, copy it into the `<user home>/.vscode/extensions` folder and restart Code. | ||
- To share your extension with the world, read the [VS Code documentation](https://code.visualstudio.com/api/working-with-extensions/publishing-extension) about publishing an extension. | ||
|
||
## To Go Further | ||
|
||
Documentation about the Langium framework is available at <https://langium.org> |
10 changes: 0 additions & 10 deletions
10
packages/generator-langium/templates/packages/language/.vscode-extensions.json
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
packages/generator-langium/templates/packages/language/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# The mandatory language package | ||
|
||
As a good entry point to our documentation, please use to this [guide](https://langium.org/docs/learn/workflow/write_grammar/). | ||
|
||
## What's in the folder? | ||
|
||
- [package.json](./package.json) - The manifest file of your language package. | ||
- [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) | ||
- [src/<%= language-id %>.langium](src/<%= language-id %>.langium) - the grammar definition of your language | ||
- [src/<%= language-id %>-module.ts](src/<%= language-id %>-module.ts) - the dependency injection module of your language implementation. Use this to register overridden and added services. | ||
- [src/<%= language-id %>-validator.ts](src/<%= language-id %>-validator.ts) - an example validator. You should change it to reflect the semantics of your language | ||
- [src/generated/ast.ts](src/generated/ast.ts) - Generated AST | ||
- [src/generated/grammar.ts](src/generated/grammar.ts) - Generated Grammar | ||
- [src/generated/module.ts](src/generated/module.ts) - Generated Module | ||
- [src/syntaxes/<%= language-id %>.monarch.ts](src/syntaxes/<%= language-id %>.monarch.ts) - Monarch based syntax highlighting instructions | ||
- [syntaxes/<%= language-id %>.tmLanguage.json](syntaxes/<%= language-id %>.tmLanguage.json) - Textmate based syntax highlighting instructions | ||
- [src/index.ts](src/index.ts) Defines what is exported to other packages. |
41 changes: 0 additions & 41 deletions
41
packages/generator-langium/templates/packages/language/langium-quickstart.md
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
packages/generator-langium/templates/packages/web/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Web-based editor and language server | ||
|
||
How the web based editor works is well defined [here](https://langium.org/docs/learn/minilogo/langium_and_monaco). | ||
|
||
## What's in the folder? | ||
|
||
- [index.html](index.html) - Entry page that let's you decide which web editor version is used. | ||
- [language-configuration.json](language-configuration.json) - the language configuration used in the web editor, defining the tokens that are used for comments and brackets. | ||
- [package.json](./package.json) - The manifest file of your web editor package. | ||
- [src/main-browser.ts](src/main-browser.ts) - The the language server running in a web worker. | ||
- [src/setupClassic.ts](src/setupClassic.ts) - Create monaco-editor with classic configuration (monarch sytax highlighting) | ||
- [src/setupCommon.ts](src/setupCommon.ts) - Common settings for monaco-editor | ||
- [src/setupExtended.ts](src/setupExtended.ts) - Create monaco-editor with extended configuration (textmate sytax highlighting) | ||
- [static/monacoClassic.html](static/monacoClassic.html) - Page for classic monaco-editor | ||
- [static/monacoExtended.html](static/monacoExtended.html) - Page for extended monaco-editor | ||
- [static/styles.css](static/styles.css) - Stylesheets used by the HTML pages | ||
- [tsconfig.json](./tsconfig.json) - The packages specific TypeScript compiler configuration extending the [base config](../../tsconfig.json) | ||
- [vite.config.ts](vite.config.ts) - Vite/rollup production build instructions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters