@zenstackhq/language 3.3.0-beta.4 → 3.3.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -5402,7 +5402,7 @@ function resolved(ref) {
5402
5402
  return ref.ref;
5403
5403
  }
5404
5404
  __name(resolved, "resolved");
5405
- function getRecursiveBases(decl, includeDelegate = true, seen = /* @__PURE__ */ new Set()) {
5405
+ function getRecursiveBases(decl, includeDelegate = true, documents, seen = /* @__PURE__ */ new Set()) {
5406
5406
  const result = [];
5407
5407
  if (seen.has(decl)) {
5408
5408
  return result;
@@ -5415,13 +5415,19 @@ function getRecursiveBases(decl, includeDelegate = true, seen = /* @__PURE__ */
5415
5415
  ] : []
5416
5416
  ];
5417
5417
  bases.forEach((base) => {
5418
- const baseDecl = decl.$container.declarations.find((d) => (isTypeDef(d) || isDataModel(d)) && d.name === base.$refText);
5418
+ let baseDecl;
5419
+ if (base.ref && (isTypeDef(base.ref) || isDataModel(base.ref))) {
5420
+ baseDecl = base.ref;
5421
+ } else {
5422
+ const declarations = documents ? getAllDeclarationsIncludingImports(documents, decl.$container) : decl.$container.declarations;
5423
+ baseDecl = declarations.find((d) => (isTypeDef(d) || isDataModel(d)) && d.name === base.$refText);
5424
+ }
5419
5425
  if (baseDecl) {
5420
5426
  if (!includeDelegate && isDelegateModel(baseDecl)) {
5421
5427
  return;
5422
5428
  }
5423
5429
  result.push(baseDecl);
5424
- result.push(...getRecursiveBases(baseDecl, includeDelegate, seen));
5430
+ result.push(...getRecursiveBases(baseDecl, includeDelegate, documents, seen));
5425
5431
  }
5426
5432
  });
5427
5433
  return result;
@@ -9078,7 +9084,7 @@ var ZModelScopeComputation = class extends import_langium11.DefaultScopeComputat
9078
9084
  processNode(node, document, scopes) {
9079
9085
  super.processNode(node, document, scopes);
9080
9086
  if (isDataModel(node) || isTypeDef(node)) {
9081
- const bases = getRecursiveBases(node);
9087
+ const bases = getRecursiveBases(node, true, this.services.shared.workspace.LangiumDocuments);
9082
9088
  for (const base of bases) {
9083
9089
  for (const field of base.fields) {
9084
9090
  scopes.add(node, this.descriptions.createDescription(field, this.nameProvider.getName(field)));