Skip to content

Variable prefixes and crossref #1316

Answered by msujew
lou1306 asked this question in Q&A
Dec 11, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hey @lou1306,

you're already doing well by using PROPREF as part of the reference. I.e. by using variable=[Prop:PROPREF].

For the second part, this becomes a bit less trivial. Langium exposes an AST element always by its canonical name. By default, this is the name that you assign using the name AST property. I.e. if you name an element var, it will only be addressable by the name var. If you want to give it a different (or even multiple) canonical names, you will need to modify the ScopeComputation service. We have a guide on how to do that here. The guide uses fully qualified name scoping, but that is also just another way of exposing an element using a different name (a fully qualified…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lou1306
Comment options

Answer selected by lou1306
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