(langiumDocuments: LangiumDocuments)
| 567 | * Gets all data models and type defs from the given documents registry. |
| 568 | */ |
| 569 | export function getAllLoadedDataModelsAndTypeDefs(langiumDocuments: LangiumDocuments) { |
| 570 | return langiumDocuments.all |
| 571 | .map((doc) => doc.parseResult.value as Model) |
| 572 | .flatMap((model) => model.declarations.filter((d): d is DataModel | TypeDef => isDataModel(d) || isTypeDef(d))) |
| 573 | .toArray(); |
| 574 | } |
| 575 | |
| 576 | /** |
| 577 | * Gets all data models from the given documents registry and the transitive imports of the given model. |
no test coverage detected