|
Hi Langium folks, Really cool tool. I really want to support "inline" definitions in my DSL, but that seems to break autocomplete. Any idea on how to debug or resolve? I see getCompletion being called, but not completionFor. I tried to create a simple example based off of hello world. Langium The DSL file cat2 technically works once it is all typed out (I can rename symbol for example). It is just the suggestions do not appear like they do when defining top level. Thanks! |
Replies: 1 comment 11 replies
|
Hey @Kheirlb, I've restructured your grammar a bit, so this use case is supported (at least within the same greeting chain). See this playground link. In here, To explain this a bit in detail: When defining an element inline (or rather, further down in the abstract syntax tree), it is only visible for its own sibling elements and its descendents. This is the default behavior, because it essentially implements lexical scoping from other programming languages and is useful for most languages. This behavior can be changed by adjusting the The fix in the |
0.4.3 will work, but requires a new Langium release. I'll get out a patch release later today. 0.4.2 unfortunately broke some behavior, see #2146.
Edit: Langium 4.2.3 with that update has been released.