@zenstackhq/language 3.3.0-beta.4 → 3.3.0
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 +10 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/utils.cjs +9 -3
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +1 -1
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +9 -3
- package/dist/utils.js.map +1 -1
- package/package.json +5 -5
- package/res/stdlib.zmodel +5 -1
package/dist/index.js
CHANGED
|
@@ -5366,7 +5366,7 @@ function resolved(ref) {
|
|
|
5366
5366
|
return ref.ref;
|
|
5367
5367
|
}
|
|
5368
5368
|
__name(resolved, "resolved");
|
|
5369
|
-
function getRecursiveBases(decl, includeDelegate = true, seen = /* @__PURE__ */ new Set()) {
|
|
5369
|
+
function getRecursiveBases(decl, includeDelegate = true, documents, seen = /* @__PURE__ */ new Set()) {
|
|
5370
5370
|
const result = [];
|
|
5371
5371
|
if (seen.has(decl)) {
|
|
5372
5372
|
return result;
|
|
@@ -5379,13 +5379,19 @@ function getRecursiveBases(decl, includeDelegate = true, seen = /* @__PURE__ */
|
|
|
5379
5379
|
] : []
|
|
5380
5380
|
];
|
|
5381
5381
|
bases.forEach((base) => {
|
|
5382
|
-
|
|
5382
|
+
let baseDecl;
|
|
5383
|
+
if (base.ref && (isTypeDef(base.ref) || isDataModel(base.ref))) {
|
|
5384
|
+
baseDecl = base.ref;
|
|
5385
|
+
} else {
|
|
5386
|
+
const declarations = documents ? getAllDeclarationsIncludingImports(documents, decl.$container) : decl.$container.declarations;
|
|
5387
|
+
baseDecl = declarations.find((d) => (isTypeDef(d) || isDataModel(d)) && d.name === base.$refText);
|
|
5388
|
+
}
|
|
5383
5389
|
if (baseDecl) {
|
|
5384
5390
|
if (!includeDelegate && isDelegateModel(baseDecl)) {
|
|
5385
5391
|
return;
|
|
5386
5392
|
}
|
|
5387
5393
|
result.push(baseDecl);
|
|
5388
|
-
result.push(...getRecursiveBases(baseDecl, includeDelegate, seen));
|
|
5394
|
+
result.push(...getRecursiveBases(baseDecl, includeDelegate, documents, seen));
|
|
5389
5395
|
}
|
|
5390
5396
|
});
|
|
5391
5397
|
return result;
|
|
@@ -9042,7 +9048,7 @@ var ZModelScopeComputation = class extends DefaultScopeComputation {
|
|
|
9042
9048
|
processNode(node, document, scopes) {
|
|
9043
9049
|
super.processNode(node, document, scopes);
|
|
9044
9050
|
if (isDataModel(node) || isTypeDef(node)) {
|
|
9045
|
-
const bases = getRecursiveBases(node);
|
|
9051
|
+
const bases = getRecursiveBases(node, true, this.services.shared.workspace.LangiumDocuments);
|
|
9046
9052
|
for (const base of bases) {
|
|
9047
9053
|
for (const field of base.fields) {
|
|
9048
9054
|
scopes.add(node, this.descriptions.createDescription(field, this.nameProvider.getName(field)));
|