Closed RobertWalterU3d closed 2 years ago
Hey @RobertWalterU3d,
npm run langium:generate
only perform the Langium code generation (in TypeScript). These files then need to be compiled to JavaScript in order to run. Did you run npm run build
or npm run watch
afterwards?
Hi Mark,
I did not run those, I wasn't aware of that necessary additional step, thanks. Trying to run those gives me some errors in src/cli/generator.ts
and src/language-server/nano-validator.ts
. I assume these files are defaults that have been generated as part of running yo langium
and they depend on stuff that is generated from the original grammar (which I changed).
I think I can fix those easily by removing these generator/validator examples, thanks for your help.
My recommendation would be to consider adding a sentence or two to the end of the "getting started" guide that playing around with the grammar, as suggested there, also requires to run the build command and that those files depend on the grammar.
I tried Langium today for the first time. I followed the "Getting Started" guide and was able to debug the default "Hello World" example. Next, I changed the grammar to this:
and ran
npm run langium:generate
successfully. However, when I start another Code instance now, I'm getting this error:While the syntax (highlighting) has been updated successfully, the parser seems to have issues with this grammar. Any ideas why this is the case?
Langium version: 0.4.0 Package name:
Steps To Reproduce