(node: ReferenceExpr, document: LangiumDocument<AstNode>, extraScopes: ScopeProvider[])
| 249 | } |
| 250 | |
| 251 | private resolveReference(node: ReferenceExpr, document: LangiumDocument<AstNode>, extraScopes: ScopeProvider[]) { |
| 252 | this.resolveDefault(node, document, extraScopes); |
| 253 | const target = node.target.ref; |
| 254 | |
| 255 | if (target) { |
| 256 | if (isCollectionPredicateBinding(target)) { |
| 257 | // collection predicate's binding is resolved to the element type of the collection |
| 258 | const collectionType = target.$container.left.$resolvedType; |
| 259 | if (collectionType) { |
| 260 | node.$resolvedType = { ...collectionType, array: false }; |
| 261 | } |
| 262 | } else if (isEnumField(target)) { |
| 263 | // enum field is resolved to its containing enum |
| 264 | this.resolveToBuiltinTypeOrDecl(node, target.$container); |
| 265 | } else if (isDataField(target) || isFunctionParam(target)) { |
| 266 | // other references are resolved to their declared type |
| 267 | this.resolveToDeclaredType(node, target.type); |
| 268 | } |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | private resolveArray(node: ArrayExpr, document: LangiumDocument<AstNode>, extraScopes: ScopeProvider[]) { |
| 273 | node.items.forEach((item) => this.resolve(item, document, extraScopes)); |
no test coverage detected