You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I come from Xtext (we have some big DSLs defined in Xtext) and investigate switching to Langium. I am not yet an expert in TypeScript, Node.js and VSCode.
One important point is "ScopeProvider" logic. As far as I have understood, the default logic for ScopeProvider differs in following points:
in Xtext the generated MyGrammarDslScopeProvider can be filled with methods with signature public IScope scope_TargetType(ContextType ctx, EReference reference) or public IScope scope_ReferenceContainingType_ReferenceName(ContextType ctx, EReference reference) which are automatically called from AbstractDeclarativeScopeProvider.polymorphicFindScopeForReferenceName() and AbstractDeclarativeScopeProvider.polymorphicFindScopeForClassName(), walking the eContainer path from the current AST node to the root node. I can't find anything similar in Langium. Instead I have to implement a ScopeProvider (extending DefaultScopeProvider) without any implementation support like AbstractDeclarativeScopeProvider.polymorphicFindScopeFor... Is this correct? Is it planned to implement a similar approach in the future?
global scope ("index") - Xtext's DefaultGlobalScopeProvider loops over all "visible containers". These are all models of my language which are contained in the classpath. In Langium (AFAIK) all models are processed which belong to the "workspaceFolders" of VSCode (and sub folders). How can I include models which are contained in another node_module I depend on (having a base node.js project which contains some base models)?
The logic for determination of the local scope in Xtext and Langium seems to be identical (as described in DefaultScopeComputation.ts), am I right? (thank you for inline doc, that's missing in Xtext)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I come from Xtext (we have some big DSLs defined in Xtext) and investigate switching to Langium. I am not yet an expert in TypeScript, Node.js and VSCode.
One important point is "ScopeProvider" logic. As far as I have understood, the default logic for ScopeProvider differs in following points:
public IScope scope_TargetType(ContextType ctx, EReference reference)
orpublic IScope scope_ReferenceContainingType_ReferenceName(ContextType ctx, EReference reference)
which are automatically called fromAbstractDeclarativeScopeProvider.polymorphicFindScopeForReferenceName()
andAbstractDeclarativeScopeProvider.polymorphicFindScopeForClassName()
, walking the eContainer path from the current AST node to the root node. I can't find anything similar in Langium. Instead I have to implement a ScopeProvider (extending DefaultScopeProvider) without any implementation support like AbstractDeclarativeScopeProvider.polymorphicFindScopeFor... Is this correct? Is it planned to implement a similar approach in the future?The logic for determination of the local scope in Xtext and Langium seems to be identical (as described in DefaultScopeComputation.ts), am I right? (thank you for inline doc, that's missing in Xtext)
Beta Was this translation helpful? Give feedback.
All reactions