MCPcopy Index your code
hub / github.com/zenstackhq/zenstack / getAllLoadedDataModelsAndTypeDefs

Function getAllLoadedDataModelsAndTypeDefs

packages/language/src/utils.ts:569–574  ·  view source on GitHub ↗
(langiumDocuments: LangiumDocuments)

Source from the content-addressed store, hash-verified

567 * Gets all data models and type defs from the given documents registry.
568 */
569export 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.

Calls 2

isDataModelFunction · 0.90
isTypeDefFunction · 0.90

Tested by

no test coverage detected