Skip to content

Commit 80075ce

Browse files
committed
add comment explaining necessity of scope provider
1 parent 3c588d0 commit 80075ce

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/language/references/ContextMapperDslScopeProvider.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import {
88
} from '../generated/ast.js'
99

1010
export class ContextMapperDslScopeProvider extends DefaultScopeProvider {
11+
/*
12+
Some ContextMapper elements are not defined on the top-level of the document and should still be referencable.
13+
Langium assumes nested elements to not be in global scope.
14+
Therefore, nested elements are explicitly added to the scope, while for other elements the Langium default behavior applies.
15+
*/
1116
override getScope (context: ReferenceInfo): Scope {
1217
const referenceType = this.reflection.getReferenceType(context)
1318
const model = AstUtils.getContainerOfType(context.container, isContextMappingModel)!

0 commit comments

Comments
 (0)