-
I'm having some issues with Cross-Referencing across two files. I have a language that has A and B nodes on the root, C nodes inside the A nodes and references to the C nodes inside the B nodes (sorry for not providing an actual example, I can provide one if necessary). I had to customize the The changelog from version 0.0.2 led me to believe that this is done by default, and it certainly looks like it. When I write the second file, the autocomplete for nodes on the first file works, and no "Could not resolve reference" errors appears. But when I try to generate the code from the file, I am greeted with a "Could not resolve reference" on the command-line. Any directions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey @Danfs64, it looks like your CLI doesn't load your workspace, but only a single file. I believe the CLI that's auto-generated by the yeoman generator only ever works on a single file that it accepts via the |
Beta Was this translation helpful? Give feedback.
Hey @Danfs64,
it looks like your CLI doesn't load your workspace, but only a single file. I believe the CLI that's auto-generated by the yeoman generator only ever works on a single file that it accepts via the
-f
argument. You will need to modify the CLI to load the whole workspace (or relevant files, like with ECMAScript-style imports). We do something similar in our ownlangium-cli
, where we only have a single entry point and load all documents that are referenced in one document:https://github.com/langium/langium/blob/cd5dc74ea1790bf7075e8c5d4f3607a6652b095e/packages/langium-cli/src/generate.ts#L63-L80