Skip to content

Commit b0b7723

Browse files
committed
Update repository readme
1 parent 8e86d0e commit b0b7723

1 file changed

Lines changed: 35 additions & 2 deletions

File tree

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,35 @@
1-
# anytext-generator
2-
Yeoman Generator for AnyText
1+
# NMF AnyText Generator
2+
3+
This [Yeoman](https://yeoman.io) generator is used to create a new [AnyText](https://github.com/NMFCode/NMF/) extension for VS Code. AnyText is a language workbench with an incremental packrat parser supporting left recursions, so you do not have to worry about left recursion or an interaction between lexer and parser when designing your language.
4+
5+
## Prerequisites
6+
7+
AnyText requires a .NET 8 or .NET 9 SDK to be installed. To install it, follow the [instructions](https://github.com/dotnet/core/blob/main/release-notes/9.0/install.md) provided by Microsoft. Then, the generator itself can be installed via NPM. We recommend a systemwide installation.
8+
9+
```bash
10+
npm install generator-anytext --global --save-dev
11+
```
12+
13+
## Using the generator
14+
15+
The code generator scaffolds a new AnyText project. You can start it via the command line as follows:
16+
17+
```bash
18+
yo anytext
19+
```
20+
21+
This will ask you a range of questions, like the name of your language and a repository link. Based on this information, the code generator will generate a new directory with the following artifacts already set up for you:
22+
23+
* An AnyText grammar document with an example grammar
24+
* A file to manually fine-tune editor services for the generated parser
25+
* A C# project that creates an LSP server of your grammar
26+
* A Visual Studio Code extension that integrates the LSP server
27+
* Visual Studio Code launch configurations such that you can easily debug your VS Code extension
28+
29+
These artifacts are set up such that they integrate with each other. For example, the build directory of the LSP server is exactly where the VS Code extension is expecting it. Because the code generator also compiles the sources, you can start the extension straight away. Also, you can immediately use `vsce` to pack your extension into a deployable VSIX file.
30+
31+
The extension project also contains scripts that allow you to easily regenerate the grammar and metamodel code once you did some changes.
32+
33+
## Launching the new extension
34+
35+
Because the code generator produces launch configurations for Visual Studio Code, you can easily start the extension via the *Run and Debug* section of Visual Studio Code when opening the newly created directory in Visual Studio Code.

0 commit comments

Comments
 (0)