eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
754 stars 68 forks source link

Wrong range of subexpression in arithmetics example #145

Closed pluralia closed 3 years ago

pluralia commented 3 years ago

Subexpressions can lose their $cstNode field, and it's impossible to determine their range in a document.

Langium version: 0.1.0 Package name: langium

Steps To Reproduce

  1. Open VSCode with arithmetics extension
  2. Open example/example1.calc file
  3. 1 + 3 in 3rd line has to be highlighted [because of a validation error], however, a module keyword is highlighted

The current behavior

module keyword is highlighted instead of the subexpression

The expected behavior

The subexpression is highlighted

msujew commented 3 years ago

Right now, left recursive expressions are missing their $cstNode properties, since they skip the whole LangiumParser.construct call. I'll work on that.