Closed spoenemann closed 2 months ago
nice
Really nice! One concern I have found is scoping. When there is a cross-reference that needs to be resolved, the scope provider writer cannot assume anymore that there are "natural" parents given. Like getContainerOfType
would just return undefined, where actually a node is always expected, due to the nature of a translation unit (Like every statement is in a unit. When we only parse a statement we cannot go up to the outer scope). I am wondering how we should reflect this in the documentation...
If you use this new feature, you should be aware of the potentially added complexity. Scoping may be completely broken. If you want to support resolving references with a partial model, you need to consider that explicitly in your custom scope provider. The generic one shouldn't have any issues.
See discussion #1404. This PR adds an option to
LangiumParser
so one can change the entry rule used for parsing a given text.