Skip to content

is there a way to easily import "langium-grammar.langium"; ? #899

Answered by msujew
jdeantoni asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @jdeantoni,

I'm a bit suprised by Langium spitting out an internal error for this (it should show a validation message instead). In theory you should be able to reference it by using something like import "../node_modules/langium/src/language-server/langium-grammar"; (with as many .. as needed for your directory structure). The language server might complain until you remove the node_modules from the ignore pattern of the langium vscode settings.

Note that compared to Xtext, this effectively only copies the grammar rules and the interfaces/types and does not create actual relationships between the original objects of the language. You can of course still parse .langium files using you…

Replies: 2 comments 21 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by jdeantoni
Comment options

You must be logged in to vote
21 replies
@jdeantoni
Comment options

@msujew
Comment options

@jdeantoni
Comment options

@jdeantoni
Comment options

@msujew
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants