Closed jiashengguo closed 1 year ago
Oh, that's not good. The issue is very likely due to https://github.com/langium/langium/pull/845 and an unintended breakage in the grammar. In theory the breakage is only internal (i.e. no externally facing API has changed), but in practice it will require users to regenerate their grammar to fit with the new grammar structure. That's my bad, sorry. I've just created https://github.com/langium/langium/pull/939 to make users aware of this issue.
We actually changed our generated package.json for a similar reason. We recommend users of Langium to use the ~
package resolution to prevent breakages accidentally sneaking into their package. The issue is that Langium's large API surface makes it impossible to change anything without breaking some code.
Langium version: 1.1.0 Package name: langium
Steps To Reproduce
The current behavior
An unexpected error occurred: Error: Could not find name assignment for type: TypeDeclaration at buildCrossReference (/Users/jiasheng/branch/bug/node_modules/langium/lib/parser/parser-builder-base.js:236:19) at buildElement (/Users/jiasheng/branch/bug/node_modules/langium/lib/parser/parser-builder-base.js:47:18) at buildElement (/Users/jiasheng/branch/bug/node_modules/langium/lib/parser/parser-builder-base.js:44:18) at buildAlternatives (/Users/jiasheng/branch/bug/node_modules/langium/lib/parser/parser-builder-base.js:136:22) at buildElement (/Users/jiasheng/branch/bug/node_modules/langium/lib/parser/parser-builder-base.js:53:18) at /Users/jiasheng/branch/bug/node_modules/langium/lib/parser/parser-builder-base.js:219:45 at Array.map ()
at buildGroup (/Users/jiasheng/branch/bug/node_modules/langium/lib/parser/parser-builder-base.js:219:36)
at buildElement (/Users/jiasheng/branch/bug/node_modules/langium/lib/parser/parser-builder-base.js:59:18)
The expected behavior:
No error
Description
The command is to parse the
schema.zmodel
file in the project using the below grammar file https://github.com/zenstackhq/zenstack/blob/main/packages/language/src/zmodel.langiumif you downgrade the Langium to 1.0.1, then it works. Is there any grammar-breaking change for 1.1.0?