Closed
Description
Langium version: 3.1.1 (extension)
Package name: langium
Steps To Reproduce
- Create a .langium file with an alternation rule like:
NumberTypeSpecialization:
{infer Int} 'Int' |
{infer Float} 'Float' |
{infer Decimal} 'Decimal';
- Activate the format on Langium files
The current behavior
The formatter removes the first option in alternation rules, resulting in:
NumberTypeSpecialization:
|
{infer Float} 'Float' |
{infer Decimal} 'Decimal';
This occurs for any rule that starts with an alternation (|).
The expected behavior
The formatter should preserve all options in alternation rules, maintaining the original structure:
NumberTypeSpecialization:
{infer Int} 'Int' |
{infer Float} 'Float' |
{infer Decimal} 'Decimal';