Fixed an undefined
error on certain regexes in the monarch generator (#1594).
Fixed string escaping for generated code (#1537, #1514).
Exported the textmate syntax highlighting under langium-cli/textmate
. This enables importing the highlighting code for the Langium playground.
Fixed a minor issue related to generated code for projects that don't use the langium/lsp
import (#1393).
Some adjustments of the generated code due to the LSP bundling changes in Langium. For further information, see here.
Fix a bug that prevented usage of the JS API of the CLI package (#1160).
This package is now compiling to ESM only, refer to this changelog entry
- The CLI now always uses the original
projectName
of thelangium-config.json
property for the generated type/object names. It no longer performs kebab-case transformation (#1122). - We've decided to remove generated
$container
type declarations for types where it isn't clear what the container types can be (#1055).
With the introduction of langium-railroad
, the CLI is now capable of generating railroad syntax diagrams for your language (#1075).
To generate them to a file, use the following example config:
{
...
"languages": [{
...
"railroad": {
"out": "docs/syntax-diagram.html"
}
}],
...
}
Note The vscode extension for Langium contributes the
Show Railroad Syntax Diagram
command to show this HTML in a webview.
The generated ast.ts
file will now also contain an object containing all regular expressions used by your grammar's terminal rules (#1097).
This allows to more easily reuse those regular expressions in your code.
- The CLI can now resolve grammar imports transitively (#1113).
- A new
mode
configuration/argument can be used to improve bundle size of Langium projects (#1077). - Fixed an error in the way the CLI creates directories (#1105).
- The generated code now performs split imports for runtime and compile time dependencies (#1018).
- The new configuration field
importExtension
can be used to specify the file extension for generated imports (#1072).
The Langium CLI now features a generator for the prism syntax highlighter. The syntax highlighting for the Langium documentation is already making use of a generated prism.js file.
Enable the generator by adding it to your langium-config.json
file:
{
...
"languages": [{
...
"prism": {
"out": "syntax/prism.js"
}
}],
...
}
- Various improvements to the generated AST types (#845).
- The
--watch
mode now also watches referenced grammars, not only those directly used in the langium config file (#908).
- New command
extract-types
generates type declarations to be used in your grammar file (#754). This utility can be used to move from inferred types to declared types, which makes sense when your language project becomes more mature. - New reference format in JSON-serialized grammars (#787).
- Adapted to version
1.0.0
of the Langium core library.
- Added an option to generate syntax highlighting in the Monarch format (#620).
- Adapted to version
0.5.0
of the Langium core library.
This release brings lots of bug fixes and is adapted to version 0.4.0
of the Langium core library.
- Added support for importing other grammar files to state explicitly which rules should be included in your grammar (#311).
- Added support for explicit type declarations in the grammar (#406).
- Improved generated TextMate syntax highlighting (#289, #293, #312).
- Added support for case-insensitive parsing of keywords (#316).
- When parser validation errors occur, the file path and line number of the corresponding grammar rule is printed out (#372).
- In order to support multiple languages running in the same language server, the Langium configuration format was changed (#311). It now looks like this:
The
{ "projectName": "Arithmetics", "languages": [{ "id": "arithmetics", "grammar": "src/language-server/arithmetics.langium", "fileExtensions": [".calc"], "textMate": { "out": "syntaxes/arithmetics.tmLanguage.json" } }], "out": "src/language-server/generated" }
languages
array accepts multiple language configurations, which are then all generated at once.
- We no longer generate code for the parser, but derive it from the serialized grammar instead (#169).
- The target folder is deleted before new files are generated (#180). In case the target folder contains any files that are not regenerated, the CLI shows a question before deleting anything.
- The language configuration used by
langium-cli
is now read from a separate filelangium-config.json
by default (#158). Embedding it inpackage.json
is still supported. - Added the Chevrotain parser configuration to the Langium configuration (
chevrotainParserConfig
property, #248). Among other things, this enables setting the maximum lookahead. - The parser validation of Chevrotain is run as part of
langium-cli
to provide early feedback (#253). - The JSON content of the grammar is written to a TypeScript file instead of a
.json
file, simplifiying the build process (#142). - Some of the language meta data (language id and file extensions) are generated so they are available at runtime (#170).
- The
extensions
field in the Langium configuration was renamed tofileExtensions
(#173).