@dbml/parse 9.0.0-optional-ref.2 → 9.0.0-optional-ref.3
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/dbml-parse.js +13 -13
- package/dist/dbml-parse.mjs +888 -879
- package/dist/src/core/types/schemaJson/index.d.ts +2 -0
- package/dist/src/core/types/{schemaJson.d.ts → schemaJson/types.d.ts} +4 -4
- package/dist/src/core/types/schemaJson/utils.d.ts +3 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +2 -2
package/dist/dbml-parse.mjs
CHANGED
|
@@ -7123,17 +7123,26 @@ function Lm(e) {
|
|
|
7123
7123
|
return e == null ? e : Array.isArray(e) ? e.map(String).join("\0") : typeof e == "object" && "intern" in e ? e.intern() : e;
|
|
7124
7124
|
}
|
|
7125
7125
|
//#endregion
|
|
7126
|
-
//#region src/core/types/schemaJson.ts
|
|
7126
|
+
//#region src/core/types/schemaJson/types.ts
|
|
7127
7127
|
var Rm = /* @__PURE__ */ function(e) {
|
|
7128
7128
|
return e.Table = "table", e;
|
|
7129
|
-
}({})
|
|
7129
|
+
}({});
|
|
7130
|
+
//#endregion
|
|
7131
|
+
//#region src/core/types/schemaJson/utils.ts
|
|
7132
|
+
function zm(e, t) {
|
|
7133
|
+
let n = !!(e.pk || e.unique), r = !!(t.pk || t.unique), i = !!e.not_null, a = !!t.not_null;
|
|
7134
|
+
return [n ? a ? "1" : nf : a ? "*" : af, r ? i ? "1" : nf : i ? "*" : af];
|
|
7135
|
+
}
|
|
7136
|
+
//#endregion
|
|
7137
|
+
//#region src/core/global_modules/diagramView/index.ts
|
|
7138
|
+
var Bm = {
|
|
7130
7139
|
getDuplicateError(e, t, n) {
|
|
7131
7140
|
return new D(E.DUPLICATE_NAME, `DiagramView '${e}' already exists in schema '${t}'`, n);
|
|
7132
7141
|
},
|
|
7133
7142
|
getFieldDuplicateError(e, t, n) {
|
|
7134
7143
|
return new D(E.DUPLICATE_DIAGRAMVIEW_FIELD, `Duplicate ${t} ${e}`, n);
|
|
7135
7144
|
}
|
|
7136
|
-
},
|
|
7145
|
+
}, Vm = {
|
|
7137
7146
|
nodeSymbol(i, a) {
|
|
7138
7147
|
let o = i.nodeFullname(a).getFiltered(t)?.at(-1);
|
|
7139
7148
|
return M(a, r.DiagramView) ? new n(i.symbolFactory.create(Ip, {
|
|
@@ -7158,10 +7167,10 @@ var Rm = /* @__PURE__ */ function(e) {
|
|
|
7158
7167
|
},
|
|
7159
7168
|
nodeReferee(i, a) {
|
|
7160
7169
|
if (a.parent && Lf(a)) return n.create(e);
|
|
7161
|
-
let o =
|
|
7170
|
+
let o = Hm(a);
|
|
7162
7171
|
if (!o) return n.create(e);
|
|
7163
7172
|
let s = i.parseFile(a.filepath).getValue().ast, c = i.nodeSymbol(s).getFiltered(t);
|
|
7164
|
-
return c ? o.isKind(r.DiagramViewTables) ?
|
|
7173
|
+
return c ? o.isKind(r.DiagramViewTables) ? Um(i, c, a) : o.isKind(r.DiagramViewNotes) ? Wm(i, c, a, R.StickyNote) : o.isKind(r.DiagramViewTableGroups) ? Wm(i, c, a, R.TableGroup) : o.isKind(r.DiagramViewSchemas) ? Gm(i, c, a) : n.create(e) : n.create(void 0);
|
|
7165
7174
|
},
|
|
7166
7175
|
symbolMembers(i, a) {
|
|
7167
7176
|
if (!a.isKind(R.DiagramView)) return n.create(e);
|
|
@@ -7176,10 +7185,10 @@ var Rm = /* @__PURE__ */ function(e) {
|
|
|
7176
7185
|
let l = /* @__PURE__ */ new Map();
|
|
7177
7186
|
for (let e of c) {
|
|
7178
7187
|
if (!e.isKind(R.DiagramViewSchema, R.DiagramViewTableGroup, R.DiagramViewTable, R.DiagramViewNote) || !e.declaration) continue;
|
|
7179
|
-
let n = (i.nodeFullname(e.declaration).getFiltered(t) || []).map(
|
|
7188
|
+
let n = (i.nodeFullname(e.declaration).getFiltered(t) || []).map(Mg).join("."), r = `${e.kind}:${n}`;
|
|
7180
7189
|
if (n !== void 0) {
|
|
7181
7190
|
let t = e.declaration, i = l.get(r);
|
|
7182
|
-
i ? (s.push(
|
|
7191
|
+
i ? (s.push(Bm.getFieldDuplicateError(n, e.kind, i)), s.push(Bm.getFieldDuplicateError(n, e.kind, t))) : l.set(r, t);
|
|
7183
7192
|
}
|
|
7184
7193
|
}
|
|
7185
7194
|
return n.create(c, s);
|
|
@@ -7193,7 +7202,7 @@ var Rm = /* @__PURE__ */ function(e) {
|
|
|
7193
7202
|
return r instanceof Ip ? r.declaration instanceof V ? new Im(t, r.declaration, r, i).interpret() : n.create(void 0) : n.create(e);
|
|
7194
7203
|
}
|
|
7195
7204
|
};
|
|
7196
|
-
function
|
|
7205
|
+
function Hm(e) {
|
|
7197
7206
|
let t = e.parentOfKind(U);
|
|
7198
7207
|
if (!t) return;
|
|
7199
7208
|
let n = t.parentNode;
|
|
@@ -7205,7 +7214,7 @@ function Vm(e) {
|
|
|
7205
7214
|
let o = a.parentNode;
|
|
7206
7215
|
if (!(!(o instanceof V) || !o.isKind(r.DiagramView))) return i;
|
|
7207
7216
|
}
|
|
7208
|
-
function
|
|
7217
|
+
function Um(e, r, i) {
|
|
7209
7218
|
let a = ep(i);
|
|
7210
7219
|
if (a === void 0) return n.create(void 0);
|
|
7211
7220
|
if (j(i.parentNode)) {
|
|
@@ -7228,13 +7237,13 @@ function Hm(e, r, i) {
|
|
|
7228
7237
|
let s = e.lookupMembers(r, R.Table, a);
|
|
7229
7238
|
return s ? n.create(s) : new n(void 0, [new D(E.BINDING_ERROR, `Could not find table '${a}'`, i)]);
|
|
7230
7239
|
}
|
|
7231
|
-
function
|
|
7240
|
+
function Wm(e, t, r, i) {
|
|
7232
7241
|
let a = ep(r);
|
|
7233
7242
|
if (a === void 0) return n.create(void 0);
|
|
7234
7243
|
let o = e.lookupMembers(t, i, a);
|
|
7235
7244
|
return o ? n.create(o) : new n(void 0, [new D(E.BINDING_ERROR, `Could not find ${i === R.StickyNote ? "note" : "tablegroup"} '${a}'`, r)]);
|
|
7236
7245
|
}
|
|
7237
|
-
function
|
|
7246
|
+
function Gm(e, t, r) {
|
|
7238
7247
|
let i = ep(r);
|
|
7239
7248
|
if (i === void 0) return n.create(void 0);
|
|
7240
7249
|
let a = e.lookupMembers(t, R.Schema, i);
|
|
@@ -7242,7 +7251,7 @@ function Wm(e, t, r) {
|
|
|
7242
7251
|
}
|
|
7243
7252
|
//#endregion
|
|
7244
7253
|
//#region src/core/global_modules/enum/bind.ts
|
|
7245
|
-
var
|
|
7254
|
+
var Km = class {
|
|
7246
7255
|
constructor(e, t) {
|
|
7247
7256
|
this.compiler = e, this.declarationNode = t;
|
|
7248
7257
|
}
|
|
@@ -7257,7 +7266,7 @@ var Gm = class {
|
|
|
7257
7266
|
bindSubElements(e) {
|
|
7258
7267
|
return e.flatMap((e) => e.type ? this.compiler.bindNode(e).getErrors() : []);
|
|
7259
7268
|
}
|
|
7260
|
-
},
|
|
7269
|
+
}, qm = class {
|
|
7261
7270
|
constructor(e, t, n) {
|
|
7262
7271
|
this.compiler = e, this.declarationNode = t.declaration, this.symbol = t, this.filepath = n, this.enum = { values: [] };
|
|
7263
7272
|
}
|
|
@@ -7281,14 +7290,14 @@ var Gm = class {
|
|
|
7281
7290
|
}, this.enum.values.push(n), [];
|
|
7282
7291
|
});
|
|
7283
7292
|
}
|
|
7284
|
-
},
|
|
7293
|
+
}, Jm = {
|
|
7285
7294
|
getDuplicateError(e, t, n) {
|
|
7286
7295
|
return new D(E.DUPLICATE_NAME, `Enum '${e}' already exists in schema '${t}'`, n);
|
|
7287
7296
|
},
|
|
7288
7297
|
getFieldDuplicateError(e, t) {
|
|
7289
7298
|
return new D(E.DUPLICATE_COLUMN_NAME, `Duplicate enum field '${e}'`, t);
|
|
7290
7299
|
}
|
|
7291
|
-
},
|
|
7300
|
+
}, Ym = {
|
|
7292
7301
|
nodeSymbol(i, a) {
|
|
7293
7302
|
let o = i.nodeFullname(a).getFiltered(t)?.at(-1);
|
|
7294
7303
|
return M(a, r.Enum) ? new n(i.symbolFactory.create(Dp, {
|
|
@@ -7314,20 +7323,20 @@ var Gm = class {
|
|
|
7314
7323
|
let t = e.name;
|
|
7315
7324
|
if (t !== void 0) {
|
|
7316
7325
|
let n = e.declaration, r = l.get(t);
|
|
7317
|
-
r ? (c.push(
|
|
7326
|
+
r ? (c.push(Jm.getFieldDuplicateError(t, r)), c.push(Jm.getFieldDuplicateError(t, n))) : l.set(t, n);
|
|
7318
7327
|
}
|
|
7319
7328
|
}
|
|
7320
7329
|
return new n(s, c);
|
|
7321
7330
|
},
|
|
7322
7331
|
bindNode(i, a) {
|
|
7323
7332
|
if (!M(a, r.Enum)) return n.create(e);
|
|
7324
|
-
let o = new
|
|
7333
|
+
let o = new Km(i, a).bind(), s = i.nodeSymbol(a).getFiltered(t);
|
|
7325
7334
|
return s && o.push(...i.symbolMembers(s).getErrors()), n.create(void 0, o);
|
|
7326
7335
|
},
|
|
7327
7336
|
interpretSymbol(t, r, i) {
|
|
7328
|
-
return r instanceof Dp ? new
|
|
7337
|
+
return r instanceof Dp ? new qm(t, r, i).interpret() : n.create(e);
|
|
7329
7338
|
}
|
|
7330
|
-
},
|
|
7339
|
+
}, Xm = class {
|
|
7331
7340
|
constructor(e, t) {
|
|
7332
7341
|
this.compiler = e, this.declarationNode = t;
|
|
7333
7342
|
}
|
|
@@ -7358,7 +7367,7 @@ var Gm = class {
|
|
|
7358
7367
|
bindSubElements(e) {
|
|
7359
7368
|
return e.flatMap((e) => e.type ? this.compiler.bindNode(e).getErrors() : []);
|
|
7360
7369
|
}
|
|
7361
|
-
},
|
|
7370
|
+
}, Zm = class {
|
|
7362
7371
|
constructor(e, t) {
|
|
7363
7372
|
this.compiler = e, this.node = t;
|
|
7364
7373
|
}
|
|
@@ -7413,7 +7422,7 @@ var Gm = class {
|
|
|
7413
7422
|
}];
|
|
7414
7423
|
})) : new n([]);
|
|
7415
7424
|
}
|
|
7416
|
-
},
|
|
7425
|
+
}, Qm = {
|
|
7417
7426
|
nodeMetadata(t, i) {
|
|
7418
7427
|
if (!M(i, r.Indexes)) return n.create(e);
|
|
7419
7428
|
let a = i.parent;
|
|
@@ -7434,15 +7443,15 @@ var Gm = class {
|
|
|
7434
7443
|
return new n(void 0, [new D(E.BINDING_ERROR, `Column '${l}' does not exist in ${d} 'public.${c.name}'`, a)]);
|
|
7435
7444
|
},
|
|
7436
7445
|
bindNode(t, i) {
|
|
7437
|
-
return M(i, r.Indexes) ? n.create(void 0, new
|
|
7446
|
+
return M(i, r.Indexes) ? n.create(void 0, new Xm(t, i).bind()) : n.create(e);
|
|
7438
7447
|
},
|
|
7439
7448
|
interpretMetadata(t, r) {
|
|
7440
|
-
return r.kind === pm.Indexes ? r.declaration instanceof V ? new
|
|
7449
|
+
return r.kind === pm.Indexes ? r.declaration instanceof V ? new Zm(t, r.declaration).interpret() : n.create(void 0) : n.create(e);
|
|
7441
7450
|
}
|
|
7442
7451
|
};
|
|
7443
7452
|
//#endregion
|
|
7444
7453
|
//#region src/core/global_modules/program/bind.ts
|
|
7445
|
-
function
|
|
7454
|
+
function $m(e, n) {
|
|
7446
7455
|
let r = Yf(n);
|
|
7447
7456
|
if (!r || r.length === 0) return;
|
|
7448
7457
|
let i = r[r.length - 1];
|
|
@@ -7460,13 +7469,13 @@ function Qm(e, n) {
|
|
|
7460
7469
|
let o = e.nodeReferee(a).getFiltered(t);
|
|
7461
7470
|
if (o) return [o.originalSymbol];
|
|
7462
7471
|
}
|
|
7463
|
-
function
|
|
7472
|
+
function eh(e, t, n, r) {
|
|
7464
7473
|
let i = e.map((e) => e.intern()).sort().join(","), a = t.map((e) => e.intern()).sort().join(",");
|
|
7465
7474
|
if (i === a) return [new D(E.SAME_ENDPOINT, "Two endpoints are the same", n)];
|
|
7466
7475
|
let o = i < a ? `${i}-${a}` : `${a}-${i}`, s = r.get(o);
|
|
7467
7476
|
return s ? [new D(E.CIRCULAR_REF, "References with same endpoints exist", n), new D(E.CIRCULAR_REF, "References with same endpoints exist", s)] : (r.set(o, n), []);
|
|
7468
7477
|
}
|
|
7469
|
-
var
|
|
7478
|
+
var th = class {
|
|
7470
7479
|
constructor(e, t) {
|
|
7471
7480
|
this.compiler = t, this.ast = e;
|
|
7472
7481
|
}
|
|
@@ -7483,7 +7492,7 @@ var eh = class {
|
|
|
7483
7492
|
} else e.push(...this.compiler.bindNode(t).getErrors());
|
|
7484
7493
|
}
|
|
7485
7494
|
let a = this.compiler.nodeSymbol(this.ast).getFiltered(t);
|
|
7486
|
-
return a && e.push(...
|
|
7495
|
+
return a && e.push(...nh(this.compiler, a)), e.push(...this.checkDuplicateRefs()), e.push(...this.checkTableGroups()), new n(void 0, e);
|
|
7487
7496
|
}
|
|
7488
7497
|
checkDuplicateRefs() {
|
|
7489
7498
|
let e = [], n = /* @__PURE__ */ new Map(), i = this.compiler.reachableFiles(this.ast.filepath);
|
|
@@ -7505,8 +7514,8 @@ var eh = class {
|
|
|
7505
7514
|
if (!(r instanceof U) || !r.callee || !zf(r.callee)) continue;
|
|
7506
7515
|
let i = r.callee;
|
|
7507
7516
|
if (!i.leftExpression || !i.rightExpression) continue;
|
|
7508
|
-
let a =
|
|
7509
|
-
!a || !o || n.push(
|
|
7517
|
+
let a = $m(this.compiler, i.leftExpression), o = $m(this.compiler, i.rightExpression);
|
|
7518
|
+
!a || !o || n.push(...eh(a, o, e, t));
|
|
7510
7519
|
}
|
|
7511
7520
|
return n;
|
|
7512
7521
|
}
|
|
@@ -7522,10 +7531,10 @@ var eh = class {
|
|
|
7522
7531
|
if (!(!s || s.length === 0)) for (let t of s) {
|
|
7523
7532
|
let i = t.value;
|
|
7524
7533
|
if (!(i instanceof Qp) || !i.op || !Sf(i.op.value) || !i.expression) continue;
|
|
7525
|
-
let a =
|
|
7534
|
+
let a = $m(this.compiler, i.expression);
|
|
7526
7535
|
if (!a) continue;
|
|
7527
7536
|
let o = [e.originalSymbol];
|
|
7528
|
-
r.push(
|
|
7537
|
+
r.push(...eh(o, a, t, n));
|
|
7529
7538
|
}
|
|
7530
7539
|
}
|
|
7531
7540
|
return r;
|
|
@@ -7577,22 +7586,22 @@ var eh = class {
|
|
|
7577
7586
|
return e;
|
|
7578
7587
|
}
|
|
7579
7588
|
};
|
|
7580
|
-
function
|
|
7589
|
+
function nh(e, n, r = /* @__PURE__ */ new Set()) {
|
|
7581
7590
|
if (r.has(n.id)) return [];
|
|
7582
7591
|
r.add(n.id);
|
|
7583
7592
|
let i = e.symbolMembers(n), a = [...i.getErrors()], o = i.getFiltered(t);
|
|
7584
7593
|
if (!o) return a;
|
|
7585
|
-
for (let t of o) t instanceof Ep && a.push(...
|
|
7594
|
+
for (let t of o) t instanceof Ep && a.push(...nh(e, t, r));
|
|
7586
7595
|
return a;
|
|
7587
7596
|
}
|
|
7588
7597
|
//#endregion
|
|
7589
7598
|
//#region src/core/global_modules/program/utils.ts
|
|
7590
|
-
function
|
|
7599
|
+
function rh(e, t, n) {
|
|
7591
7600
|
t.isKind(R.Table) ? e.externals.tables.push(n) : t.isKind(R.Enum) ? e.externals.enums.push(n) : t.isKind(R.TableGroup) ? e.externals.tableGroups.push(n) : t.isKind(R.TablePartial) ? e.externals.tablePartials.push(n) : t.isKind(R.StickyNote) && e.externals.notes.push(n);
|
|
7592
7601
|
}
|
|
7593
7602
|
//#endregion
|
|
7594
7603
|
//#region src/core/global_modules/records/utils/constraints/helper.ts
|
|
7595
|
-
function
|
|
7604
|
+
function ih(e) {
|
|
7596
7605
|
return e.values.map((t) => {
|
|
7597
7606
|
let n = {};
|
|
7598
7607
|
return e.columns.forEach((e, r) => {
|
|
@@ -7600,10 +7609,10 @@ function rh(e) {
|
|
|
7600
7609
|
}), n;
|
|
7601
7610
|
});
|
|
7602
7611
|
}
|
|
7603
|
-
function
|
|
7612
|
+
function ah(e, t) {
|
|
7604
7613
|
return e ? `${e}.${t}` : `${b}.${t}`;
|
|
7605
7614
|
}
|
|
7606
|
-
function
|
|
7615
|
+
function oh(e, t, n) {
|
|
7607
7616
|
return n.map((n) => {
|
|
7608
7617
|
let r = t[n.name ?? ""]?.value;
|
|
7609
7618
|
if (r == null) {
|
|
@@ -7613,69 +7622,69 @@ function ah(e, t, n) {
|
|
|
7613
7622
|
return JSON.stringify(r);
|
|
7614
7623
|
}).join("|");
|
|
7615
7624
|
}
|
|
7616
|
-
function
|
|
7625
|
+
function sh(e, t, n) {
|
|
7617
7626
|
return n.some((n) => {
|
|
7618
7627
|
let r = t[n.name ?? ""]?.value;
|
|
7619
7628
|
return r == null && n.default(e) ? !1 : r == null;
|
|
7620
7629
|
});
|
|
7621
7630
|
}
|
|
7622
|
-
function sh(e, t, n) {
|
|
7623
|
-
return e ? `${e}.${t}.${n}` : `${t}.${n}`;
|
|
7624
|
-
}
|
|
7625
7631
|
function ch(e, t, n) {
|
|
7626
|
-
return
|
|
7632
|
+
return e ? `${e}.${t}.${n}` : `${t}.${n}`;
|
|
7627
7633
|
}
|
|
7628
7634
|
function lh(e, t, n) {
|
|
7635
|
+
return n.length === 1 ? ch(e, t, n[0]) : `(${n.map((n) => ch(e, t, n)).join(", ")})`;
|
|
7636
|
+
}
|
|
7637
|
+
function uh(e, t, n) {
|
|
7629
7638
|
let r = n.map((n) => {
|
|
7630
7639
|
let r = n.name ?? "", i = t[r] === void 0 ? n.default(e)?.value : t[r].value;
|
|
7631
7640
|
return JSON.stringify(i);
|
|
7632
7641
|
}).join(", ");
|
|
7633
7642
|
return n.length === 1 ? r : `(${r})`;
|
|
7634
7643
|
}
|
|
7635
|
-
function
|
|
7644
|
+
function dh(e, t) {
|
|
7636
7645
|
let n = t.filter((t) => e[t]).map((t) => e[t]);
|
|
7637
7646
|
return n.length > 0 ? n : Object.values(e).filter(Boolean);
|
|
7638
7647
|
}
|
|
7639
|
-
function
|
|
7648
|
+
function fh(e, t, n) {
|
|
7640
7649
|
let { token: r } = t, i = e.nodeAtPosition(r.filepath, r.start.offset) ?? e.parse.ast(r.filepath);
|
|
7641
7650
|
return new df(E.INVALID_RECORDS_FIELD, n, i);
|
|
7642
7651
|
}
|
|
7643
7652
|
//#endregion
|
|
7644
7653
|
//#region src/core/global_modules/records/utils/constraints/pk.ts
|
|
7645
|
-
var
|
|
7646
|
-
function
|
|
7647
|
-
return Da(r.values) ? [] : ba(
|
|
7654
|
+
var ph = (e) => e > 1 ? "Composite PK" : "PK";
|
|
7655
|
+
function mh(e, t, n, r) {
|
|
7656
|
+
return Da(r.values) ? [] : ba(yh(t, e), (i) => hh(e, t, n, i, r));
|
|
7648
7657
|
}
|
|
7649
|
-
function
|
|
7650
|
-
let a =
|
|
7658
|
+
function hh(e, t, n, r, i) {
|
|
7659
|
+
let a = ih(i), o = vh(e, t, n, r, i);
|
|
7651
7660
|
if (!Da(o)) return o;
|
|
7652
|
-
let s = r.filter((t) => !t.increment(e) && !t.default(e)), [c, l] = v(a, (t) =>
|
|
7661
|
+
let s = r.filter((t) => !t.increment(e) && !t.default(e)), [c, l] = v(a, (t) => sh(e, t, s)), u = gh(e, t, s.map((e) => e.name ?? ""), c), d = r.some((t) => t.increment(e)) ? [] : _h(e, t, r, l);
|
|
7653
7662
|
return [...u, ...d];
|
|
7654
7663
|
}
|
|
7655
|
-
function
|
|
7664
|
+
function gh(e, t, n, r) {
|
|
7656
7665
|
if (Da(r)) return [];
|
|
7657
|
-
let i = t.schema(e), a = t.name ?? "", o = `NULL in ${
|
|
7658
|
-
return ba(r, (t) =>
|
|
7666
|
+
let i = t.schema(e), a = t.name ?? "", o = `NULL in ${ph(n.length)}: ${lh(i, a, n)} cannot be NULL`;
|
|
7667
|
+
return ba(r, (t) => dh(t, n).map((t) => fh(e, t, o)));
|
|
7659
7668
|
}
|
|
7660
|
-
function
|
|
7669
|
+
function _h(e, t, n, r) {
|
|
7661
7670
|
let i = n.map((e) => e.name ?? ""), a = t.schema(e), o = t.name ?? "";
|
|
7662
|
-
return ba(pa(Ca(r, (t) =>
|
|
7663
|
-
let r =
|
|
7671
|
+
return ba(pa(Ca(r, (t) => oh(e, t, n)), (e) => e.length > 1), (t) => {
|
|
7672
|
+
let r = ph(i.length), s = lh(a, o, i);
|
|
7664
7673
|
return ba(t, (t) => {
|
|
7665
|
-
let a = `Duplicate ${r}: ${s} = ${
|
|
7666
|
-
return
|
|
7674
|
+
let a = `Duplicate ${r}: ${s} = ${uh(e, t, n)}`;
|
|
7675
|
+
return dh(t, i).map((t) => fh(e, t, a));
|
|
7667
7676
|
});
|
|
7668
7677
|
});
|
|
7669
7678
|
}
|
|
7670
|
-
function
|
|
7679
|
+
function vh(e, t, n, r, i) {
|
|
7671
7680
|
let a = r.map((e) => e.name ?? ""), o = new Set(i.columns), s = t.schema(e), c = t.name ?? "", l = ua(a, Array.from(o));
|
|
7672
7681
|
if (Da(l)) return [];
|
|
7673
7682
|
let u = new Set(l), d = r.filter((e) => u.has(e.name ?? "")).filter((t) => !t.increment(e) && !t.default(e)).map((e) => e.name ?? "");
|
|
7674
7683
|
if (Da(d)) return [];
|
|
7675
|
-
let f = `${
|
|
7684
|
+
let f = `${ph(d.length)}: Column ${lh(s, c, d)} is missing from record and has no default value`;
|
|
7676
7685
|
return i.values.map(() => new df(E.INVALID_RECORDS_FIELD, f, n));
|
|
7677
7686
|
}
|
|
7678
|
-
function
|
|
7687
|
+
function yh(e, t) {
|
|
7679
7688
|
let n = e.mergedColumns(t), r = Oa(n, (e) => e.name ?? "");
|
|
7680
7689
|
return [...n.filter((e) => e.pk(t)).map((e) => [e]), ...e.mergedIndexes(t).flatMap((e) => {
|
|
7681
7690
|
let n = t.interpretMetadata(e, e.declaration.filepath).getValue();
|
|
@@ -7684,75 +7693,75 @@ function vh(e, t) {
|
|
|
7684
7693
|
}
|
|
7685
7694
|
//#endregion
|
|
7686
7695
|
//#region src/core/global_modules/records/utils/constraints/unique.ts
|
|
7687
|
-
function
|
|
7696
|
+
function bh(e, t, n) {
|
|
7688
7697
|
if (Da(n.values)) return [];
|
|
7689
|
-
let r =
|
|
7690
|
-
return ba(
|
|
7698
|
+
let r = ih(n);
|
|
7699
|
+
return ba(xh(e, t), (n) => Sh(e, t, n, r));
|
|
7691
7700
|
}
|
|
7692
|
-
function
|
|
7701
|
+
function xh(e, t) {
|
|
7693
7702
|
let n = t.mergedColumns(e), r = Oa(n, (e) => e.name ?? "");
|
|
7694
7703
|
return [...n.filter((t) => t.unique(e)).map((e) => [e]), ...t.mergedIndexes(e).flatMap((t) => {
|
|
7695
7704
|
let n = e.interpretMetadata(t, t.declaration.filepath).getValue();
|
|
7696
7705
|
return Array.isArray(n) ? n.filter((e) => e.unique).map((e) => Zr(e.columns.map((e) => r[e.value]))) : [];
|
|
7697
7706
|
})];
|
|
7698
7707
|
}
|
|
7699
|
-
function
|
|
7708
|
+
function Sh(e, t, n, r) {
|
|
7700
7709
|
let i = n.map((e) => e.name ?? "");
|
|
7701
|
-
return ba(pa(Ca(r.filter((t) => !
|
|
7702
|
-
let a = n.length > 1 ? "Composite UNIQUE" : "UNIQUE", o =
|
|
7710
|
+
return ba(pa(Ca(r.filter((t) => !sh(e, t, n)), (t) => oh(e, t, n)), (e) => e.length > 1), (r) => {
|
|
7711
|
+
let a = n.length > 1 ? "Composite UNIQUE" : "UNIQUE", o = lh(t.schema(e), t.name ?? "", i);
|
|
7703
7712
|
return ba(r, (t) => {
|
|
7704
|
-
let r = `Duplicate ${a}: ${o} = ${
|
|
7705
|
-
return
|
|
7713
|
+
let r = `Duplicate ${a}: ${o} = ${uh(e, t, n)}`;
|
|
7714
|
+
return dh(t, i).map((t) => fh(e, t, r));
|
|
7706
7715
|
});
|
|
7707
7716
|
});
|
|
7708
7717
|
}
|
|
7709
7718
|
//#endregion
|
|
7710
7719
|
//#region src/core/global_modules/records/utils/constraints/fk.ts
|
|
7711
|
-
function
|
|
7720
|
+
function Ch(e, t, n) {
|
|
7712
7721
|
let r = /* @__PURE__ */ new Map();
|
|
7713
7722
|
for (let i of e.values()) {
|
|
7714
7723
|
let { name: e, schema: a } = i.tableSymbol.interpretedName(t, n);
|
|
7715
|
-
r.set(
|
|
7724
|
+
r.set(ah(a, e), i);
|
|
7716
7725
|
}
|
|
7717
7726
|
return r;
|
|
7718
7727
|
}
|
|
7719
|
-
function
|
|
7720
|
-
let i =
|
|
7728
|
+
function wh(e, t, n, r) {
|
|
7729
|
+
let i = Ch(n, e, r), a = /* @__PURE__ */ new Set();
|
|
7721
7730
|
for (let [e, t] of i) t.record && !Da(t.record.values) && a.add(e);
|
|
7722
|
-
return ba(t.filter((e) => e.endpoints ? e.endpoints.some((e) => a.has(
|
|
7731
|
+
return ba(t.filter((e) => e.endpoints ? e.endpoints.some((e) => a.has(ah(e.schemaName, e.tableName))) : !1), (t) => Th(e, t, i, r));
|
|
7723
7732
|
}
|
|
7724
|
-
function
|
|
7733
|
+
function Th(e, t, n, r) {
|
|
7725
7734
|
if (!t.endpoints) return [];
|
|
7726
|
-
let [i, a] = t.endpoints, o = n.get(
|
|
7735
|
+
let [i, a] = t.endpoints, o = n.get(ah(i.schemaName, i.tableName)), s = n.get(ah(a.schemaName, a.tableName));
|
|
7727
7736
|
if (!o || !s) return [];
|
|
7728
7737
|
let c = o.tableSymbol.mergedColumns(e).filter((e) => typeof e.name == "string" && i.fieldNames.includes(e.name)), l = s.tableSymbol.mergedColumns(e).filter((e) => typeof e.name == "string" && a.fieldNames.includes(e.name));
|
|
7729
|
-
return [...
|
|
7738
|
+
return [...Eh(e, o, c, s, l, a.relation, r), ...Eh(e, s, l, o, c, i.relation, r)];
|
|
7730
7739
|
}
|
|
7731
|
-
function
|
|
7740
|
+
function Eh(e, t, n, r, i, a, o) {
|
|
7732
7741
|
if (!t.record || Da(t.record.values)) return [];
|
|
7733
|
-
let { min: s } = $d(a), c = Zr(n.map((e) => e.name)), l = Zr(i.map((e) => e.name)), u = s === 0, d =
|
|
7742
|
+
let { min: s } = $d(a), c = Zr(n.map((e) => e.name)), l = Zr(i.map((e) => e.name)), u = s === 0, d = ih(t.record), f = r.record ? ih(r.record) : [], p = new Set(f.map((t) => oh(e, t, i))), m = t.tableSymbol.interpretedName(e, o), h = r.tableSymbol.interpretedName(e, o);
|
|
7734
7743
|
return ba(d, (t) => {
|
|
7735
|
-
if (
|
|
7744
|
+
if (sh(e, t, n)) {
|
|
7736
7745
|
if (u) return [];
|
|
7737
|
-
let r = `FK violation: ${
|
|
7738
|
-
return
|
|
7746
|
+
let r = `FK violation: ${lh(m.schema, m.name, c)} = ${uh(e, t, n)} must not be null`;
|
|
7747
|
+
return dh(t, c).map((t) => fh(e, t, r));
|
|
7739
7748
|
}
|
|
7740
|
-
let r =
|
|
7749
|
+
let r = oh(e, t, n);
|
|
7741
7750
|
if (p.has(r)) return [];
|
|
7742
|
-
let i =
|
|
7743
|
-
return
|
|
7751
|
+
let i = lh(m.schema, m.name, c), a = lh(h.schema, h.name, l), o = `FK violation: ${i} = ${uh(e, t, n)} does not exist in ${a}`;
|
|
7752
|
+
return dh(t, c).map((t) => fh(e, t, o));
|
|
7744
7753
|
});
|
|
7745
7754
|
}
|
|
7746
7755
|
//#endregion
|
|
7747
7756
|
//#region src/compiler/queries/transform/applyTextEdits.ts
|
|
7748
|
-
function
|
|
7757
|
+
function Dh(e, t, n = !1) {
|
|
7749
7758
|
let r = n ? t : [...t].sort((e, t) => t.start - e.start), i = e;
|
|
7750
7759
|
for (let { start: e, end: t, newText: n } of r) i = i.substring(0, e) + n + i.substring(t);
|
|
7751
7760
|
return i;
|
|
7752
7761
|
}
|
|
7753
7762
|
//#endregion
|
|
7754
7763
|
//#region src/compiler/queries/transform/addSetting.ts
|
|
7755
|
-
function
|
|
7764
|
+
function Oh(e, t) {
|
|
7756
7765
|
if (e instanceof U) {
|
|
7757
7766
|
let n = e.args.find((e) => e instanceof G);
|
|
7758
7767
|
if (n) {
|
|
@@ -7770,15 +7779,15 @@ function Dh(e, t) {
|
|
|
7770
7779
|
newText: ` [${t}]`
|
|
7771
7780
|
};
|
|
7772
7781
|
}
|
|
7773
|
-
function
|
|
7782
|
+
function kh(e, t, n) {
|
|
7774
7783
|
let r = this.getSource(e);
|
|
7775
7784
|
if (!r) return;
|
|
7776
|
-
let i =
|
|
7777
|
-
if (i) return
|
|
7785
|
+
let i = Oh(t, n);
|
|
7786
|
+
if (i) return Dh(r, [i]);
|
|
7778
7787
|
}
|
|
7779
7788
|
//#endregion
|
|
7780
7789
|
//#region src/compiler/queries/transform/updateSetting.ts
|
|
7781
|
-
function
|
|
7790
|
+
function Ah(e, t, n) {
|
|
7782
7791
|
if (!(e instanceof U)) return;
|
|
7783
7792
|
let r = e.args.find((e) => e instanceof G);
|
|
7784
7793
|
if (!r) return;
|
|
@@ -7793,16 +7802,16 @@ function kh(e, t, n) {
|
|
|
7793
7802
|
settingIndex: a
|
|
7794
7803
|
};
|
|
7795
7804
|
}
|
|
7796
|
-
function
|
|
7797
|
-
let i =
|
|
7805
|
+
function jh(e, t, n, r) {
|
|
7806
|
+
let i = Ah(e, t, r);
|
|
7798
7807
|
if (i) return {
|
|
7799
7808
|
start: i.settingNode.start,
|
|
7800
7809
|
end: i.settingNode.end,
|
|
7801
7810
|
newText: n
|
|
7802
7811
|
};
|
|
7803
7812
|
}
|
|
7804
|
-
function
|
|
7805
|
-
let r =
|
|
7813
|
+
function Mh(e, t, n) {
|
|
7814
|
+
let r = Ah(e, t, n);
|
|
7806
7815
|
if (!r) return;
|
|
7807
7816
|
let { settingsList: i, settingIndex: a } = r, o = i.elementList ?? [];
|
|
7808
7817
|
if (o.length === 1) {
|
|
@@ -7829,47 +7838,47 @@ function jh(e, t, n) {
|
|
|
7829
7838
|
newText: ""
|
|
7830
7839
|
};
|
|
7831
7840
|
}
|
|
7832
|
-
function
|
|
7841
|
+
function Nh(e, t, n, r) {
|
|
7833
7842
|
let i = this.getSource(e);
|
|
7834
7843
|
if (!i) return;
|
|
7835
|
-
let a =
|
|
7836
|
-
if (a) return
|
|
7844
|
+
let a = jh(t, n, r, i);
|
|
7845
|
+
if (a) return Dh(i, [a]);
|
|
7837
7846
|
}
|
|
7838
|
-
function
|
|
7847
|
+
function Ph(e, t, n) {
|
|
7839
7848
|
let r = this.getSource(e);
|
|
7840
7849
|
if (!r) return;
|
|
7841
|
-
let i =
|
|
7842
|
-
if (i) return
|
|
7850
|
+
let i = Mh(t, n, r);
|
|
7851
|
+
if (i) return Dh(r, [i]);
|
|
7843
7852
|
}
|
|
7844
7853
|
//#endregion
|
|
7845
7854
|
//#region src/core/global_modules/ref/constraint_fixes.ts
|
|
7846
|
-
function
|
|
7855
|
+
function Fh(e, t, n, r) {
|
|
7847
7856
|
let { allowOtherColFix: i = !0, allowOwnColFix: a = !0 } = r ?? {}, o = t.opToken(), s = t.cardinalities(e);
|
|
7848
7857
|
if (!s) return [];
|
|
7849
7858
|
let c = n === "left" ? s[0] : s[1], l = n === "left" ? s[1] : s[0], u = $d(c), d = n === "left" ? t.rightColumns(e) : t.leftColumns(e), f = n === "left" ? t.leftColumns(e) : t.rightColumns(e), p = n === "left" ? t.rightToken() : t.leftToken(), m = n === "left" ? t.leftToken() : t.rightToken(), h = t.op(e) ?? "?", ee = [];
|
|
7850
7859
|
if (u.min >= 1) {
|
|
7851
7860
|
for (let t of d) if (t.nullable(e)) {
|
|
7852
|
-
let r = t.qualifiedName(e), a = `Column '${r}' is nullable but operator '${h}' requires it to be NOT NULL`, s = [o &&
|
|
7861
|
+
let r = t.qualifiedName(e), a = `Column '${r}' is nullable but operator '${h}' requires it to be NOT NULL`, s = [o && Lh(o, cf(c), l, n, `Make '${r}' optional in the ref`), i && Rh(t, e)].filter((e) => !!e);
|
|
7853
7862
|
ee.push(new ff(E.INVALID_REF_RELATIONSHIP, a, p, { quickFixes: s })), t.declaration && ee.push(new ff(E.INVALID_REF_RELATIONSHIP, a, t.declaration, { quickFixes: s }));
|
|
7854
7863
|
}
|
|
7855
7864
|
}
|
|
7856
7865
|
if (u.min === 0) {
|
|
7857
7866
|
for (let t of d) if (t.nullable(e) === !1) {
|
|
7858
|
-
let r = t.qualifiedName(e), a = `Column '${r}' is NOT NULL but operator '${h}' allows it to be optional`, s = [o &&
|
|
7867
|
+
let r = t.qualifiedName(e), a = `Column '${r}' is NOT NULL but operator '${h}' allows it to be optional`, s = [o && Lh(o, lf(c), l, n, `Make '${r}' required in the ref`), i && zh(t, e)].filter((e) => !!e);
|
|
7859
7868
|
ee.push(new ff(E.INVALID_REF_RELATIONSHIP, a, p, { quickFixes: s })), t.declaration && ee.push(new ff(E.INVALID_REF_RELATIONSHIP, a, t.declaration, { quickFixes: s }));
|
|
7860
7869
|
}
|
|
7861
7870
|
}
|
|
7862
|
-
if (u.max === 1 && !
|
|
7863
|
-
let t = f.map((t) => t.qualifiedName(e)).join(", "), r = f.length === 1 ? `Column '${t}' should be unique or primary key for operator '${h}'` : `Columns (${t}) should have a composite unique index for operator '${h}'`, i = [o &&
|
|
7871
|
+
if (u.max === 1 && !Bh(e, f)) {
|
|
7872
|
+
let t = f.map((t) => t.qualifiedName(e)).join(", "), r = f.length === 1 ? `Column '${t}' should be unique or primary key for operator '${h}'` : `Columns (${t}) should have a composite unique index for operator '${h}'`, i = [o && Lh(o, uf(c), l, n, `Make '${t}' many in the ref`), a && f.length === 1 && Vh(f[0], e)].filter((e) => !!e);
|
|
7864
7873
|
ee.push(new ff(E.INVALID_REF_RELATIONSHIP, r, m, { quickFixes: i }));
|
|
7865
7874
|
for (let e of f) e.declaration && ee.push(new ff(E.INVALID_REF_RELATIONSHIP, r, e.declaration, { quickFixes: i }));
|
|
7866
7875
|
}
|
|
7867
7876
|
return ee;
|
|
7868
7877
|
}
|
|
7869
|
-
function
|
|
7870
|
-
return [...
|
|
7878
|
+
function Ih(e, t) {
|
|
7879
|
+
return [...Fh(e, t, "right", { allowOtherColFix: !1 }), ...Fh(e, t, "left", { allowOwnColFix: !1 })];
|
|
7871
7880
|
}
|
|
7872
|
-
function
|
|
7881
|
+
function Lh(e, t, n, r, i) {
|
|
7873
7882
|
let a = sf(r === "left" ? t : n, r === "right" ? t : n);
|
|
7874
7883
|
return {
|
|
7875
7884
|
title: `${i} (change operator to '${a}')`,
|
|
@@ -7881,35 +7890,35 @@ function Ih(e, t, n, r, i) {
|
|
|
7881
7890
|
}]
|
|
7882
7891
|
};
|
|
7883
7892
|
}
|
|
7884
|
-
function
|
|
7893
|
+
function Rh(e, t) {
|
|
7885
7894
|
if (!e.declaration || e.pk(t) || e.increment(t) || e.isNotNullSet(t)) return;
|
|
7886
7895
|
let n = t.getSource(e.declaration.filepath);
|
|
7887
7896
|
if (!n) return;
|
|
7888
|
-
let r = e.qualifiedName(t), i =
|
|
7897
|
+
let r = e.qualifiedName(t), i = Mh(e.declaration, "null", n);
|
|
7889
7898
|
if (i) return {
|
|
7890
7899
|
title: `Mark '${r}' as NOT NULL`,
|
|
7891
7900
|
filepath: e.declaration.filepath,
|
|
7892
7901
|
edits: [i]
|
|
7893
7902
|
};
|
|
7894
|
-
let a =
|
|
7903
|
+
let a = Oh(e.declaration, "not null");
|
|
7895
7904
|
if (a) return {
|
|
7896
7905
|
title: `Mark '${r}' as NOT NULL`,
|
|
7897
7906
|
filepath: e.declaration.filepath,
|
|
7898
7907
|
edits: [a]
|
|
7899
7908
|
};
|
|
7900
7909
|
}
|
|
7901
|
-
function
|
|
7910
|
+
function zh(e, t) {
|
|
7902
7911
|
if (!e.declaration) return;
|
|
7903
7912
|
let n = t.getSource(e.declaration.filepath);
|
|
7904
7913
|
if (!n) return;
|
|
7905
|
-
let r =
|
|
7914
|
+
let r = Mh(e.declaration, "not null", n);
|
|
7906
7915
|
if (r) return {
|
|
7907
7916
|
title: `Mark '${e.qualifiedName(t)}' as NULL`,
|
|
7908
7917
|
filepath: e.declaration.filepath,
|
|
7909
7918
|
edits: [r]
|
|
7910
7919
|
};
|
|
7911
7920
|
}
|
|
7912
|
-
function
|
|
7921
|
+
function Bh(e, n) {
|
|
7913
7922
|
if (n.length === 0) return !1;
|
|
7914
7923
|
if (n.length === 1) return n[0].unique(e) || n[0].pk(e);
|
|
7915
7924
|
let r = n[0].declaration?.parentOfKind(V);
|
|
@@ -7925,9 +7934,9 @@ function zh(e, n) {
|
|
|
7925
7934
|
}
|
|
7926
7935
|
return !1;
|
|
7927
7936
|
}
|
|
7928
|
-
function
|
|
7937
|
+
function Vh(e, t) {
|
|
7929
7938
|
if (!e.declaration || e.unique(t) || e.pk(t)) return;
|
|
7930
|
-
let n =
|
|
7939
|
+
let n = Oh(e.declaration, "unique");
|
|
7931
7940
|
if (n) return {
|
|
7932
7941
|
title: `Mark '${e.qualifiedName(t)}' as UNIQUE`,
|
|
7933
7942
|
filepath: e.declaration.filepath,
|
|
@@ -7936,7 +7945,7 @@ function Bh(e, t) {
|
|
|
7936
7945
|
}
|
|
7937
7946
|
//#endregion
|
|
7938
7947
|
//#region src/core/global_modules/program/interpret.ts
|
|
7939
|
-
var
|
|
7948
|
+
var Hh = class {
|
|
7940
7949
|
constructor(e, t, n) {
|
|
7941
7950
|
this.errors = [], this.warnings = [], this.hints = [], this.compiler = e, this.programSymbol = t, this.programNode = t.declaration, this.filepath = n, this.db = {
|
|
7942
7951
|
schemas: [],
|
|
@@ -8008,7 +8017,7 @@ var Vh = class {
|
|
|
8008
8017
|
name: a.name
|
|
8009
8018
|
}]
|
|
8010
8019
|
};
|
|
8011
|
-
|
|
8020
|
+
rh(this.db, e, o);
|
|
8012
8021
|
}
|
|
8013
8022
|
interpretAllMetadata() {
|
|
8014
8023
|
let e = this.compiler.symbolMetadata(this.programSymbol) ?? [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
|
|
@@ -8113,7 +8122,7 @@ var Vh = class {
|
|
|
8113
8122
|
if (a.hasValue(t)) continue;
|
|
8114
8123
|
let o = a.getValue();
|
|
8115
8124
|
if (!o) continue;
|
|
8116
|
-
e.push(...
|
|
8125
|
+
e.push(...mh(this.compiler, i, r.declaration, o)), e.push(...bh(this.compiler, i, o));
|
|
8117
8126
|
let s = i.originalSymbol.intern(), c = n.get(s);
|
|
8118
8127
|
c ? c.record = o : n.set(s, {
|
|
8119
8128
|
tableSymbol: i,
|
|
@@ -8122,11 +8131,11 @@ var Vh = class {
|
|
|
8122
8131
|
});
|
|
8123
8132
|
}
|
|
8124
8133
|
let a = this.collectPartialRefs(n);
|
|
8125
|
-
return e.push(...
|
|
8134
|
+
return e.push(...wh(this.compiler, [...this.db.refs, ...a], n, this.filepath)), e;
|
|
8126
8135
|
}
|
|
8127
8136
|
validatePartialRefs() {
|
|
8128
8137
|
let e = this.compiler.symbolMetadata(this.programSymbol).filter((e) => e instanceof gm);
|
|
8129
|
-
for (let t of e) this.hints.push(...
|
|
8138
|
+
for (let t of e) this.hints.push(...Ih(this.compiler, t));
|
|
8130
8139
|
}
|
|
8131
8140
|
collectPartialRefs(e) {
|
|
8132
8141
|
let t = this.compiler.symbolMetadata(this.programSymbol).filter((e) => e instanceof gm), n = [];
|
|
@@ -8181,7 +8190,7 @@ var Vh = class {
|
|
|
8181
8190
|
default: break;
|
|
8182
8191
|
}
|
|
8183
8192
|
}
|
|
8184
|
-
},
|
|
8193
|
+
}, Uh = {
|
|
8185
8194
|
nodeSymbol(t, r) {
|
|
8186
8195
|
return Pf(r) ? n.create(t.symbolFactory.create(Hp, {
|
|
8187
8196
|
declaration: r,
|
|
@@ -8202,7 +8211,7 @@ var Vh = class {
|
|
|
8202
8211
|
return s ? n.create([...a.values(), ...s]) : n.create([...a.values()]);
|
|
8203
8212
|
},
|
|
8204
8213
|
bindNode(t, r) {
|
|
8205
|
-
return Pf(r) ? new
|
|
8214
|
+
return Pf(r) ? new th(r, t).resolve() : n.create(e);
|
|
8206
8215
|
},
|
|
8207
8216
|
interpretSymbol(t, r, i) {
|
|
8208
8217
|
if (!(r instanceof Hp)) return n.create(e);
|
|
@@ -8211,9 +8220,9 @@ var Vh = class {
|
|
|
8211
8220
|
let e = t.reachableFiles(i).flatMap((e) => t.bindFile(e).getErrors());
|
|
8212
8221
|
return n.create(void 0, e);
|
|
8213
8222
|
}
|
|
8214
|
-
return new
|
|
8223
|
+
return new Hh(t, r, i).interpret();
|
|
8215
8224
|
}
|
|
8216
|
-
},
|
|
8225
|
+
}, Wh = class {
|
|
8217
8226
|
constructor(e, t) {
|
|
8218
8227
|
this.compiler = e, this.declarationNode = t;
|
|
8219
8228
|
}
|
|
@@ -8228,7 +8237,7 @@ var Vh = class {
|
|
|
8228
8237
|
bindSubElements(e) {
|
|
8229
8238
|
return e.flatMap((e) => e.type ? this.compiler.bindNode(e).getErrors() : []);
|
|
8230
8239
|
}
|
|
8231
|
-
},
|
|
8240
|
+
}, Gh = class {
|
|
8232
8241
|
constructor(e, t, n) {
|
|
8233
8242
|
this.declarationNode = t, this.compiler = e, this.filepath = n, this.project = {
|
|
8234
8243
|
enums: [],
|
|
@@ -8287,17 +8296,17 @@ var Vh = class {
|
|
|
8287
8296
|
}
|
|
8288
8297
|
});
|
|
8289
8298
|
}
|
|
8290
|
-
},
|
|
8299
|
+
}, Kh = {
|
|
8291
8300
|
nodeMetadata(t, i) {
|
|
8292
8301
|
return M(i, r.Project) ? n.create(new bm(i)) : n.create(e);
|
|
8293
8302
|
},
|
|
8294
8303
|
bindNode(t, i) {
|
|
8295
|
-
return M(i, r.Project) ? n.create(void 0, new
|
|
8304
|
+
return M(i, r.Project) ? n.create(void 0, new Wh(t, i).bind()) : n.create(e);
|
|
8296
8305
|
},
|
|
8297
8306
|
interpretMetadata(t, r, i) {
|
|
8298
|
-
return !(r instanceof bm) || !(r.declaration instanceof V) ? n.create(e) : new
|
|
8307
|
+
return !(r instanceof bm) || !(r.declaration instanceof V) ? n.create(e) : new Gh(t, r.declaration, i).interpret();
|
|
8299
8308
|
}
|
|
8300
|
-
},
|
|
8309
|
+
}, qh = class {
|
|
8301
8310
|
constructor(e, t) {
|
|
8302
8311
|
this.compiler = e, this.declarationNode = t, this.boundColumns = /* @__PURE__ */ new Map();
|
|
8303
8312
|
}
|
|
@@ -8364,16 +8373,16 @@ var Vh = class {
|
|
|
8364
8373
|
bindSubElements(e) {
|
|
8365
8374
|
return e.flatMap((e) => e.type ? this.compiler.bindNode(e).getErrors() : []);
|
|
8366
8375
|
}
|
|
8367
|
-
},
|
|
8376
|
+
}, Jh = class {
|
|
8368
8377
|
constructor(e, t, n) {
|
|
8369
8378
|
this.compiler = e, this.metadata = t, this.element = t.declaration, this.filepath = n;
|
|
8370
8379
|
}
|
|
8371
8380
|
interpret() {
|
|
8372
|
-
let e = [], t = [], r =
|
|
8381
|
+
let e = [], t = [], r = Yh(this.element, this.compiler, this.filepath);
|
|
8373
8382
|
if (!r || r.columns.length === 0) return new n(void 0, e);
|
|
8374
8383
|
let i = [];
|
|
8375
8384
|
for (let n of this.element.body.body) {
|
|
8376
|
-
let a =
|
|
8385
|
+
let a = Xh(n, r.columns, this.compiler);
|
|
8377
8386
|
e.push(...a.getErrors()), t.push(...a.getWarnings());
|
|
8378
8387
|
let o = a.getValue();
|
|
8379
8388
|
o.row && i.push(o.row);
|
|
@@ -8388,7 +8397,7 @@ var Vh = class {
|
|
|
8388
8397
|
}, e, t);
|
|
8389
8398
|
}
|
|
8390
8399
|
};
|
|
8391
|
-
function
|
|
8400
|
+
function Yh(e, n, i) {
|
|
8392
8401
|
let a = e.name, o = e.parent;
|
|
8393
8402
|
if (o instanceof V && o.isKind(r.Table)) {
|
|
8394
8403
|
let e = n.nodeSymbol(o).getFiltered(t);
|
|
@@ -8423,7 +8432,7 @@ function Jh(e, n, i) {
|
|
|
8423
8432
|
columns: ee
|
|
8424
8433
|
};
|
|
8425
8434
|
}
|
|
8426
|
-
function
|
|
8435
|
+
function Xh(e, t, r) {
|
|
8427
8436
|
let i = [], a = [], o = {}, s = e.callee instanceof rm ? e.callee.elementList : [e.callee];
|
|
8428
8437
|
if (s.length !== t.length) return i.push(new D(E.INVALID_RECORDS_FIELD, `Expected ${t.length} values but got ${s.length}`, e)), new n({
|
|
8429
8438
|
row: null,
|
|
@@ -8433,7 +8442,7 @@ function Yh(e, t, r) {
|
|
|
8433
8442
|
for (let e = 0; e < t.length; e++) {
|
|
8434
8443
|
let n = s[e], l = t[e];
|
|
8435
8444
|
o[l.name ?? ""] = n;
|
|
8436
|
-
let u =
|
|
8445
|
+
let u = Qh(n, l, r);
|
|
8437
8446
|
i.push(...u.getErrors()), a.push(...u.getWarnings());
|
|
8438
8447
|
let d = u.getValue();
|
|
8439
8448
|
c.push(d ?? {
|
|
@@ -8447,11 +8456,11 @@ function Yh(e, t, r) {
|
|
|
8447
8456
|
columnNodes: o
|
|
8448
8457
|
}, i, a);
|
|
8449
8458
|
}
|
|
8450
|
-
function
|
|
8459
|
+
function Zh(e) {
|
|
8451
8460
|
return e instanceof tm && e.value?.value || "";
|
|
8452
8461
|
}
|
|
8453
|
-
function
|
|
8454
|
-
let i = L(e), a = t.type(r), o = (a?.name ?? "").split("(")[0], s = !!a?.enumSymbol, c = t.increment(r), l = t.isNotNullSet(r) === !0, u = t.default(r), d = t.name ?? "", f = Vo(o, s), p = dp(e), m = p === null ?
|
|
8462
|
+
function Qh(e, t, r) {
|
|
8463
|
+
let i = L(e), a = t.type(r), o = (a?.name ?? "").split("(")[0], s = !!a?.enumSymbol, c = t.increment(r), l = t.isNotNullSet(r) === !0, u = t.default(r), d = t.name ?? "", f = Vo(o, s), p = dp(e), m = p === null ? Zh(e) : p, h = p === null ? "expression" : f;
|
|
8455
8464
|
if (e instanceof tm) return new n({
|
|
8456
8465
|
value: e.value?.value || "",
|
|
8457
8466
|
type: "expression",
|
|
@@ -8570,7 +8579,7 @@ function Zh(e, t, r) {
|
|
|
8570
8579
|
}
|
|
8571
8580
|
//#endregion
|
|
8572
8581
|
//#region src/core/global_modules/records/index.ts
|
|
8573
|
-
var
|
|
8582
|
+
var $h = {
|
|
8574
8583
|
nodeMetadata(t, i) {
|
|
8575
8584
|
if (!M(i, r.Records)) return n.create(e);
|
|
8576
8585
|
let a = i.parent;
|
|
@@ -8585,26 +8594,26 @@ var Qh = {
|
|
|
8585
8594
|
let s = i.parseFile(a.filepath).getValue().ast, c = i.nodeSymbol(s).getFiltered(t);
|
|
8586
8595
|
if (!c) return n.create(void 0);
|
|
8587
8596
|
let l = a.parentOfKind(nm);
|
|
8588
|
-
if (l?.parentNode === o) return
|
|
8597
|
+
if (l?.parentNode === o) return eg(i, o, a);
|
|
8589
8598
|
let u = a.parentOfKind(am);
|
|
8590
|
-
return u?.parentNode === o && l?.parentNode === u ?
|
|
8599
|
+
return u?.parentNode === o && l?.parentNode === u ? tg(i, u, a) : u?.parentNode === o && u.callee?.containsEq(a) ? ng(i, c, a) : ig(i, c, a);
|
|
8591
8600
|
},
|
|
8592
8601
|
bindNode(t, i) {
|
|
8593
|
-
return M(i, r.Records) ? n.create(void 0, new
|
|
8602
|
+
return M(i, r.Records) ? n.create(void 0, new qh(t, i).bind()) : n.create(e);
|
|
8594
8603
|
},
|
|
8595
8604
|
interpretMetadata(t, r, i) {
|
|
8596
|
-
return r instanceof ym ? r.declaration instanceof V ? new
|
|
8605
|
+
return r instanceof ym ? r.declaration instanceof V ? new Jh(t, r, i).interpret() : n.create(void 0) : n.create(e);
|
|
8597
8606
|
}
|
|
8598
8607
|
};
|
|
8599
|
-
function
|
|
8608
|
+
function eg(e, i, a) {
|
|
8600
8609
|
let o = i.parent;
|
|
8601
8610
|
if (o instanceof V && o.isKind(r.Table)) {
|
|
8602
8611
|
let n = e.nodeSymbol(o).getFiltered(t);
|
|
8603
|
-
if (n) return
|
|
8612
|
+
if (n) return rg(e, n, a);
|
|
8604
8613
|
}
|
|
8605
8614
|
return new n(void 0);
|
|
8606
8615
|
}
|
|
8607
|
-
function
|
|
8616
|
+
function tg(e, r, i) {
|
|
8608
8617
|
if (r.callee) {
|
|
8609
8618
|
let n;
|
|
8610
8619
|
if (A(r.callee)) n = e.nodeReferee(r.callee).getFiltered(t);
|
|
@@ -8615,11 +8624,11 @@ function eg(e, r, i) {
|
|
|
8615
8624
|
n = e.nodeReferee(r).getFiltered(t);
|
|
8616
8625
|
}
|
|
8617
8626
|
}
|
|
8618
|
-
if (n) return
|
|
8627
|
+
if (n) return rg(e, n, i);
|
|
8619
8628
|
}
|
|
8620
8629
|
return new n(void 0);
|
|
8621
8630
|
}
|
|
8622
|
-
function
|
|
8631
|
+
function ng(e, t, r) {
|
|
8623
8632
|
if (!A(r)) return new n(void 0);
|
|
8624
8633
|
let i = ep(r) ?? "";
|
|
8625
8634
|
if (!j(r.parentNode)) {
|
|
@@ -8637,12 +8646,12 @@ function tg(e, t, r) {
|
|
|
8637
8646
|
}
|
|
8638
8647
|
return new n(void 0);
|
|
8639
8648
|
}
|
|
8640
|
-
function
|
|
8649
|
+
function rg(e, t, r) {
|
|
8641
8650
|
if (!A(r)) return new n(void 0);
|
|
8642
8651
|
let i = ep(r) ?? "", a = e.lookupMembers(t, R.Column, i);
|
|
8643
8652
|
return a ? n.create(a) : new n(void 0, [new D(E.BINDING_ERROR, `Column '${i}' does not exist in Table 'public.${t.name}'`, r)]);
|
|
8644
8653
|
}
|
|
8645
|
-
function
|
|
8654
|
+
function ig(e, t, r) {
|
|
8646
8655
|
if (!A(r)) return new n(void 0);
|
|
8647
8656
|
let i = ep(r) ?? "";
|
|
8648
8657
|
if (!j(r.parentNode)) return new n(void 0);
|
|
@@ -8671,7 +8680,7 @@ function rg(e, t, r) {
|
|
|
8671
8680
|
}
|
|
8672
8681
|
//#endregion
|
|
8673
8682
|
//#region src/core/global_modules/ref/bind.ts
|
|
8674
|
-
var
|
|
8683
|
+
var ag = class {
|
|
8675
8684
|
constructor(e, t) {
|
|
8676
8685
|
this.compiler = e, this.declarationNode = t;
|
|
8677
8686
|
}
|
|
@@ -8697,7 +8706,7 @@ var ig = class {
|
|
|
8697
8706
|
bindSubElements(e) {
|
|
8698
8707
|
return e.flatMap((e) => e.type ? this.compiler.bindNode(e).getErrors() : []);
|
|
8699
8708
|
}
|
|
8700
|
-
},
|
|
8709
|
+
}, og = class {
|
|
8701
8710
|
constructor(e, t, n) {
|
|
8702
8711
|
this.compiler = e, this.filepath = n, this.metadata = t, this.declarationNode = t.declaration, this.ref = {};
|
|
8703
8712
|
}
|
|
@@ -8750,12 +8759,12 @@ var ig = class {
|
|
|
8750
8759
|
return [];
|
|
8751
8760
|
}
|
|
8752
8761
|
validateRefConstraints() {
|
|
8753
|
-
return this.metadata.cardinalities(this.compiler) ? { hints: [...
|
|
8762
|
+
return this.metadata.cardinalities(this.compiler) ? { hints: [...Fh(this.compiler, this.metadata, "right"), ...Fh(this.compiler, this.metadata, "left")] } : { hints: [] };
|
|
8754
8763
|
}
|
|
8755
8764
|
};
|
|
8756
8765
|
//#endregion
|
|
8757
8766
|
//#region src/core/global_modules/ref/index.ts
|
|
8758
|
-
function
|
|
8767
|
+
function sg(e) {
|
|
8759
8768
|
let t = e.parent;
|
|
8760
8769
|
for (; t;) {
|
|
8761
8770
|
if (t instanceof V && t.isKind(r.Ref)) return t.body?.containsEq(e) ?? !1;
|
|
@@ -8763,11 +8772,11 @@ function og(e) {
|
|
|
8763
8772
|
}
|
|
8764
8773
|
return !1;
|
|
8765
8774
|
}
|
|
8766
|
-
var
|
|
8775
|
+
var cg = {
|
|
8767
8776
|
nodeReferee(r, i) {
|
|
8768
|
-
if (!A(i) && !j(i) || !
|
|
8777
|
+
if (!A(i) && !j(i) || !sg(i) || i.parentOfKind(H)) return n.create(e);
|
|
8769
8778
|
let a = r.parseFile(i.filepath).getValue().ast, o = r.nodeSymbol(a).getValue();
|
|
8770
|
-
return o === t ? n.create(void 0) :
|
|
8779
|
+
return o === t ? n.create(void 0) : ug(r, o, i);
|
|
8771
8780
|
},
|
|
8772
8781
|
nodeMetadata(t, a) {
|
|
8773
8782
|
if (M(a, r.Ref)) {
|
|
@@ -8784,17 +8793,17 @@ var sg = {
|
|
|
8784
8793
|
return n.create(e);
|
|
8785
8794
|
},
|
|
8786
8795
|
bindNode(t, i) {
|
|
8787
|
-
return M(i, r.Ref) ? n.create(void 0, new
|
|
8796
|
+
return M(i, r.Ref) ? n.create(void 0, new ag(t, i).bind()) : n.create(e);
|
|
8788
8797
|
},
|
|
8789
8798
|
interpretMetadata(t, r, i) {
|
|
8790
|
-
return r instanceof hm ? new
|
|
8799
|
+
return r instanceof hm ? new og(t, r, i).interpret() : n.create(e);
|
|
8791
8800
|
}
|
|
8792
8801
|
};
|
|
8793
|
-
function
|
|
8802
|
+
function lg(e, n) {
|
|
8794
8803
|
let r = e.symbolMembers(n).getFiltered(t);
|
|
8795
8804
|
if (r) return r.find((e) => e instanceof Ep && e.isPublicSchema());
|
|
8796
8805
|
}
|
|
8797
|
-
function
|
|
8806
|
+
function ug(e, r, i) {
|
|
8798
8807
|
if (!A(i)) return new n(void 0);
|
|
8799
8808
|
let a = ep(i) ?? "";
|
|
8800
8809
|
if (!j(i.parentNode)) {
|
|
@@ -8828,7 +8837,7 @@ function lg(e, r, i) {
|
|
|
8828
8837
|
let t = e.lookupMembers(r, R.Schema, a);
|
|
8829
8838
|
return t ? n.create(t) : new n(void 0, [new D(E.BINDING_ERROR, `Schema '${a}' does not exist`, i)]);
|
|
8830
8839
|
}
|
|
8831
|
-
let t =
|
|
8840
|
+
let t = lg(e, r);
|
|
8832
8841
|
if (t) {
|
|
8833
8842
|
let r = e.lookupMembers(t, R.Table, a);
|
|
8834
8843
|
if (r) return n.create(r);
|
|
@@ -8840,12 +8849,12 @@ function lg(e, r, i) {
|
|
|
8840
8849
|
}
|
|
8841
8850
|
//#endregion
|
|
8842
8851
|
//#region src/core/global_modules/use/index.ts
|
|
8843
|
-
var
|
|
8852
|
+
var dg = { visibleName(e, n) {
|
|
8844
8853
|
let r = n instanceof z ? n : n.useSpecifierDeclaration instanceof Yp ? n.useSpecifierDeclaration : n.declaration;
|
|
8845
8854
|
if (r instanceof Yp && n instanceof Tp && r.getSymbolKind() !== n.kind && (r = n.declaration), !r) return;
|
|
8846
8855
|
let i = e.nodeAlias(r).getFiltered(t);
|
|
8847
8856
|
return i === void 0 ? e.nodeFullname(r).getFiltered(t) : [i];
|
|
8848
|
-
} },
|
|
8857
|
+
} }, fg = {
|
|
8849
8858
|
nodeSymbol(r, i) {
|
|
8850
8859
|
if (!Nf(i) || !i.name) return n.create(e);
|
|
8851
8860
|
let a = i.getSymbolKind();
|
|
@@ -8856,8 +8865,8 @@ var ug = { visibleName(e, n) {
|
|
|
8856
8865
|
declaration: o?.declaration,
|
|
8857
8866
|
usedSymbol: o,
|
|
8858
8867
|
kind: a,
|
|
8859
|
-
name:
|
|
8860
|
-
}, i.filepath), o === void 0 ? [new D(E.BINDING_ERROR, `Failed to resolve the import of ${a} '${(P(i.name) || []).map(
|
|
8868
|
+
name: dg.visibleName(r, i)?.at(-1)
|
|
8869
|
+
}, i.filepath), o === void 0 ? [new D(E.BINDING_ERROR, `Failed to resolve the import of ${a} '${(P(i.name) || []).map(Mg).join(".")}'`, i)] : []);
|
|
8861
8870
|
},
|
|
8862
8871
|
symbolMembers(r, i) {
|
|
8863
8872
|
if (!(i instanceof Wp)) return n.create(e);
|
|
@@ -8884,7 +8893,7 @@ var ug = { visibleName(e, n) {
|
|
|
8884
8893
|
let a = r.lookupMembers(e, o, c);
|
|
8885
8894
|
return a ? n.create(a) : new n(void 0, [new D(E.BINDING_ERROR, `Could not find ${o} '${c}'`, i)]);
|
|
8886
8895
|
}
|
|
8887
|
-
let f =
|
|
8896
|
+
let f = pg(r, u, c, o);
|
|
8888
8897
|
return f ? n.create(f) : n.create(void 0, [new D(E.BINDING_ERROR, `${o} '${c}' does not exist in file ${u.toString()}`, i)]);
|
|
8889
8898
|
},
|
|
8890
8899
|
bindNode(t, r) {
|
|
@@ -8916,7 +8925,7 @@ var ug = { visibleName(e, n) {
|
|
|
8916
8925
|
}) : n.create(s);
|
|
8917
8926
|
}
|
|
8918
8927
|
};
|
|
8919
|
-
function
|
|
8928
|
+
function pg(e, n, r, i, a = /* @__PURE__ */ new Set()) {
|
|
8920
8929
|
if (!n || a.has(n.intern())) return;
|
|
8921
8930
|
a.add(n.intern());
|
|
8922
8931
|
let o = e.usableMembers(n).getFiltered(t);
|
|
@@ -8928,23 +8937,23 @@ function fg(e, n, r, i, a = /* @__PURE__ */ new Set()) {
|
|
|
8928
8937
|
for (let t of o.reuses.selective) if (P(t.alias ?? t.name)?.at(-1) === r) {
|
|
8929
8938
|
let o = t.parentOfKind(Jp);
|
|
8930
8939
|
if (o?.importPath?.value) {
|
|
8931
|
-
let s =
|
|
8940
|
+
let s = pg(e, yo(n, o.importPath.value), P(t.name)?.at(-1) ?? r, i, a);
|
|
8932
8941
|
if (s) return s;
|
|
8933
8942
|
}
|
|
8934
8943
|
}
|
|
8935
8944
|
for (let { importPath: t } of o.reuses.wildcard) {
|
|
8936
|
-
let n =
|
|
8945
|
+
let n = pg(e, t, r, i, a);
|
|
8937
8946
|
if (n) return n;
|
|
8938
8947
|
}
|
|
8939
8948
|
}
|
|
8940
8949
|
//#endregion
|
|
8941
8950
|
//#region src/compiler/queries/files/usableMembers.ts
|
|
8942
|
-
function
|
|
8951
|
+
function mg(e) {
|
|
8943
8952
|
if (e instanceof vo) {
|
|
8944
8953
|
let { ast: n } = this.parseFile(e).getValue(), r = this.nodeSymbol(n).getFiltered(t);
|
|
8945
8954
|
return this.usableMembers(r);
|
|
8946
8955
|
}
|
|
8947
|
-
let r = e.filepath, i =
|
|
8956
|
+
let r = e.filepath, i = gg(this, r), { nonSchemaMembers: a, schemaMembers: o } = e instanceof Hp ? _g(this, e, i) : vg(this, e, i);
|
|
8948
8957
|
return new n({
|
|
8949
8958
|
nonSchemaMembers: a,
|
|
8950
8959
|
schemaMembers: o,
|
|
@@ -8958,16 +8967,16 @@ function pg(e) {
|
|
|
8958
8967
|
}
|
|
8959
8968
|
}, i.parseResult.getErrors(), i.parseResult.getWarnings());
|
|
8960
8969
|
}
|
|
8961
|
-
function
|
|
8970
|
+
function hg(e, n, r) {
|
|
8962
8971
|
let i = n.qualifiedName, a;
|
|
8963
|
-
if (a = r instanceof Yp ?
|
|
8972
|
+
if (a = r instanceof Yp ? dg.visibleName(e, r) : e.nodeFullname(r).getFiltered(t), !a) return { kind: "none" };
|
|
8964
8973
|
let o = r instanceof Yp && r.getSymbolKind() === R.Schema ? a : a.length <= 1 ? [b] : a.slice(0, -1);
|
|
8965
8974
|
return o.length < i.length || !i.every((e, t) => e === o[t]) ? { kind: "none" } : o.length === i.length ? { kind: "direct" } : {
|
|
8966
8975
|
kind: "child",
|
|
8967
8976
|
schemaName: o[i.length]
|
|
8968
8977
|
};
|
|
8969
8978
|
}
|
|
8970
|
-
function
|
|
8979
|
+
function gg(e, t) {
|
|
8971
8980
|
let n = e.parseFile(t), { ast: r } = n.getValue(), i = [], a = [], o = [], s = [];
|
|
8972
8981
|
for (let e of r.body) {
|
|
8973
8982
|
if (!(e instanceof Jp) || !e.specifiers || !e.importPath) continue;
|
|
@@ -8989,14 +8998,14 @@ function hg(e, t) {
|
|
|
8989
8998
|
wildcardUses: o
|
|
8990
8999
|
};
|
|
8991
9000
|
}
|
|
8992
|
-
function
|
|
9001
|
+
function _g(e, n, r) {
|
|
8993
9002
|
let { ast: i, selectiveUses: a, selectiveReuses: o } = r, s = n.filepath, c = new Map([[b, e.symbolFactory.create(Ep, { name: b }, s)]]);
|
|
8994
9003
|
for (let n of i.declarations) {
|
|
8995
9004
|
let r = e.nodeFullname(n).getFiltered(t) || [], i = r.length <= 1 ? b : r[0];
|
|
8996
9005
|
c.has(i) || c.set(i, e.symbolFactory.create(Ep, { name: i }, s));
|
|
8997
9006
|
}
|
|
8998
|
-
|
|
8999
|
-
for (let t of e.reachableFiles(s)) for (let n of
|
|
9007
|
+
yg(e, [...a, ...o], c, s);
|
|
9008
|
+
for (let t of e.reachableFiles(s)) for (let n of xg(e, t)) c.has(n) || c.set(n, e.symbolFactory.create(Ep, { name: n }, s));
|
|
9000
9009
|
let l = [...c.values()], u = [], d = l.find((e) => e.isPublicSchema());
|
|
9001
9010
|
if (d) {
|
|
9002
9011
|
let n = e.usableMembers(d).getFiltered(t);
|
|
@@ -9007,11 +9016,11 @@ function gg(e, n, r) {
|
|
|
9007
9016
|
schemaMembers: l
|
|
9008
9017
|
};
|
|
9009
9018
|
}
|
|
9010
|
-
function
|
|
9019
|
+
function vg(e, n, r) {
|
|
9011
9020
|
let { ast: i, selectiveUses: a, selectiveReuses: o } = r, s = [], c = /* @__PURE__ */ new Map();
|
|
9012
9021
|
for (let r of i.body) {
|
|
9013
9022
|
if (!(r instanceof V)) continue;
|
|
9014
|
-
let i =
|
|
9023
|
+
let i = hg(e, n, r), a = e.nodeAlias(r).getFiltered(t), o = e.nodeSymbol(r).getFiltered(t);
|
|
9015
9024
|
if (a !== void 0 && n.isPublicSchema() && o && s.push(e.symbolFactory.create(Up, {
|
|
9016
9025
|
kind: o.kind,
|
|
9017
9026
|
declaration: r,
|
|
@@ -9026,9 +9035,9 @@ function _g(e, n, r) {
|
|
|
9026
9035
|
parent: n
|
|
9027
9036
|
}, n.filepath));
|
|
9028
9037
|
}
|
|
9029
|
-
|
|
9038
|
+
bg(e, [...a, ...o], n, c);
|
|
9030
9039
|
let l = n.qualifiedName;
|
|
9031
|
-
for (let t of e.reachableFiles(n.filepath)) for (let r of
|
|
9040
|
+
for (let t of e.reachableFiles(n.filepath)) for (let r of Sg(e, t, l)) c.has(r) || c.set(r, e.symbolFactory.create(Ep, {
|
|
9032
9041
|
name: r,
|
|
9033
9042
|
parent: n
|
|
9034
9043
|
}, n.filepath));
|
|
@@ -9037,18 +9046,18 @@ function _g(e, n, r) {
|
|
|
9037
9046
|
schemaMembers: [...c.values()]
|
|
9038
9047
|
};
|
|
9039
9048
|
}
|
|
9040
|
-
function
|
|
9049
|
+
function yg(e, t, n, r) {
|
|
9041
9050
|
for (let i of t) {
|
|
9042
9051
|
if (i.getSymbolKind() !== R.Schema) continue;
|
|
9043
|
-
let t =
|
|
9052
|
+
let t = dg.visibleName(e, i)?.at(0);
|
|
9044
9053
|
t !== void 0 && !n.has(t) && n.set(t, e.symbolFactory.create(Ep, { name: t }, r));
|
|
9045
9054
|
}
|
|
9046
9055
|
}
|
|
9047
|
-
function
|
|
9056
|
+
function bg(e, t, n, r) {
|
|
9048
9057
|
let i = n.qualifiedName;
|
|
9049
9058
|
for (let a of t) {
|
|
9050
9059
|
if (a.getSymbolKind() !== R.Schema) continue;
|
|
9051
|
-
let t =
|
|
9060
|
+
let t = dg.visibleName(e, a);
|
|
9052
9061
|
if (!t || t.length <= i.length || !i.every((e, n) => e === t[n])) continue;
|
|
9053
9062
|
let o = t[i.length];
|
|
9054
9063
|
o && !r.has(o) && r.set(o, e.symbolFactory.create(Ep, {
|
|
@@ -9057,37 +9066,37 @@ function yg(e, t, n, r) {
|
|
|
9057
9066
|
}, n.filepath));
|
|
9058
9067
|
}
|
|
9059
9068
|
}
|
|
9060
|
-
function
|
|
9069
|
+
function xg(e, n) {
|
|
9061
9070
|
let { ast: r } = e.parseFile(n).getValue(), i = [];
|
|
9062
9071
|
for (let n of r.declarations) {
|
|
9063
9072
|
let r = e.nodeFullname(n).getFiltered(t) || [], a = r.length <= 1 ? b : r[0];
|
|
9064
9073
|
i.push(a);
|
|
9065
9074
|
}
|
|
9066
|
-
let a =
|
|
9075
|
+
let a = gg(e, n);
|
|
9067
9076
|
for (let t of [...a.selectiveUses, ...a.selectiveReuses]) {
|
|
9068
9077
|
if (t.getSymbolKind() !== R.Schema) continue;
|
|
9069
|
-
let n =
|
|
9078
|
+
let n = dg.visibleName(e, t)?.at(0);
|
|
9070
9079
|
n !== void 0 && i.push(n);
|
|
9071
9080
|
}
|
|
9072
9081
|
return i;
|
|
9073
9082
|
}
|
|
9074
|
-
function
|
|
9083
|
+
function Sg(e, n, r) {
|
|
9075
9084
|
let { ast: i } = e.parseFile(n).getValue(), a = [];
|
|
9076
9085
|
for (let n of i.declarations) {
|
|
9077
9086
|
let i = e.nodeFullname(n).getFiltered(t) || [], o = i.length <= 1 ? [b] : i.slice(0, -1);
|
|
9078
9087
|
o.length > r.length && r.every((e, t) => e === o[t]) && a.push(o[r.length]);
|
|
9079
9088
|
}
|
|
9080
|
-
let o =
|
|
9089
|
+
let o = gg(e, n);
|
|
9081
9090
|
for (let t of [...o.selectiveUses, ...o.selectiveReuses]) {
|
|
9082
9091
|
if (t.getSymbolKind() !== R.Schema) continue;
|
|
9083
|
-
let n =
|
|
9092
|
+
let n = dg.visibleName(e, t);
|
|
9084
9093
|
!n || n.length <= r.length || r.every((e, t) => e === n[t]) && a.push(n[r.length]);
|
|
9085
9094
|
}
|
|
9086
9095
|
return a;
|
|
9087
9096
|
}
|
|
9088
9097
|
//#endregion
|
|
9089
9098
|
//#region src/core/global_modules/table/bind.ts
|
|
9090
|
-
var
|
|
9099
|
+
var Cg = class {
|
|
9091
9100
|
constructor(e, t) {
|
|
9092
9101
|
this.compiler = e, this.declarationNode = t;
|
|
9093
9102
|
}
|
|
@@ -9153,7 +9162,7 @@ var Sg = class {
|
|
|
9153
9162
|
bindSubElements(e) {
|
|
9154
9163
|
return e.flatMap((e) => e.type ? this.compiler.bindNode(e).getErrors() : []);
|
|
9155
9164
|
}
|
|
9156
|
-
},
|
|
9165
|
+
}, wg = class {
|
|
9157
9166
|
constructor(e, t, n, r) {
|
|
9158
9167
|
this.compiler = e, this.declarationNode = t, this.symbol = n, this.filepath = r, this.table = {
|
|
9159
9168
|
name: void 0,
|
|
@@ -9301,7 +9310,7 @@ var Sg = class {
|
|
|
9301
9310
|
let i = r.getValue();
|
|
9302
9311
|
return Array.isArray(i) ? this.table.checks.push(...i) : i && this.table.checks.push(i), r.getErrors();
|
|
9303
9312
|
}
|
|
9304
|
-
},
|
|
9313
|
+
}, Tg = {
|
|
9305
9314
|
getDuplicateError(e, t, n) {
|
|
9306
9315
|
return new D(E.DUPLICATE_NAME, `Table '${e}' already exists in schema '${t}'`, n);
|
|
9307
9316
|
},
|
|
@@ -9311,7 +9320,7 @@ var Sg = class {
|
|
|
9311
9320
|
getPartialInjectionDuplicateError(e, t) {
|
|
9312
9321
|
return new D(E.DUPLICATE_TABLE_PARTIAL_INJECTION_NAME, `Duplicate table partial injection '${e}'`, t);
|
|
9313
9322
|
}
|
|
9314
|
-
},
|
|
9323
|
+
}, Eg = {
|
|
9315
9324
|
nodeSymbol(i, a) {
|
|
9316
9325
|
let o = i.nodeFullname(a).getFiltered(t)?.at(-1);
|
|
9317
9326
|
return M(a, r.Table) ? new n(i.symbolFactory.create(kp, {
|
|
@@ -9340,7 +9349,7 @@ var Sg = class {
|
|
|
9340
9349
|
let t = `${e.kind}:${e.name}`;
|
|
9341
9350
|
if (e.name !== void 0) {
|
|
9342
9351
|
let n = e.declaration instanceof V && e.declaration.name ? e.declaration.name : e.declaration, r = l.get(t);
|
|
9343
|
-
r ? e.isKind(R.Column) ? (c.push(
|
|
9352
|
+
r ? e.isKind(R.Column) ? (c.push(Tg.getColumnDuplicateError(e.name, r)), c.push(Tg.getColumnDuplicateError(e.name, n))) : (c.push(Tg.getPartialInjectionDuplicateError(e.name, r)), c.push(Tg.getPartialInjectionDuplicateError(e.name, n))) : l.set(t, n);
|
|
9344
9353
|
}
|
|
9345
9354
|
}
|
|
9346
9355
|
let u = [];
|
|
@@ -9382,18 +9391,18 @@ var Sg = class {
|
|
|
9382
9391
|
nodeReferee(a, o) {
|
|
9383
9392
|
if (!Ff(o, r.Table)) return n.create(e);
|
|
9384
9393
|
let s = a.parseFile(o.filepath).getValue().ast, c = a.nodeSymbol(s).getValue();
|
|
9385
|
-
return c === t ? n.create(void 0) : A(o) && o.parentNode instanceof Qp && o.parentNode.op?.value === "~" ?
|
|
9394
|
+
return c === t ? n.create(void 0) : A(o) && o.parentNode instanceof Qp && o.parentNode.op?.value === "~" ? Dg(a, c, o) : If(o, 1) ? Og(a, c, o) : Rf(o, i.Ref) ? kg(a, c, o) : If(o, 0) ? n.create(e) : Ag(a, c, o);
|
|
9386
9395
|
},
|
|
9387
9396
|
bindNode(i, a) {
|
|
9388
9397
|
if (!M(a, r.Table)) return n.create(e);
|
|
9389
|
-
let o = new
|
|
9398
|
+
let o = new Cg(i, a).bind(), s = i.nodeSymbol(a).getFiltered(t);
|
|
9390
9399
|
return s && o.push(...i.symbolMembers(s).getErrors()), n.create(void 0, o);
|
|
9391
9400
|
},
|
|
9392
9401
|
interpretSymbol(t, r, i) {
|
|
9393
|
-
return r instanceof kp ? r.declaration instanceof V ? new
|
|
9402
|
+
return r instanceof kp ? r.declaration instanceof V ? new wg(t, r.declaration, r, i).interpret() : n.create(void 0) : n.create(e);
|
|
9394
9403
|
}
|
|
9395
9404
|
};
|
|
9396
|
-
function
|
|
9405
|
+
function Dg(e, r, i) {
|
|
9397
9406
|
let a = I(i) ?? "", o = e.symbolMembers(r).getFiltered(t);
|
|
9398
9407
|
if (o) {
|
|
9399
9408
|
let t = o.find((e) => e instanceof Ep && e.isPublicSchema());
|
|
@@ -9405,7 +9414,7 @@ function Eg(e, r, i) {
|
|
|
9405
9414
|
let s = e.lookupMembers(r, R.TablePartial, a);
|
|
9406
9415
|
return s ? n.create(s) : new n(void 0, [new D(E.BINDING_ERROR, `TablePartial '${a}' does not exist in Schema 'public'`, i)]);
|
|
9407
9416
|
}
|
|
9408
|
-
function
|
|
9417
|
+
function Og(e, t, r) {
|
|
9409
9418
|
if (!A(r)) return new n(void 0);
|
|
9410
9419
|
let i = ep(r) ?? "";
|
|
9411
9420
|
if (!j(r.parentNode)) return n.create(e.lookupMembers(t, R.Enum, i));
|
|
@@ -9423,7 +9432,7 @@ function Dg(e, t, r) {
|
|
|
9423
9432
|
}
|
|
9424
9433
|
return new n(void 0);
|
|
9425
9434
|
}
|
|
9426
|
-
function
|
|
9435
|
+
function kg(e, i, a) {
|
|
9427
9436
|
if (!A(a)) return new n(void 0);
|
|
9428
9437
|
let o = ep(a) ?? "";
|
|
9429
9438
|
if (!j(a.parentNode)) {
|
|
@@ -9458,7 +9467,7 @@ function Og(e, i, a) {
|
|
|
9458
9467
|
}
|
|
9459
9468
|
return new n(void 0);
|
|
9460
9469
|
}
|
|
9461
|
-
function
|
|
9470
|
+
function Ag(e, t, r) {
|
|
9462
9471
|
if (!A(r)) return new n(void 0);
|
|
9463
9472
|
let i = ep(r) ?? "";
|
|
9464
9473
|
if (!j(r.parentNode)) return bo.includes(i.toLowerCase()) ? new n(void 0) : n.create(e.lookupMembers(t, R.Enum, i));
|
|
@@ -9487,13 +9496,13 @@ function kg(e, t, r) {
|
|
|
9487
9496
|
}
|
|
9488
9497
|
//#endregion
|
|
9489
9498
|
//#region src/compiler/queries/utils.ts
|
|
9490
|
-
function Ag(e) {
|
|
9491
|
-
return e ? e.split("").every((e) => pf(e) || mf(e)) && !mf(e[0]) : !1;
|
|
9492
|
-
}
|
|
9493
9499
|
function jg(e) {
|
|
9494
|
-
return
|
|
9500
|
+
return e ? e.split("").every((e) => pf(e) || mf(e)) && !mf(e[0]) : !1;
|
|
9495
9501
|
}
|
|
9496
9502
|
function Mg(e) {
|
|
9503
|
+
return jg(e) ? e : `"${Pg(e)}"`;
|
|
9504
|
+
}
|
|
9505
|
+
function Ng(e) {
|
|
9497
9506
|
let t = "", n = 0, r = {
|
|
9498
9507
|
n: "\n",
|
|
9499
9508
|
t: " ",
|
|
@@ -9520,7 +9529,7 @@ function Mg(e) {
|
|
|
9520
9529
|
} else t += e[n], n++;
|
|
9521
9530
|
return t;
|
|
9522
9531
|
}
|
|
9523
|
-
function
|
|
9532
|
+
function Pg(e) {
|
|
9524
9533
|
let t = "";
|
|
9525
9534
|
for (let n = 0; n < e.length; n++) {
|
|
9526
9535
|
let r = e[n];
|
|
@@ -9560,11 +9569,11 @@ function Ng(e) {
|
|
|
9560
9569
|
}
|
|
9561
9570
|
return t;
|
|
9562
9571
|
}
|
|
9563
|
-
function
|
|
9572
|
+
function Fg(e) {
|
|
9564
9573
|
if (e == null) return "null";
|
|
9565
9574
|
if (typeof e == "boolean") return e ? "true" : "false";
|
|
9566
9575
|
if (typeof e == "number") return String(e);
|
|
9567
|
-
if (typeof e == "string") return `'${
|
|
9576
|
+
if (typeof e == "string") return `'${Pg(e)}'`;
|
|
9568
9577
|
let { value: t, type: n } = e;
|
|
9569
9578
|
if (t == null || Io(n) && typeof t == "string" && t.toLowerCase() === "null") return "null";
|
|
9570
9579
|
if (n === "expression") return typeof t == "string" && t.toLowerCase().trim() === "null" ? "null" : `\`${t}\``;
|
|
@@ -9578,20 +9587,20 @@ function Pg(e) {
|
|
|
9578
9587
|
}
|
|
9579
9588
|
if (zo(n)) {
|
|
9580
9589
|
let e = hp(t);
|
|
9581
|
-
return e === null ? `\`${t}\`` : `'${
|
|
9590
|
+
return e === null ? `\`${t}\`` : `'${Pg(e)}'`;
|
|
9582
9591
|
}
|
|
9583
9592
|
let r = dp(t);
|
|
9584
|
-
return r === null ? `\`${t}\`` : `'${
|
|
9593
|
+
return r === null ? `\`${t}\`` : `'${Pg(r)}'`;
|
|
9585
9594
|
}
|
|
9586
|
-
function
|
|
9587
|
-
return (e.match(/"(?:[^"\\]|\\.)*"|[^."]+/g) || []).map((e) => e.startsWith("\"") && e.endsWith("\"") ?
|
|
9595
|
+
function Ig(e) {
|
|
9596
|
+
return (e.match(/"(?:[^"\\]|\\.)*"|[^."]+/g) || []).map((e) => e.startsWith("\"") && e.endsWith("\"") ? Ng(e.slice(1, -1)) : e.trim()).filter((e) => e.length > 0);
|
|
9588
9597
|
}
|
|
9589
|
-
function
|
|
9598
|
+
function Lg(e, t) {
|
|
9590
9599
|
let n = /* @__PURE__ */ new Set(), r = [];
|
|
9591
9600
|
for (let i of t) for (let t of e.reachableFiles(i)) n.has(t.intern()) || (n.add(t.intern()), r.push(t));
|
|
9592
9601
|
return r;
|
|
9593
9602
|
}
|
|
9594
|
-
function
|
|
9603
|
+
function Rg(e) {
|
|
9595
9604
|
let r = [], i = [], a = [];
|
|
9596
9605
|
e.bindProject();
|
|
9597
9606
|
for (let n of e.parseProject().values()) {
|
|
@@ -9609,7 +9618,7 @@ function Lg(e) {
|
|
|
9609
9618
|
}
|
|
9610
9619
|
//#endregion
|
|
9611
9620
|
//#region src/core/global_modules/tableGroup/bind.ts
|
|
9612
|
-
var
|
|
9621
|
+
var zg = class {
|
|
9613
9622
|
constructor(e, t) {
|
|
9614
9623
|
this.compiler = e, this.declarationNode = t;
|
|
9615
9624
|
}
|
|
@@ -9633,7 +9642,7 @@ var Rg = class {
|
|
|
9633
9642
|
bindSubElements(e) {
|
|
9634
9643
|
return e.flatMap((e) => e.type ? this.compiler.bindNode(e).getErrors() : []);
|
|
9635
9644
|
}
|
|
9636
|
-
},
|
|
9645
|
+
}, Bg = class {
|
|
9637
9646
|
constructor(e, t, n) {
|
|
9638
9647
|
this.compiler = e, this.symbol = t, this.declarationNode = t.declaration, this.filepath = n, this.tableGroup = { tables: [] };
|
|
9639
9648
|
}
|
|
@@ -9690,14 +9699,14 @@ var Rg = class {
|
|
|
9690
9699
|
token: L(n)
|
|
9691
9700
|
}, [];
|
|
9692
9701
|
}
|
|
9693
|
-
},
|
|
9702
|
+
}, Vg = {
|
|
9694
9703
|
getDuplicateError(e, t, n) {
|
|
9695
9704
|
return new D(E.DUPLICATE_NAME, `TableGroup '${e}' already exists in schema '${t}'`, n);
|
|
9696
9705
|
},
|
|
9697
9706
|
getFieldDuplicateError(e, t) {
|
|
9698
9707
|
return new D(E.DUPLICATE_NAME, `Duplicate TableGroupField '${e}'`, t);
|
|
9699
9708
|
}
|
|
9700
|
-
},
|
|
9709
|
+
}, Hg = {
|
|
9701
9710
|
nodeSymbol(i, a) {
|
|
9702
9711
|
let o = i.nodeFullname(a).getFiltered(t), s = o?.at(-1);
|
|
9703
9712
|
return M(a, r.TableGroup) ? new n(i.symbolFactory.create(jp, {
|
|
@@ -9705,7 +9714,7 @@ var Rg = class {
|
|
|
9705
9714
|
name: s
|
|
9706
9715
|
}, a.filepath)) : N(a, r.TableGroup) ? new n(i.symbolFactory.create(Mp, {
|
|
9707
9716
|
declaration: a,
|
|
9708
|
-
name: o?.map(
|
|
9717
|
+
name: o?.map(Mg).join(".")
|
|
9709
9718
|
}, a.filepath)) : n.create(e);
|
|
9710
9719
|
},
|
|
9711
9720
|
symbolMembers(r, i) {
|
|
@@ -9723,7 +9732,7 @@ var Rg = class {
|
|
|
9723
9732
|
let t = `${e.kind}:${e.name}`;
|
|
9724
9733
|
if (e.name !== void 0) {
|
|
9725
9734
|
let n = e.declaration instanceof V && e.declaration.name ? e.declaration.name : e.declaration, r = c.get(t);
|
|
9726
|
-
r ? (s.push(
|
|
9735
|
+
r ? (s.push(Vg.getFieldDuplicateError(e.name, r)), s.push(Vg.getFieldDuplicateError(e.name, n))) : c.set(t, n);
|
|
9727
9736
|
}
|
|
9728
9737
|
}
|
|
9729
9738
|
return new n(o, s);
|
|
@@ -9733,19 +9742,19 @@ var Rg = class {
|
|
|
9733
9742
|
nodeReferee(i, a) {
|
|
9734
9743
|
if (!A(a) || !Ff(a, r.TableGroup) || a.parent && Lf(a)) return n.create(e);
|
|
9735
9744
|
let o = i.parseFile(a.filepath).getValue().ast, s = i.nodeSymbol(o).getValue();
|
|
9736
|
-
return s === t ? n.create(void 0) :
|
|
9745
|
+
return s === t ? n.create(void 0) : Ug(i, s, a);
|
|
9737
9746
|
},
|
|
9738
9747
|
bindNode(i, a) {
|
|
9739
9748
|
if (!M(a, r.TableGroup)) return n.create(e);
|
|
9740
|
-
let o = new
|
|
9749
|
+
let o = new zg(i, a).bind(), s = i.nodeSymbol(a).getFiltered(t);
|
|
9741
9750
|
return s && o.push(...i.symbolMembers(s).getErrors()), n.create(void 0, o);
|
|
9742
9751
|
},
|
|
9743
9752
|
interpretSymbol(t, i, a) {
|
|
9744
9753
|
let o = i.declaration;
|
|
9745
|
-
return !M(o, r.TableGroup) || !(i instanceof jp) ? n.create(e) : Mm(t, o) ? new
|
|
9754
|
+
return !M(o, r.TableGroup) || !(i instanceof jp) ? n.create(e) : Mm(t, o) ? new Bg(t, i, a).interpret() : n.create(void 0);
|
|
9746
9755
|
}
|
|
9747
9756
|
};
|
|
9748
|
-
function
|
|
9757
|
+
function Ug(e, r, i) {
|
|
9749
9758
|
let a = ep(i) ?? "";
|
|
9750
9759
|
if (!j(i.parentNode)) {
|
|
9751
9760
|
let o = e.symbolMembers(r).getFiltered(t);
|
|
@@ -9772,7 +9781,7 @@ function Hg(e, r, i) {
|
|
|
9772
9781
|
}
|
|
9773
9782
|
//#endregion
|
|
9774
9783
|
//#region src/core/global_modules/tablePartial/bind.ts
|
|
9775
|
-
var
|
|
9784
|
+
var Wg = class {
|
|
9776
9785
|
constructor(e, t) {
|
|
9777
9786
|
this.compiler = e, this.declarationNode = t;
|
|
9778
9787
|
}
|
|
@@ -9818,7 +9827,7 @@ var Ug = class {
|
|
|
9818
9827
|
bindSubElements(e) {
|
|
9819
9828
|
return e.flatMap((e) => e.type ? this.compiler.bindNode(e).getErrors() : []);
|
|
9820
9829
|
}
|
|
9821
|
-
},
|
|
9830
|
+
}, Gg = class {
|
|
9822
9831
|
constructor(e, t, n) {
|
|
9823
9832
|
this.compiler = e, this.declarationNode = t.declaration, this.symbol = t, this.filepath = n, this.tablePartial = {
|
|
9824
9833
|
name: void 0,
|
|
@@ -9932,9 +9941,9 @@ var Ug = class {
|
|
|
9932
9941
|
let i = r.getValue();
|
|
9933
9942
|
return Array.isArray(i) ? this.tablePartial.checks?.push(...i) : i && this.tablePartial.checks?.push(i), r.getErrors();
|
|
9934
9943
|
}
|
|
9935
|
-
},
|
|
9944
|
+
}, Kg = { getDuplicateError(e, t, n) {
|
|
9936
9945
|
return new D(E.DUPLICATE_NAME, `TablePartial '${e}' already exists in schema '${t}'`, n);
|
|
9937
|
-
} },
|
|
9946
|
+
} }, qg = {
|
|
9938
9947
|
nodeSymbol(i, a) {
|
|
9939
9948
|
let o = i.nodeFullname(a).getFiltered(t)?.at(-1);
|
|
9940
9949
|
return M(a, r.TablePartial) ? new n(i.symbolFactory.create(Pp, {
|
|
@@ -9960,7 +9969,7 @@ var Ug = class {
|
|
|
9960
9969
|
let t = e.name;
|
|
9961
9970
|
if (t !== void 0) {
|
|
9962
9971
|
let n = e.declaration instanceof V && e.declaration.name ? e.declaration.name : e.declaration, r = c.get(t);
|
|
9963
|
-
r ? (s.push(
|
|
9972
|
+
r ? (s.push(Tg.getColumnDuplicateError(t, r)), s.push(Tg.getColumnDuplicateError(t, n))) : c.set(t, n);
|
|
9964
9973
|
}
|
|
9965
9974
|
}
|
|
9966
9975
|
return new n(o, s);
|
|
@@ -9970,18 +9979,18 @@ var Ug = class {
|
|
|
9970
9979
|
nodeReferee(a, o) {
|
|
9971
9980
|
if (!A(o) && !j(o) || !Ff(o, r.TablePartial)) return n.create(e);
|
|
9972
9981
|
let s = a.parseFile(o.filepath).getValue().ast, c = a.nodeSymbol(s).getValue();
|
|
9973
|
-
return c === t ? n.create(void 0) : If(o, 1) ?
|
|
9982
|
+
return c === t ? n.create(void 0) : If(o, 1) ? Jg(a, c, o) : Rf(o, i.Ref) ? Yg(a, c, o) : Xg(a, c, o);
|
|
9974
9983
|
},
|
|
9975
9984
|
bindNode(i, a) {
|
|
9976
9985
|
if (!M(a, r.TablePartial)) return n.create(e);
|
|
9977
|
-
let o = new
|
|
9986
|
+
let o = new Wg(i, a).bind(), s = i.nodeSymbol(a).getFiltered(t);
|
|
9978
9987
|
return s && o.push(...i.symbolMembers(s).getErrors()), n.create(void 0, o);
|
|
9979
9988
|
},
|
|
9980
9989
|
interpretSymbol(t, r, i) {
|
|
9981
|
-
return r instanceof Pp ? r.declaration instanceof V ? new
|
|
9990
|
+
return r instanceof Pp ? r.declaration instanceof V ? new Gg(t, r, i).interpret() : n.create(void 0) : n.create(e);
|
|
9982
9991
|
}
|
|
9983
9992
|
};
|
|
9984
|
-
function
|
|
9993
|
+
function Jg(e, t, r) {
|
|
9985
9994
|
if (!A(r)) return new n(void 0);
|
|
9986
9995
|
let i = ep(r) ?? "";
|
|
9987
9996
|
if (!j(r.parentNode)) return n.create(e.lookupMembers(t, R.Enum, i));
|
|
@@ -9999,7 +10008,7 @@ function qg(e, t, r) {
|
|
|
9999
10008
|
}
|
|
10000
10009
|
return new n(void 0);
|
|
10001
10010
|
}
|
|
10002
|
-
function
|
|
10011
|
+
function Yg(e, i, a) {
|
|
10003
10012
|
if (!A(a)) return new n(void 0);
|
|
10004
10013
|
let o = ep(a) ?? "";
|
|
10005
10014
|
if (!j(a.parentNode)) {
|
|
@@ -10037,7 +10046,7 @@ function Jg(e, i, a) {
|
|
|
10037
10046
|
}
|
|
10038
10047
|
return new n(void 0);
|
|
10039
10048
|
}
|
|
10040
|
-
function
|
|
10049
|
+
function Xg(e, t, r) {
|
|
10041
10050
|
if (!A(r)) return new n(void 0);
|
|
10042
10051
|
let i = ep(r) ?? "";
|
|
10043
10052
|
if (!j(r.parentNode)) return bo.includes(i.toLowerCase()) ? new n(void 0) : n.create(e.lookupMembers(t, R.Enum, i));
|
|
@@ -10066,25 +10075,25 @@ function Yg(e, t, r) {
|
|
|
10066
10075
|
}
|
|
10067
10076
|
//#endregion
|
|
10068
10077
|
//#region src/core/global_modules/schema/index.ts
|
|
10069
|
-
var
|
|
10078
|
+
var Zg = { symbolMembers(r, i) {
|
|
10070
10079
|
if (!i.isKind(R.Schema) || !(i instanceof Ep)) return n.create(e);
|
|
10071
10080
|
let a = i.qualifiedName, o = r.usableMembers(i).getFiltered(t);
|
|
10072
10081
|
if (!o) return n.create([]);
|
|
10073
10082
|
let s = [...o.nonSchemaMembers], c = new Map(o.schemaMembers.map((e) => [e.name, e])), l = [];
|
|
10074
10083
|
for (let e of o.reuses.selective) {
|
|
10075
|
-
let n =
|
|
10084
|
+
let n = $g(r, i, e, c);
|
|
10076
10085
|
l.push(...n.getErrors());
|
|
10077
10086
|
let a = n.getFiltered(t);
|
|
10078
|
-
a && s.push(a), s.push(
|
|
10087
|
+
a && s.push(a), s.push(...e_(r, i, e));
|
|
10079
10088
|
}
|
|
10080
|
-
for (let { importPath: e, node: t } of o.reuses.wildcard) s.push(...
|
|
10089
|
+
for (let { importPath: e, node: t } of o.reuses.wildcard) s.push(...n_(r, i, e, t, c));
|
|
10081
10090
|
for (let e of o.uses.selective) {
|
|
10082
|
-
let n =
|
|
10091
|
+
let n = $g(r, i, e, c);
|
|
10083
10092
|
l.push(...n.getErrors());
|
|
10084
10093
|
let a = n.getFiltered(t);
|
|
10085
|
-
a && s.push(a), s.push(
|
|
10094
|
+
a && s.push(a), s.push(...e_(r, i, e));
|
|
10086
10095
|
}
|
|
10087
|
-
for (let { importPath: e, node: t } of o.uses.wildcard) s.push(...
|
|
10096
|
+
for (let { importPath: e, node: t } of o.uses.wildcard) s.push(...n_(r, i, e, t, c));
|
|
10088
10097
|
s.push(...c.values());
|
|
10089
10098
|
let u = [...s];
|
|
10090
10099
|
{
|
|
@@ -10096,7 +10105,7 @@ var Xg = { symbolMembers(r, i) {
|
|
|
10096
10105
|
i && e.push(...i.filter((e) => e.isKind(R.TableGroup)));
|
|
10097
10106
|
}
|
|
10098
10107
|
}
|
|
10099
|
-
for (let t of e) u.push(...
|
|
10108
|
+
for (let t of e) u.push(...i_(r, i, t));
|
|
10100
10109
|
}
|
|
10101
10110
|
let d = /* @__PURE__ */ new Set(), f = u.filter((e) => {
|
|
10102
10111
|
if (e instanceof Wp && e.isKind(R.Schema)) return !1;
|
|
@@ -10108,23 +10117,23 @@ var Xg = { symbolMembers(r, i) {
|
|
|
10108
10117
|
if (p.get(t)) {
|
|
10109
10118
|
if (e.isKind(R.Schema)) continue;
|
|
10110
10119
|
let t = e instanceof Wp ? e.useSpecifierDeclaration ?? e.declaration : e.declaration instanceof V && e.declaration.name ? e.declaration.name : e.declaration;
|
|
10111
|
-
t && e.name !== void 0 && l.push(
|
|
10120
|
+
t && e.name !== void 0 && l.push(Qg(e.kind, e.name, a.join("."), t));
|
|
10112
10121
|
} else p.set(t, e);
|
|
10113
10122
|
}
|
|
10114
10123
|
return new n(f, l);
|
|
10115
10124
|
} };
|
|
10116
|
-
function
|
|
10125
|
+
function Qg(e, t, n, r) {
|
|
10117
10126
|
switch (e) {
|
|
10118
|
-
case R.Table: return
|
|
10119
|
-
case R.Enum: return
|
|
10120
|
-
case R.TablePartial: return
|
|
10121
|
-
case R.TableGroup: return
|
|
10122
|
-
case R.DiagramView: return
|
|
10127
|
+
case R.Table: return Tg.getDuplicateError(t, n, r);
|
|
10128
|
+
case R.Enum: return Jm.getDuplicateError(t, n, r);
|
|
10129
|
+
case R.TablePartial: return Kg.getDuplicateError(t, n, r);
|
|
10130
|
+
case R.TableGroup: return Vg.getDuplicateError(t, n, r);
|
|
10131
|
+
case R.DiagramView: return Bm.getDuplicateError(t, n, r);
|
|
10123
10132
|
default: return new D(E.DUPLICATE_NAME, `Duplicate ${e} '${t}' in schema '${n}'`, r);
|
|
10124
10133
|
}
|
|
10125
10134
|
}
|
|
10126
|
-
function
|
|
10127
|
-
let o =
|
|
10135
|
+
function $g(e, r, i, a) {
|
|
10136
|
+
let o = hg(e, r, i);
|
|
10128
10137
|
if (o.kind === "none") return n.create(void 0);
|
|
10129
10138
|
if (o.kind === "direct") {
|
|
10130
10139
|
let r = e.nodeSymbol(i);
|
|
@@ -10135,14 +10144,14 @@ function Qg(e, r, i, a) {
|
|
|
10135
10144
|
parent: r
|
|
10136
10145
|
}, r.filepath)), n.create(void 0);
|
|
10137
10146
|
}
|
|
10138
|
-
function
|
|
10147
|
+
function e_(e, n, r, i = /* @__PURE__ */ new Set()) {
|
|
10139
10148
|
if (r.getSymbolKind() !== R.Schema || !r.name) return [];
|
|
10140
10149
|
let a = e.nodeReferee(r.name).getFiltered(t);
|
|
10141
10150
|
if (!a || !a.isKind(R.Schema)) return [];
|
|
10142
|
-
let o =
|
|
10143
|
-
return !o || o.length !== s.length || !o.every((e, t) => e === s[t]) ? [] :
|
|
10151
|
+
let o = dg.visibleName(e, r), s = n.qualifiedName;
|
|
10152
|
+
return !o || o.length !== s.length || !o.every((e, t) => e === s[t]) ? [] : t_(e, n, r, a, i);
|
|
10144
10153
|
}
|
|
10145
|
-
function
|
|
10154
|
+
function t_(e, n, r, i, a) {
|
|
10146
10155
|
let o = i.intern();
|
|
10147
10156
|
if (a.has(o)) return [];
|
|
10148
10157
|
a.add(o);
|
|
@@ -10155,8 +10164,8 @@ function e_(e, n, r, i, a) {
|
|
|
10155
10164
|
useSpecifierDeclaration: r,
|
|
10156
10165
|
name: t.name
|
|
10157
10166
|
}, n.filepath));
|
|
10158
|
-
for (let t of [...c]) t.isKind(R.TableGroup) && c.push(...
|
|
10159
|
-
for (let i of s.reuses.selective) if (c.push(
|
|
10167
|
+
for (let t of [...c]) t.isKind(R.TableGroup) && c.push(...i_(e, n, t));
|
|
10168
|
+
for (let i of s.reuses.selective) if (c.push(...e_(e, n, i, a)), hg(e, n, i).kind === "direct") {
|
|
10160
10169
|
let a = e.nodeSymbol(i).getFiltered(t);
|
|
10161
10170
|
a && a.canBeImported && c.push(e.symbolFactory.create(Wp, {
|
|
10162
10171
|
kind: a.kind,
|
|
@@ -10167,15 +10176,15 @@ function e_(e, n, r, i, a) {
|
|
|
10167
10176
|
}, n.filepath));
|
|
10168
10177
|
}
|
|
10169
10178
|
for (let { importPath: t } of s.reuses.wildcard) {
|
|
10170
|
-
let i =
|
|
10171
|
-
i && c.push(...
|
|
10179
|
+
let i = r_(e, t, n.qualifiedName);
|
|
10180
|
+
i && c.push(...t_(e, n, r, i, a));
|
|
10172
10181
|
}
|
|
10173
10182
|
return c;
|
|
10174
10183
|
}
|
|
10175
|
-
function
|
|
10184
|
+
function n_(e, n, r, i, a, o = /* @__PURE__ */ new Set()) {
|
|
10176
10185
|
if (o.has(r)) return [];
|
|
10177
10186
|
o.add(r);
|
|
10178
|
-
let s =
|
|
10187
|
+
let s = r_(e, r, n.qualifiedName);
|
|
10179
10188
|
if (!s) return [];
|
|
10180
10189
|
let c = e.usableMembers(s).getFiltered(t);
|
|
10181
10190
|
if (!c) return [];
|
|
@@ -10189,13 +10198,13 @@ function t_(e, n, r, i, a, o = /* @__PURE__ */ new Set()) {
|
|
|
10189
10198
|
for (let t of c.schemaMembers) a.has(t.name) || a.set(t.name, e.symbolFactory.create(Ep, { name: t.name }, n.filepath));
|
|
10190
10199
|
let { reuses: { selective: u, wildcard: d } } = c;
|
|
10191
10200
|
for (let r of u) {
|
|
10192
|
-
let i =
|
|
10193
|
-
i && l.push(i), l.push(
|
|
10201
|
+
let i = $g(e, n, r, a).getFiltered(t);
|
|
10202
|
+
i && l.push(i), l.push(...e_(e, n, r));
|
|
10194
10203
|
}
|
|
10195
|
-
for (let { importPath: t } of d) l.push(...
|
|
10204
|
+
for (let { importPath: t } of d) l.push(...n_(e, n, t, i, a, o));
|
|
10196
10205
|
return l;
|
|
10197
10206
|
}
|
|
10198
|
-
function
|
|
10207
|
+
function r_(e, n, r) {
|
|
10199
10208
|
if (r.length === 0) return;
|
|
10200
10209
|
let i = e.usableMembers(n).getFiltered(t);
|
|
10201
10210
|
if (!i) return;
|
|
@@ -10208,7 +10217,7 @@ function n_(e, n, r) {
|
|
|
10208
10217
|
}
|
|
10209
10218
|
return o;
|
|
10210
10219
|
}
|
|
10211
|
-
function
|
|
10220
|
+
function i_(e, n, r) {
|
|
10212
10221
|
if (!r.isKind(R.TableGroup) || !(r instanceof Wp)) return [];
|
|
10213
10222
|
let i = r.originalSymbol, a = e.symbolMembers(i).getFiltered(t);
|
|
10214
10223
|
if (!a) return [];
|
|
@@ -10221,7 +10230,7 @@ function r_(e, n, r) {
|
|
|
10221
10230
|
if (!i || i.length === 0) continue;
|
|
10222
10231
|
let a = i.length <= 1 ? [b] : i.slice(0, -1);
|
|
10223
10232
|
if (a.length !== o.length || !o.every((e, t) => e === a[t])) continue;
|
|
10224
|
-
let c = t.declaration.filepath, l =
|
|
10233
|
+
let c = t.declaration.filepath, l = a_(e, c, i);
|
|
10225
10234
|
l && s.push(e.symbolFactory.create(Wp, {
|
|
10226
10235
|
kind: R.Table,
|
|
10227
10236
|
declaration: l.declaration,
|
|
@@ -10232,7 +10241,7 @@ function r_(e, n, r) {
|
|
|
10232
10241
|
}
|
|
10233
10242
|
return s;
|
|
10234
10243
|
}
|
|
10235
|
-
function
|
|
10244
|
+
function a_(e, n, r) {
|
|
10236
10245
|
if (r.length === 1) {
|
|
10237
10246
|
let i = e.usableMembers(n).getFiltered(t);
|
|
10238
10247
|
return i ? i.nonSchemaMembers.find((e) => e.isKind(R.Table) && e.name === r[0]) : void 0;
|
|
@@ -10246,7 +10255,7 @@ function i_(e, n, r) {
|
|
|
10246
10255
|
}
|
|
10247
10256
|
//#endregion
|
|
10248
10257
|
//#region src/core/global_modules/note/bind.ts
|
|
10249
|
-
var
|
|
10258
|
+
var o_ = class {
|
|
10250
10259
|
constructor(e, t) {
|
|
10251
10260
|
this.compiler = e, this.declarationNode = t;
|
|
10252
10261
|
}
|
|
@@ -10261,7 +10270,7 @@ var a_ = class {
|
|
|
10261
10270
|
bindSubElements(e) {
|
|
10262
10271
|
return e.flatMap((e) => e.type ? this.compiler.bindNode(e).getErrors() : []);
|
|
10263
10272
|
}
|
|
10264
|
-
},
|
|
10273
|
+
}, s_ = class {
|
|
10265
10274
|
constructor(e, t, n) {
|
|
10266
10275
|
this.compiler = e, this.symbol = t, this.declarationNode = t.declaration, this.filepath = n, this.note = {
|
|
10267
10276
|
name: void 0,
|
|
@@ -10294,16 +10303,16 @@ var a_ = class {
|
|
|
10294
10303
|
let t = F(e.callee) ?? "";
|
|
10295
10304
|
return this.note.content = vp(t), [];
|
|
10296
10305
|
}
|
|
10297
|
-
},
|
|
10298
|
-
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10306
|
+
}, c_ = [
|
|
10307
|
+
Eg,
|
|
10308
|
+
Ym,
|
|
10309
|
+
$h,
|
|
10310
|
+
Qm,
|
|
10302
10311
|
Tm,
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10312
|
+
cg,
|
|
10313
|
+
Kh,
|
|
10314
|
+
Hg,
|
|
10315
|
+
qg,
|
|
10307
10316
|
{
|
|
10308
10317
|
nodeSymbol(i, a) {
|
|
10309
10318
|
return !M(a, r.Note) || !(a.parentNode instanceof B) ? n.create(e) : new n(i.symbolFactory.create(Np, {
|
|
@@ -10315,19 +10324,19 @@ var a_ = class {
|
|
|
10315
10324
|
return r.isKind(R.StickyNote) ? new n([]) : n.create(e);
|
|
10316
10325
|
},
|
|
10317
10326
|
bindNode(t, i) {
|
|
10318
|
-
return M(i, r.Note) ? n.create(void 0, new
|
|
10327
|
+
return M(i, r.Note) ? n.create(void 0, new o_(t, i).bind()) : n.create(e);
|
|
10319
10328
|
},
|
|
10320
10329
|
interpretSymbol(t, r, i) {
|
|
10321
|
-
return r instanceof Np ? r.declaration instanceof V ? new
|
|
10330
|
+
return r instanceof Np ? r.declaration instanceof V ? new s_(t, r, i).interpret() : n.create(void 0) : n.create(e);
|
|
10322
10331
|
}
|
|
10323
10332
|
},
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10333
|
+
fg,
|
|
10334
|
+
Zg,
|
|
10335
|
+
Vm,
|
|
10336
|
+
Uh
|
|
10328
10337
|
];
|
|
10329
|
-
function
|
|
10330
|
-
for (let i of
|
|
10338
|
+
function l_(t, ...r) {
|
|
10339
|
+
for (let i of c_) {
|
|
10331
10340
|
let a = i[t];
|
|
10332
10341
|
if (a) {
|
|
10333
10342
|
let t = a(...r);
|
|
@@ -10336,37 +10345,37 @@ function c_(t, ...r) {
|
|
|
10336
10345
|
}
|
|
10337
10346
|
return n.create(e);
|
|
10338
10347
|
}
|
|
10339
|
-
function l_(r) {
|
|
10340
|
-
let i = c_("nodeSymbol", this, r);
|
|
10341
|
-
return i.hasValue(e) ? n.create(t) : i;
|
|
10342
|
-
}
|
|
10343
10348
|
function u_(r) {
|
|
10344
|
-
let i =
|
|
10349
|
+
let i = l_("nodeSymbol", this, r);
|
|
10345
10350
|
return i.hasValue(e) ? n.create(t) : i;
|
|
10346
10351
|
}
|
|
10347
10352
|
function d_(r) {
|
|
10348
|
-
let i =
|
|
10353
|
+
let i = l_("symbolMembers", this, r);
|
|
10349
10354
|
return i.hasValue(e) ? n.create(t) : i;
|
|
10350
10355
|
}
|
|
10351
10356
|
function f_(r) {
|
|
10352
|
-
let i =
|
|
10357
|
+
let i = l_("nodeReferee", this, r);
|
|
10353
10358
|
return i.hasValue(e) ? n.create(t) : i;
|
|
10354
10359
|
}
|
|
10355
10360
|
function p_(r) {
|
|
10356
|
-
let i =
|
|
10361
|
+
let i = l_("bindNode", this, r);
|
|
10357
10362
|
return i.hasValue(e) ? n.create(t) : i;
|
|
10358
10363
|
}
|
|
10359
|
-
function m_(r
|
|
10360
|
-
let
|
|
10361
|
-
return
|
|
10364
|
+
function m_(r) {
|
|
10365
|
+
let i = l_("nodeMetadata", this, r);
|
|
10366
|
+
return i.hasValue(e) ? n.create(t) : i;
|
|
10362
10367
|
}
|
|
10363
10368
|
function h_(r, i) {
|
|
10364
|
-
let a =
|
|
10369
|
+
let a = l_("interpretSymbol", this, r, i);
|
|
10370
|
+
return a.hasValue(e) ? n.create(t) : a;
|
|
10371
|
+
}
|
|
10372
|
+
function g_(r, i) {
|
|
10373
|
+
let a = l_("interpretMetadata", this, r, i);
|
|
10365
10374
|
return a.hasValue(e) ? n.create(t) : a;
|
|
10366
10375
|
}
|
|
10367
10376
|
//#endregion
|
|
10368
10377
|
//#region src/core/local_modules/checks/validate.ts
|
|
10369
|
-
var
|
|
10378
|
+
var __ = class {
|
|
10370
10379
|
constructor(e, t) {
|
|
10371
10380
|
this.compiler = e, this.declarationNode = t;
|
|
10372
10381
|
}
|
|
@@ -10420,10 +10429,10 @@ var g_ = class {
|
|
|
10420
10429
|
validateSubElements(e) {
|
|
10421
10430
|
return e.flatMap((e) => e.type ? this.compiler.validateNode(e).getErrors() : []);
|
|
10422
10431
|
}
|
|
10423
|
-
},
|
|
10432
|
+
}, v_ = {
|
|
10424
10433
|
validateNode(t, i) {
|
|
10425
10434
|
if (!M(i, r.Checks)) return n.create(e);
|
|
10426
|
-
let a = new
|
|
10435
|
+
let a = new __(t, i);
|
|
10427
10436
|
return n.create(void 0, a.validate());
|
|
10428
10437
|
},
|
|
10429
10438
|
nodeFullname(t, i) {
|
|
@@ -10435,7 +10444,7 @@ var g_ = class {
|
|
|
10435
10444
|
nodeSettings(t, i) {
|
|
10436
10445
|
return M(i, r.Checks) ? i.attributeList ? new n({}, [new D(E.UNEXPECTED_SETTINGS, "A Checks shouldn't have a setting list", i.attributeList)]) : new n({}) : n.create(e);
|
|
10437
10446
|
}
|
|
10438
|
-
},
|
|
10447
|
+
}, y_ = class {
|
|
10439
10448
|
constructor(e, t) {
|
|
10440
10449
|
this.declarationNode = t, this.compiler = e;
|
|
10441
10450
|
}
|
|
@@ -10469,25 +10478,25 @@ var g_ = class {
|
|
|
10469
10478
|
};
|
|
10470
10479
|
//#endregion
|
|
10471
10480
|
//#region src/core/local_modules/custom/index.ts
|
|
10472
|
-
function
|
|
10481
|
+
function b_(e) {
|
|
10473
10482
|
return e instanceof V && !!e.type?.value;
|
|
10474
10483
|
}
|
|
10475
|
-
var
|
|
10484
|
+
var x_ = {
|
|
10476
10485
|
validateNode(t, r) {
|
|
10477
|
-
if (!
|
|
10478
|
-
let i = new
|
|
10486
|
+
if (!b_(r)) return n.create(e);
|
|
10487
|
+
let i = new y_(t, r);
|
|
10479
10488
|
return n.create(void 0, i.validate());
|
|
10480
10489
|
},
|
|
10481
10490
|
nodeFullname(t, r) {
|
|
10482
|
-
return
|
|
10491
|
+
return b_(r) ? r.name ? new n(void 0, [new D(E.UNEXPECTED_NAME, "A custom field shouldn't have a name", r.name)]) : new n(void 0) : n.create(e);
|
|
10483
10492
|
},
|
|
10484
10493
|
nodeAlias(t, r) {
|
|
10485
|
-
return
|
|
10494
|
+
return b_(r) ? r.alias ? new n(void 0, [new D(E.UNEXPECTED_NAME, "A custom field shouldn't have an alias", r.alias)]) : new n(void 0) : n.create(e);
|
|
10486
10495
|
},
|
|
10487
10496
|
nodeSettings(t, r) {
|
|
10488
|
-
return
|
|
10497
|
+
return b_(r) ? r.attributeList ? new n({}, [new D(E.UNEXPECTED_SETTINGS, "A custom field shouldn't have a setting list", r.attributeList)]) : new n({}) : n.create(e);
|
|
10489
10498
|
}
|
|
10490
|
-
},
|
|
10499
|
+
}, S_ = class {
|
|
10491
10500
|
constructor(e, t) {
|
|
10492
10501
|
this.compiler = e, this.declarationNode = t;
|
|
10493
10502
|
}
|
|
@@ -10580,10 +10589,10 @@ var b_ = {
|
|
|
10580
10589
|
for (let e of n) kf(e.callee) || (e.args.length > 0 || !P(e.callee)) && t.push(...e.args.map((e) => new D(E.INVALID_DIAGRAMVIEW_FIELD, "DiagramView field should only have a single name", e)));
|
|
10581
10590
|
return t;
|
|
10582
10591
|
}
|
|
10583
|
-
},
|
|
10592
|
+
}, C_ = {
|
|
10584
10593
|
validateNode(t, i) {
|
|
10585
10594
|
if (!M(i, r.DiagramView)) return n.create(e);
|
|
10586
|
-
let { errors: a, warnings: o } = new
|
|
10595
|
+
let { errors: a, warnings: o } = new S_(t, i).validate();
|
|
10587
10596
|
return n.create(void 0, a, o);
|
|
10588
10597
|
},
|
|
10589
10598
|
nodeFullname(t, i) {
|
|
@@ -10600,7 +10609,7 @@ var b_ = {
|
|
|
10600
10609
|
nodeAlias(t, i) {
|
|
10601
10610
|
return M(i, r.DiagramView) ? new n(void 0) : n.create(e);
|
|
10602
10611
|
}
|
|
10603
|
-
},
|
|
10612
|
+
}, w_ = class {
|
|
10604
10613
|
constructor(e, t) {
|
|
10605
10614
|
this.compiler = e, this.declarationNode = t;
|
|
10606
10615
|
}
|
|
@@ -10659,9 +10668,9 @@ var b_ = {
|
|
|
10659
10668
|
validateSubElements(e) {
|
|
10660
10669
|
return e.flatMap((e) => e.type ? this.compiler.validateNode(e).getErrors() : []);
|
|
10661
10670
|
}
|
|
10662
|
-
},
|
|
10671
|
+
}, T_ = {
|
|
10663
10672
|
validateNode(t, i) {
|
|
10664
|
-
return M(i, r.Enum) ? n.create(void 0, new
|
|
10673
|
+
return M(i, r.Enum) ? n.create(void 0, new w_(t, i).validate()) : n.create(e);
|
|
10665
10674
|
},
|
|
10666
10675
|
nodeFullname(t, i) {
|
|
10667
10676
|
if (M(i, r.Enum)) {
|
|
@@ -10697,7 +10706,7 @@ var b_ = {
|
|
|
10697
10706
|
}
|
|
10698
10707
|
return n.create(e);
|
|
10699
10708
|
}
|
|
10700
|
-
},
|
|
10709
|
+
}, E_ = class {
|
|
10701
10710
|
constructor(e, t) {
|
|
10702
10711
|
this.compiler = e, this.declarationNode = t;
|
|
10703
10712
|
}
|
|
@@ -10766,9 +10775,9 @@ var b_ = {
|
|
|
10766
10775
|
validateSubElements(e) {
|
|
10767
10776
|
return e.flatMap((e) => e.type ? this.compiler.validateNode(e).getErrors() : []);
|
|
10768
10777
|
}
|
|
10769
|
-
},
|
|
10778
|
+
}, D_ = {
|
|
10770
10779
|
validateNode(t, i) {
|
|
10771
|
-
return M(i, r.Indexes) ? n.create(void 0, new
|
|
10780
|
+
return M(i, r.Indexes) ? n.create(void 0, new E_(t, i).validate()) : n.create(e);
|
|
10772
10781
|
},
|
|
10773
10782
|
nodeFullname(t, i) {
|
|
10774
10783
|
return M(i, r.Indexes) ? i.name ? new n(void 0, [new D(E.UNEXPECTED_NAME, "An Indexes shouldn't have a name", i.name)]) : new n(void 0) : N(i, r.Indexes) ? new n(void 0) : n.create(e);
|
|
@@ -10806,7 +10815,7 @@ var b_ = {
|
|
|
10806
10815
|
}
|
|
10807
10816
|
return n.create(e);
|
|
10808
10817
|
}
|
|
10809
|
-
},
|
|
10818
|
+
}, O_ = class {
|
|
10810
10819
|
constructor(e, t) {
|
|
10811
10820
|
this.compiler = e, this.declarationNode = t;
|
|
10812
10821
|
}
|
|
@@ -10861,9 +10870,9 @@ var b_ = {
|
|
|
10861
10870
|
validateSubElements(e) {
|
|
10862
10871
|
return e.flatMap((e) => e.type ? this.compiler.validateNode(e).getErrors() : []);
|
|
10863
10872
|
}
|
|
10864
|
-
},
|
|
10873
|
+
}, k_ = {
|
|
10865
10874
|
validateNode(t, i) {
|
|
10866
|
-
return M(i, r.Note) ? n.create(void 0, new
|
|
10875
|
+
return M(i, r.Note) ? n.create(void 0, new O_(t, i).validate()) : n.create(e);
|
|
10867
10876
|
},
|
|
10868
10877
|
nodeFullname(t, i) {
|
|
10869
10878
|
if (!M(i, r.Note)) return n.create(e);
|
|
@@ -10879,7 +10888,7 @@ var b_ = {
|
|
|
10879
10888
|
nodeSettings(t, i) {
|
|
10880
10889
|
return M(i, r.Note) ? i.attributeList ? new n({}, [new D(E.UNEXPECTED_SETTINGS, "A Note shouldn't have a setting list", i.attributeList)]) : new n({}) : n.create(e);
|
|
10881
10890
|
}
|
|
10882
|
-
},
|
|
10891
|
+
}, A_ = class {
|
|
10883
10892
|
constructor(e, t) {
|
|
10884
10893
|
this.ast = t, this.compiler = e;
|
|
10885
10894
|
}
|
|
@@ -10891,9 +10900,9 @@ var b_ = {
|
|
|
10891
10900
|
}
|
|
10892
10901
|
return new n(this.ast, e, t);
|
|
10893
10902
|
}
|
|
10894
|
-
},
|
|
10903
|
+
}, j_ = {
|
|
10895
10904
|
validateNode(t, r) {
|
|
10896
|
-
return Pf(r) ? n.create(void 0, new
|
|
10905
|
+
return Pf(r) ? n.create(void 0, new A_(t, r).validate().getErrors()) : n.create(e);
|
|
10897
10906
|
},
|
|
10898
10907
|
nodeFullname(t, r) {
|
|
10899
10908
|
return Pf(r) ? new n(void 0) : n.create(e);
|
|
@@ -10904,7 +10913,7 @@ var b_ = {
|
|
|
10904
10913
|
nodeSettings(t, r) {
|
|
10905
10914
|
return Pf(r) ? new n({}) : n.create(e);
|
|
10906
10915
|
}
|
|
10907
|
-
},
|
|
10916
|
+
}, M_ = class {
|
|
10908
10917
|
constructor(e, t) {
|
|
10909
10918
|
this.compiler = e, this.declarationNode = t;
|
|
10910
10919
|
}
|
|
@@ -10938,9 +10947,9 @@ var b_ = {
|
|
|
10938
10947
|
validateSubElements(e) {
|
|
10939
10948
|
return e.flatMap((e) => e.type ? this.compiler.validateNode(e).getErrors() : []);
|
|
10940
10949
|
}
|
|
10941
|
-
},
|
|
10950
|
+
}, N_ = {
|
|
10942
10951
|
validateNode(t, i) {
|
|
10943
|
-
return M(i, r.Project) ? n.create(void 0, new
|
|
10952
|
+
return M(i, r.Project) ? n.create(void 0, new M_(t, i).validate()) : n.create(e);
|
|
10944
10953
|
},
|
|
10945
10954
|
nodeFullname(t, i) {
|
|
10946
10955
|
return M(i, r.Project) ? i.name ? yf(i.name) ? new n(P(i.name)) : new n(void 0, [new D(E.INVALID_NAME, "A Project's name is optional or must be an identifier or a quoted identifer", i.name)]) : new n(void 0) : N(i, r.Project) ? new n(void 0) : n.create(e);
|
|
@@ -10951,7 +10960,7 @@ var b_ = {
|
|
|
10951
10960
|
nodeSettings(t, i) {
|
|
10952
10961
|
return M(i, r.Project) ? i.attributeList ? new n({}, [new D(E.UNEXPECTED_SETTINGS, "A Project shouldn't have a setting list", i.attributeList)]) : new n({}) : N(i, r.Project) ? new n({}) : n.create(e);
|
|
10953
10962
|
}
|
|
10954
|
-
},
|
|
10963
|
+
}, P_ = class {
|
|
10955
10964
|
constructor(e, t) {
|
|
10956
10965
|
this.declarationNode = t, this.compiler = e;
|
|
10957
10966
|
}
|
|
@@ -11016,9 +11025,9 @@ var b_ = {
|
|
|
11016
11025
|
validateSubElements(e) {
|
|
11017
11026
|
return e.flatMap((e) => e.type ? this.compiler.validateNode(e).getErrors() : []);
|
|
11018
11027
|
}
|
|
11019
|
-
},
|
|
11028
|
+
}, F_ = {
|
|
11020
11029
|
validateNode(t, i) {
|
|
11021
|
-
return M(i, r.Records) ? n.create(void 0, new
|
|
11030
|
+
return M(i, r.Records) ? n.create(void 0, new P_(t, i).validate()) : n.create(e);
|
|
11022
11031
|
},
|
|
11023
11032
|
nodeFullname(i, a) {
|
|
11024
11033
|
if (M(a, r.Records)) {
|
|
@@ -11042,7 +11051,7 @@ var b_ = {
|
|
|
11042
11051
|
nodeSettings(t, i) {
|
|
11043
11052
|
return M(i, r.Records) ? i.attributeList ? new n({}, [new D(E.UNEXPECTED_SETTINGS, "Records cannot have a setting list", i.attributeList)]) : new n({}) : N(i, r.Records) ? new n({}) : n.create(e);
|
|
11044
11053
|
}
|
|
11045
|
-
},
|
|
11054
|
+
}, I_ = class {
|
|
11046
11055
|
constructor(e, t) {
|
|
11047
11056
|
this.compiler = e, this.declarationNode = t;
|
|
11048
11057
|
}
|
|
@@ -11097,13 +11106,13 @@ var b_ = {
|
|
|
11097
11106
|
}), t;
|
|
11098
11107
|
}
|
|
11099
11108
|
validateFieldSettings(e) {
|
|
11100
|
-
return
|
|
11109
|
+
return R_(e).getErrors();
|
|
11101
11110
|
}
|
|
11102
11111
|
validateSubElements(e) {
|
|
11103
11112
|
return e.flatMap((e) => e.type ? this.compiler.validateNode(e).getErrors() : []);
|
|
11104
11113
|
}
|
|
11105
11114
|
};
|
|
11106
|
-
function
|
|
11115
|
+
function L_(e) {
|
|
11107
11116
|
if (!(A(e) && e.expression.variable.kind !== y.QUOTED_STRING) && !(e instanceof Zp)) return !1;
|
|
11108
11117
|
let t;
|
|
11109
11118
|
if (t = e instanceof Zp ? Gf(e) || "" : e.expression.variable.value, t) switch (t.toLowerCase()) {
|
|
@@ -11116,13 +11125,13 @@ function I_(e) {
|
|
|
11116
11125
|
}
|
|
11117
11126
|
return !1;
|
|
11118
11127
|
}
|
|
11119
|
-
function
|
|
11128
|
+
function R_(e) {
|
|
11120
11129
|
let t = O(e), r = t.getErrors(), a = t.getValue(), o = {};
|
|
11121
11130
|
for (let [e, t] of Object.entries(a)) switch (e) {
|
|
11122
11131
|
case i.Delete:
|
|
11123
11132
|
case i.Update:
|
|
11124
11133
|
t.length > 1 && t.forEach((t) => r.push(new D(E.DUPLICATE_REF_SETTING, `'${e}' can only appear once`, t))), t.forEach((t) => {
|
|
11125
|
-
|
|
11134
|
+
L_(t.value) || r.push(new D(E.INVALID_REF_SETTING_VALUE, `'${e}' can only have values "cascade", "no action", "set null", "set default" or "restrict"`, t));
|
|
11126
11135
|
}), o[e] = t;
|
|
11127
11136
|
break;
|
|
11128
11137
|
case i.Color:
|
|
@@ -11141,9 +11150,9 @@ function L_(e) {
|
|
|
11141
11150
|
}
|
|
11142
11151
|
//#endregion
|
|
11143
11152
|
//#region src/core/local_modules/ref/index.ts
|
|
11144
|
-
var
|
|
11153
|
+
var z_ = {
|
|
11145
11154
|
validateNode(t, i) {
|
|
11146
|
-
return M(i, r.Ref) ? n.create(void 0, new
|
|
11155
|
+
return M(i, r.Ref) ? n.create(void 0, new I_(t, i).validate()) : n.create(e);
|
|
11147
11156
|
},
|
|
11148
11157
|
nodeFullname(t, i) {
|
|
11149
11158
|
return M(i, r.Ref) ? i.name ? yf(i.name) ? new n(P(i.name)) : new n(void 0, [new D(E.INVALID_NAME, "A Ref's name is optional or must be an identifier or a quoted identifer", i.name)]) : new n(void 0) : N(i, r.Ref) ? new n(void 0) : n.create(e);
|
|
@@ -11155,11 +11164,11 @@ var R_ = {
|
|
|
11155
11164
|
if (M(i, r.Ref)) return i.attributeList ? new n({}, [new D(E.UNEXPECTED_SETTINGS, "A Ref shouldn't have a setting list", i.attributeList)]) : new n({});
|
|
11156
11165
|
if (N(i, r.Ref)) {
|
|
11157
11166
|
let e = [...i.args], t;
|
|
11158
|
-
return _(e) instanceof G ? t = _(e) : e[0] instanceof G && (t = e[0]), t ?
|
|
11167
|
+
return _(e) instanceof G ? t = _(e) : e[0] instanceof G && (t = e[0]), t ? R_(t) : new n({});
|
|
11159
11168
|
}
|
|
11160
11169
|
return n.create(e);
|
|
11161
11170
|
}
|
|
11162
|
-
},
|
|
11171
|
+
}, B_ = class {
|
|
11163
11172
|
constructor(e, t) {
|
|
11164
11173
|
this.declarationNode = t, this.compiler = e;
|
|
11165
11174
|
}
|
|
@@ -11297,7 +11306,7 @@ var R_ = {
|
|
|
11297
11306
|
return n.length > 1 && t.push(...n.map((e) => new D(E.NOTE_REDEFINED, "Duplicate notes are defined", e))), t;
|
|
11298
11307
|
}
|
|
11299
11308
|
};
|
|
11300
|
-
function
|
|
11309
|
+
function V_(e) {
|
|
11301
11310
|
let t = O(e), r = t.getErrors(), a = t.getValue();
|
|
11302
11311
|
return xa(a, (e, t) => {
|
|
11303
11312
|
switch (t) {
|
|
@@ -11315,7 +11324,7 @@ function B_(e) {
|
|
|
11315
11324
|
}
|
|
11316
11325
|
}), new n(a, r);
|
|
11317
11326
|
}
|
|
11318
|
-
function
|
|
11327
|
+
function H_(e) {
|
|
11319
11328
|
if (!e.slice(0, -1).every(Af) || !e.slice(-1).every((e) => Af(e) || e instanceof G)) return new n({}, e.map((e) => new D(E.INVALID_COLUMN, "These fields must be some inline settings optionally ended with a setting list", e)));
|
|
11320
11329
|
if (e.length === 0) return new n({});
|
|
11321
11330
|
let t;
|
|
@@ -11391,9 +11400,9 @@ function V_(e) {
|
|
|
11391
11400
|
}
|
|
11392
11401
|
//#endregion
|
|
11393
11402
|
//#region src/core/local_modules/table/index.ts
|
|
11394
|
-
var
|
|
11403
|
+
var U_ = {
|
|
11395
11404
|
validateNode(t, i) {
|
|
11396
|
-
return M(i, r.Table) ? n.create(void 0, new
|
|
11405
|
+
return M(i, r.Table) ? n.create(void 0, new B_(t, i).validate()) : n.create(e);
|
|
11397
11406
|
},
|
|
11398
11407
|
nodeFullname(t, i) {
|
|
11399
11408
|
if (M(i, r.Table)) {
|
|
@@ -11416,9 +11425,9 @@ var H_ = {
|
|
|
11416
11425
|
return M(i, r.Table) ? i.alias ? vf(i.alias) ? new n(I(i.alias)) : new n(void 0, [new D(E.INVALID_ALIAS, "Table aliases can only contain alphanumeric and underscore unless surrounded by double quotes", i.alias)]) : new n(void 0) : N(i, r.Table) ? new n(void 0) : n.create(e);
|
|
11417
11426
|
},
|
|
11418
11427
|
nodeSettings(t, i) {
|
|
11419
|
-
return M(i, r.Table) ? i.attributeList ?
|
|
11428
|
+
return M(i, r.Table) ? i.attributeList ? V_(i.attributeList) : new n({}) : N(i, r.Table) ? H_(i.args.slice(1)) : n.create(e);
|
|
11420
11429
|
}
|
|
11421
|
-
},
|
|
11430
|
+
}, W_ = class {
|
|
11422
11431
|
constructor(e, t) {
|
|
11423
11432
|
this.declarationNode = t, this.compiler = e;
|
|
11424
11433
|
}
|
|
@@ -11476,7 +11485,7 @@ var H_ = {
|
|
|
11476
11485
|
return n.length > 1 && t.push(...n.map((e) => new D(E.NOTE_REDEFINED, "Duplicate notes are defined", e))), t;
|
|
11477
11486
|
}
|
|
11478
11487
|
};
|
|
11479
|
-
function
|
|
11488
|
+
function G_(e) {
|
|
11480
11489
|
let t = O(e), r = t.getErrors(), i = t.getValue(), a = {};
|
|
11481
11490
|
for (let [e, t] of Object.entries(i)) switch (e) {
|
|
11482
11491
|
case "color":
|
|
@@ -11497,9 +11506,9 @@ function W_(e) {
|
|
|
11497
11506
|
}
|
|
11498
11507
|
//#endregion
|
|
11499
11508
|
//#region src/core/local_modules/tableGroup/index.ts
|
|
11500
|
-
var
|
|
11509
|
+
var K_ = {
|
|
11501
11510
|
validateNode(t, i) {
|
|
11502
|
-
return M(i, r.TableGroup) ? n.create(void 0, new
|
|
11511
|
+
return M(i, r.TableGroup) ? n.create(void 0, new W_(t, i).validate()) : n.create(e);
|
|
11503
11512
|
},
|
|
11504
11513
|
nodeFullname(t, i) {
|
|
11505
11514
|
if (M(i, r.TableGroup)) return i.name ? yf(i.name) ? new n(P(i.name)) : new n(void 0, [new D(E.INVALID_NAME, "A TableGroup name must be a single identifier", i.name)]) : new n(void 0, [new D(E.NAME_NOT_FOUND, "A TableGroup must have a name", i)]);
|
|
@@ -11513,9 +11522,9 @@ var G_ = {
|
|
|
11513
11522
|
return M(i, r.TableGroup) ? i.alias ? new n(void 0, [new D(E.UNEXPECTED_ALIAS, "A TableGroup shouldn't have an alias", i.alias)]) : new n(void 0) : N(i, r.TableGroup) ? new n(void 0) : n.create(e);
|
|
11514
11523
|
},
|
|
11515
11524
|
nodeSettings(t, i) {
|
|
11516
|
-
return M(i, r.TableGroup) ?
|
|
11525
|
+
return M(i, r.TableGroup) ? G_(i.attributeList) : N(i, r.TableGroup) ? new n({}) : n.create(e);
|
|
11517
11526
|
}
|
|
11518
|
-
},
|
|
11527
|
+
}, q_ = class {
|
|
11519
11528
|
constructor(e, t) {
|
|
11520
11529
|
this.compiler = e, this.declarationNode = t;
|
|
11521
11530
|
}
|
|
@@ -11650,7 +11659,7 @@ var G_ = {
|
|
|
11650
11659
|
return n.length > 1 && t.push(...n.map((e) => new D(E.NOTE_REDEFINED, "Duplicate notes are defined", e))), t;
|
|
11651
11660
|
}
|
|
11652
11661
|
};
|
|
11653
|
-
function
|
|
11662
|
+
function J_(e) {
|
|
11654
11663
|
let t = O(e), r = t.getErrors(), a = t.getValue();
|
|
11655
11664
|
return xa(a, (e, t) => {
|
|
11656
11665
|
switch (t) {
|
|
@@ -11668,7 +11677,7 @@ function q_(e) {
|
|
|
11668
11677
|
}
|
|
11669
11678
|
}), new n(a, r);
|
|
11670
11679
|
}
|
|
11671
|
-
function
|
|
11680
|
+
function Y_(e) {
|
|
11672
11681
|
let t = _(e);
|
|
11673
11682
|
if (e.length > 0 && (!e.slice(0, -1).every(Af) || !(Af(t) || t instanceof G))) return new n({}, e.map((e) => new D(E.INVALID_COLUMN, "These fields must be some inline settings optionally ended with a setting list", e)));
|
|
11674
11683
|
if (e.length === 0) return new n({});
|
|
@@ -11745,9 +11754,9 @@ function J_(e) {
|
|
|
11745
11754
|
}
|
|
11746
11755
|
//#endregion
|
|
11747
11756
|
//#region src/core/local_modules/tablePartial/index.ts
|
|
11748
|
-
var
|
|
11757
|
+
var X_ = {
|
|
11749
11758
|
validateNode(t, i) {
|
|
11750
|
-
return M(i, r.TablePartial) ? n.create(void 0, new
|
|
11759
|
+
return M(i, r.TablePartial) ? n.create(void 0, new q_(t, i).validate()) : n.create(e);
|
|
11751
11760
|
},
|
|
11752
11761
|
nodeFullname(t, i) {
|
|
11753
11762
|
if (M(i, r.TablePartial)) return i.name ? yf(i.name) ? new n(P(i.name)) : new n(void 0, [new D(E.INVALID_NAME, "A TablePartial name must be an identifier or a quoted identifer", i.name)]) : new n(void 0, [new D(E.NAME_NOT_FOUND, "A TablePartial must have a name", i)]);
|
|
@@ -11761,9 +11770,9 @@ var Y_ = {
|
|
|
11761
11770
|
return M(i, r.TablePartial) ? i.alias ? new n(void 0, [new D(E.UNEXPECTED_ALIAS, "A TablePartial shouldn't have an alias", i.alias)]) : new n(I(i.alias)) : N(i, r.TablePartial) ? new n(void 0) : n.create(e);
|
|
11762
11771
|
},
|
|
11763
11772
|
nodeSettings(t, i) {
|
|
11764
|
-
return M(i, r.TablePartial) ?
|
|
11773
|
+
return M(i, r.TablePartial) ? J_(i.attributeList) : N(i, r.TablePartial) ? Y_(i.args.slice(1)) : n.create(e);
|
|
11765
11774
|
}
|
|
11766
|
-
},
|
|
11775
|
+
}, Z_ = class {
|
|
11767
11776
|
constructor(e, t) {
|
|
11768
11777
|
this.compiler = e, this.declarationNode = t;
|
|
11769
11778
|
}
|
|
@@ -11787,22 +11796,22 @@ var Y_ = {
|
|
|
11787
11796
|
...this.compiler.nodeAlias(e).getErrors()
|
|
11788
11797
|
];
|
|
11789
11798
|
}
|
|
11790
|
-
},
|
|
11791
|
-
|
|
11792
|
-
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11796
|
-
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
|
|
11801
|
-
|
|
11802
|
-
|
|
11799
|
+
}, Q_ = [
|
|
11800
|
+
U_,
|
|
11801
|
+
T_,
|
|
11802
|
+
F_,
|
|
11803
|
+
D_,
|
|
11804
|
+
v_,
|
|
11805
|
+
z_,
|
|
11806
|
+
N_,
|
|
11807
|
+
K_,
|
|
11808
|
+
X_,
|
|
11809
|
+
k_,
|
|
11810
|
+
C_,
|
|
11811
|
+
j_,
|
|
11803
11812
|
{
|
|
11804
11813
|
validateNode(t, r) {
|
|
11805
|
-
return r instanceof Jp ? n.create(void 0, new
|
|
11814
|
+
return r instanceof Jp ? n.create(void 0, new Z_(t, r).validate()) : n.create(e);
|
|
11806
11815
|
},
|
|
11807
11816
|
nodeFullname(t, r) {
|
|
11808
11817
|
if (!Nf(r)) return n.create(e);
|
|
@@ -11816,10 +11825,10 @@ var Y_ = {
|
|
|
11816
11825
|
return r instanceof Jp ? n.create({}) : n.create(e);
|
|
11817
11826
|
}
|
|
11818
11827
|
},
|
|
11819
|
-
|
|
11828
|
+
x_
|
|
11820
11829
|
];
|
|
11821
|
-
function
|
|
11822
|
-
for (let n of
|
|
11830
|
+
function $_(t, ...r) {
|
|
11831
|
+
for (let n of Q_) {
|
|
11823
11832
|
let i = n[t];
|
|
11824
11833
|
if (i) {
|
|
11825
11834
|
let t = i(...r);
|
|
@@ -11828,57 +11837,57 @@ function Q_(t, ...r) {
|
|
|
11828
11837
|
}
|
|
11829
11838
|
return n.create(e);
|
|
11830
11839
|
}
|
|
11831
|
-
function $_(r) {
|
|
11832
|
-
let i = Q_("validateNode", this, r);
|
|
11833
|
-
return i.hasValue(e) ? n.create(t) : i;
|
|
11834
|
-
}
|
|
11835
11840
|
function ev(r) {
|
|
11836
|
-
let i =
|
|
11841
|
+
let i = $_("validateNode", this, r);
|
|
11837
11842
|
return i.hasValue(e) ? n.create(t) : i;
|
|
11838
11843
|
}
|
|
11839
11844
|
function tv(r) {
|
|
11840
|
-
let i =
|
|
11845
|
+
let i = $_("nodeSettings", this, r);
|
|
11841
11846
|
return i.hasValue(e) ? n.create(t) : i;
|
|
11842
11847
|
}
|
|
11843
11848
|
function nv(r) {
|
|
11844
|
-
let i =
|
|
11849
|
+
let i = $_("nodeFullname", this, r);
|
|
11845
11850
|
return i.hasValue(e) ? n.create(t) : i;
|
|
11846
11851
|
}
|
|
11847
|
-
|
|
11848
|
-
|
|
11852
|
+
function rv(r) {
|
|
11853
|
+
let i = $_("nodeAlias", this, r);
|
|
11854
|
+
return i.hasValue(e) ? n.create(t) : i;
|
|
11855
|
+
}
|
|
11856
|
+
var iv = typeof document < "u" && document.location && document.location.hash.indexOf("pseudo=true") >= 0;
|
|
11857
|
+
function av(e, t) {
|
|
11849
11858
|
let n;
|
|
11850
11859
|
return n = t.length === 0 ? e : e.replace(/\{(\d+)\}/g, (e, n) => {
|
|
11851
11860
|
let r = t[n[0]], i = e;
|
|
11852
11861
|
return typeof r == "string" ? i = r : (typeof r == "number" || typeof r == "boolean" || r == null) && (i = String(r)), i;
|
|
11853
|
-
}),
|
|
11862
|
+
}), iv && (n = "[" + n.replace(/[aouei]/g, "$&$&") + "]"), n;
|
|
11854
11863
|
}
|
|
11855
|
-
function
|
|
11856
|
-
return
|
|
11864
|
+
function ov(e, t, ...n) {
|
|
11865
|
+
return av(t, n);
|
|
11857
11866
|
}
|
|
11858
11867
|
//#endregion
|
|
11859
11868
|
//#region ../../node_modules/monaco-editor-core/esm/vs/base/common/platform.js
|
|
11860
|
-
var
|
|
11861
|
-
|
|
11862
|
-
var
|
|
11863
|
-
if (typeof navigator == "object" && !
|
|
11869
|
+
var sv = !1, cv = !1, lv = !1, uv = !1, dv = void 0, fv = typeof self == "object" ? self : typeof global == "object" ? global : {}, pv = void 0;
|
|
11870
|
+
fv.vscode !== void 0 && fv.vscode.process !== void 0 ? pv = fv.vscode.process : typeof process < "u" && (pv = process);
|
|
11871
|
+
var mv = typeof pv?.versions?.electron == "string" && pv?.type === "renderer";
|
|
11872
|
+
if (typeof navigator == "object" && !mv) dv = navigator.userAgent, sv = dv.indexOf("Windows") >= 0, cv = dv.indexOf("Macintosh") >= 0, (dv.indexOf("Macintosh") >= 0 || dv.indexOf("iPad") >= 0 || dv.indexOf("iPhone") >= 0) && navigator.maxTouchPoints && navigator.maxTouchPoints, lv = dv.indexOf("Linux") >= 0, dv?.indexOf("Mobi"), uv = !0, ov({
|
|
11864
11873
|
key: "ensureLoaderPluginIsLoaded",
|
|
11865
11874
|
comment: ["{Locked}"]
|
|
11866
11875
|
}, "_"), navigator.language;
|
|
11867
|
-
else if (typeof
|
|
11868
|
-
|
|
11869
|
-
let e =
|
|
11876
|
+
else if (typeof pv == "object") {
|
|
11877
|
+
sv = pv.platform === "win32", cv = pv.platform === "darwin", lv = pv.platform === "linux", lv && pv.env.SNAP && pv.env.SNAP_REVISION, pv.env.CI || pv.env.BUILD_ARTIFACTSTAGINGDIRECTORY;
|
|
11878
|
+
let e = pv.env.VSCODE_NLS_CONFIG;
|
|
11870
11879
|
if (e) try {
|
|
11871
11880
|
let t = JSON.parse(e);
|
|
11872
11881
|
t.availableLanguages["*"], t.locale, t.osLocale, t._translationsConfigFile;
|
|
11873
11882
|
} catch {}
|
|
11874
11883
|
} else console.error("Unable to resolve platform.");
|
|
11875
|
-
var
|
|
11876
|
-
|
|
11877
|
-
var
|
|
11884
|
+
var hv = sv, gv = cv;
|
|
11885
|
+
uv && fv.importScripts;
|
|
11886
|
+
var _v = dv, vv = typeof fv.postMessage == "function" && !fv.importScripts;
|
|
11878
11887
|
(() => {
|
|
11879
|
-
if (
|
|
11888
|
+
if (vv) {
|
|
11880
11889
|
let e = [];
|
|
11881
|
-
|
|
11890
|
+
fv.addEventListener("message", (t) => {
|
|
11882
11891
|
if (t.data && t.data.vscodeScheduleAsyncWork) for (let n = 0, r = e.length; n < r; n++) {
|
|
11883
11892
|
let r = e[n];
|
|
11884
11893
|
if (r.id === t.data.vscodeScheduleAsyncWork) {
|
|
@@ -11893,19 +11902,19 @@ var gv = uv, _v = typeof dv.postMessage == "function" && !dv.importScripts;
|
|
|
11893
11902
|
e.push({
|
|
11894
11903
|
id: r,
|
|
11895
11904
|
callback: n
|
|
11896
|
-
}),
|
|
11905
|
+
}), fv.postMessage({ vscodeScheduleAsyncWork: r }, "*");
|
|
11897
11906
|
};
|
|
11898
11907
|
}
|
|
11899
11908
|
return (e) => setTimeout(e);
|
|
11900
11909
|
})();
|
|
11901
|
-
var
|
|
11902
|
-
|
|
11910
|
+
var yv = !!(_v && _v.indexOf("Chrome") >= 0);
|
|
11911
|
+
_v && _v.indexOf("Firefox"), !yv && _v && _v.indexOf("Safari"), _v && _v.indexOf("Edg/"), _v && _v.indexOf("Android");
|
|
11903
11912
|
//#endregion
|
|
11904
11913
|
//#region ../../node_modules/monaco-editor-core/esm/vs/base/common/process.js
|
|
11905
|
-
var
|
|
11906
|
-
if (
|
|
11907
|
-
let e =
|
|
11908
|
-
|
|
11914
|
+
var bv;
|
|
11915
|
+
if (fv.vscode !== void 0 && fv.vscode.process !== void 0) {
|
|
11916
|
+
let e = fv.vscode.process;
|
|
11917
|
+
bv = {
|
|
11909
11918
|
get platform() {
|
|
11910
11919
|
return e.platform;
|
|
11911
11920
|
},
|
|
@@ -11919,7 +11928,7 @@ if (dv.vscode !== void 0 && dv.vscode.process !== void 0) {
|
|
|
11919
11928
|
return e.cwd();
|
|
11920
11929
|
}
|
|
11921
11930
|
};
|
|
11922
|
-
} else
|
|
11931
|
+
} else bv = typeof process < "u" ? {
|
|
11923
11932
|
get platform() {
|
|
11924
11933
|
return process.platform;
|
|
11925
11934
|
},
|
|
@@ -11934,7 +11943,7 @@ if (dv.vscode !== void 0 && dv.vscode.process !== void 0) {
|
|
|
11934
11943
|
}
|
|
11935
11944
|
} : {
|
|
11936
11945
|
get platform() {
|
|
11937
|
-
return
|
|
11946
|
+
return hv ? "win32" : gv ? "darwin" : "linux";
|
|
11938
11947
|
},
|
|
11939
11948
|
get arch() {},
|
|
11940
11949
|
get env() {
|
|
@@ -11944,7 +11953,7 @@ if (dv.vscode !== void 0 && dv.vscode.process !== void 0) {
|
|
|
11944
11953
|
return "/";
|
|
11945
11954
|
}
|
|
11946
11955
|
};
|
|
11947
|
-
var
|
|
11956
|
+
var xv = bv.cwd, Sv = bv.env, Cv = bv.platform, wv = 65, Tv = 97, Ev = 90, Dv = 122, Ov = 46, kv = 47, Av = 92, jv = 58, Mv = 63, Nv = class extends Error {
|
|
11948
11957
|
constructor(e, t, n) {
|
|
11949
11958
|
let r;
|
|
11950
11959
|
typeof t == "string" && t.indexOf("not ") === 0 ? (r = "must not be", t = t.replace(/^not /, "")) : r = "must be";
|
|
@@ -11952,31 +11961,31 @@ var bv = yv.cwd, xv = yv.env, Sv = yv.platform, Cv = 65, wv = 97, Tv = 90, Ev =
|
|
|
11952
11961
|
i += `. Received type ${typeof n}`, super(i), this.code = "ERR_INVALID_ARG_TYPE";
|
|
11953
11962
|
}
|
|
11954
11963
|
};
|
|
11955
|
-
function Nv(e, t) {
|
|
11956
|
-
if (typeof e != "object" || !e) throw new Mv(t, "Object", e);
|
|
11957
|
-
}
|
|
11958
11964
|
function Pv(e, t) {
|
|
11959
|
-
if (typeof e != "
|
|
11965
|
+
if (typeof e != "object" || !e) throw new Nv(t, "Object", e);
|
|
11960
11966
|
}
|
|
11961
|
-
|
|
11962
|
-
|
|
11963
|
-
return e === Ov || e === kv;
|
|
11967
|
+
function Fv(e, t) {
|
|
11968
|
+
if (typeof e != "string") throw new Nv(t, "string", e);
|
|
11964
11969
|
}
|
|
11965
|
-
|
|
11966
|
-
|
|
11970
|
+
var Iv = Cv === "win32";
|
|
11971
|
+
function q(e) {
|
|
11972
|
+
return e === kv || e === Av;
|
|
11967
11973
|
}
|
|
11968
11974
|
function Lv(e) {
|
|
11969
|
-
return e
|
|
11975
|
+
return e === kv;
|
|
11970
11976
|
}
|
|
11971
|
-
function Rv(e
|
|
11977
|
+
function Rv(e) {
|
|
11978
|
+
return e >= wv && e <= Ev || e >= Tv && e <= Dv;
|
|
11979
|
+
}
|
|
11980
|
+
function zv(e, t, n, r) {
|
|
11972
11981
|
let i = "", a = 0, o = -1, s = 0, c = 0;
|
|
11973
11982
|
for (let l = 0; l <= e.length; ++l) {
|
|
11974
11983
|
if (l < e.length) c = e.charCodeAt(l);
|
|
11975
11984
|
else if (r(c)) break;
|
|
11976
|
-
else c =
|
|
11985
|
+
else c = kv;
|
|
11977
11986
|
if (r(c)) {
|
|
11978
11987
|
if (!(o === l - 1 || s === 1)) if (s === 2) {
|
|
11979
|
-
if (i.length < 2 || a !== 2 || i.charCodeAt(i.length - 1) !==
|
|
11988
|
+
if (i.length < 2 || a !== 2 || i.charCodeAt(i.length - 1) !== Ov || i.charCodeAt(i.length - 2) !== Ov) {
|
|
11980
11989
|
if (i.length > 2) {
|
|
11981
11990
|
let e = i.lastIndexOf(n);
|
|
11982
11991
|
e === -1 ? (i = "", a = 0) : (i = i.slice(0, e), a = i.length - 1 - i.lastIndexOf(n)), o = l, s = 0;
|
|
@@ -11989,23 +11998,23 @@ function Rv(e, t, n, r) {
|
|
|
11989
11998
|
t && (i += i.length > 0 ? `${n}..` : "..", a = 2);
|
|
11990
11999
|
} else i.length > 0 ? i += `${n}${e.slice(o + 1, l)}` : i = e.slice(o + 1, l), a = l - o - 1;
|
|
11991
12000
|
o = l, s = 0;
|
|
11992
|
-
} else c ===
|
|
12001
|
+
} else c === Ov && s !== -1 ? ++s : s = -1;
|
|
11993
12002
|
}
|
|
11994
12003
|
return i;
|
|
11995
12004
|
}
|
|
11996
|
-
function
|
|
11997
|
-
|
|
12005
|
+
function Bv(e, t) {
|
|
12006
|
+
Pv(t, "pathObject");
|
|
11998
12007
|
let n = t.dir || t.root, r = t.base || `${t.name || ""}${t.ext || ""}`;
|
|
11999
12008
|
return n ? n === t.root ? `${n}${r}` : `${n}${e}${r}` : r;
|
|
12000
12009
|
}
|
|
12001
|
-
var
|
|
12010
|
+
var Vv = {
|
|
12002
12011
|
resolve(...e) {
|
|
12003
12012
|
let t = "", n = "", r = !1;
|
|
12004
12013
|
for (let i = e.length - 1; i >= -1; i--) {
|
|
12005
12014
|
let a;
|
|
12006
12015
|
if (i >= 0) {
|
|
12007
|
-
if (a = e[i],
|
|
12008
|
-
} else t.length === 0 ? a =
|
|
12016
|
+
if (a = e[i], Fv(a, "path"), a.length === 0) continue;
|
|
12017
|
+
} else t.length === 0 ? a = xv() : (a = Sv[`=${t}`] || xv(), (a === void 0 || a.slice(0, 2).toLowerCase() !== t.toLowerCase() && a.charCodeAt(2) === Av) && (a = `${t}\\`));
|
|
12009
12018
|
let o = a.length, s = 0, c = "", l = !1, u = a.charCodeAt(0);
|
|
12010
12019
|
if (o === 1) q(u) && (s = 1, l = !0);
|
|
12011
12020
|
else if (q(u)) if (l = !0, q(a.charCodeAt(1))) {
|
|
@@ -12020,7 +12029,7 @@ var Bv = {
|
|
|
12020
12029
|
}
|
|
12021
12030
|
}
|
|
12022
12031
|
} else s = 1;
|
|
12023
|
-
else
|
|
12032
|
+
else Rv(u) && a.charCodeAt(1) === jv && (c = a.slice(0, 2), s = 2, o > 2 && q(a.charCodeAt(2)) && (l = !0, s = 3));
|
|
12024
12033
|
if (c.length > 0) if (t.length > 0) {
|
|
12025
12034
|
if (c.toLowerCase() !== t.toLowerCase()) continue;
|
|
12026
12035
|
} else t = c;
|
|
@@ -12028,14 +12037,14 @@ var Bv = {
|
|
|
12028
12037
|
if (t.length > 0) break;
|
|
12029
12038
|
} else if (n = `${a.slice(s)}\\${n}`, r = l, l && t.length > 0) break;
|
|
12030
12039
|
}
|
|
12031
|
-
return n =
|
|
12040
|
+
return n = zv(n, !r, "\\", q), r ? `${t}\\${n}` : `${t}${n}` || ".";
|
|
12032
12041
|
},
|
|
12033
12042
|
normalize(e) {
|
|
12034
|
-
|
|
12043
|
+
Fv(e, "path");
|
|
12035
12044
|
let t = e.length;
|
|
12036
12045
|
if (t === 0) return ".";
|
|
12037
12046
|
let n = 0, r, i = !1, a = e.charCodeAt(0);
|
|
12038
|
-
if (t === 1) return
|
|
12047
|
+
if (t === 1) return Lv(a) ? "\\" : e;
|
|
12039
12048
|
if (q(a)) if (i = !0, q(e.charCodeAt(1))) {
|
|
12040
12049
|
let i = 2, a = i;
|
|
12041
12050
|
for (; i < t && !q(e.charCodeAt(i));) i++;
|
|
@@ -12049,23 +12058,23 @@ var Bv = {
|
|
|
12049
12058
|
}
|
|
12050
12059
|
}
|
|
12051
12060
|
} else n = 1;
|
|
12052
|
-
else
|
|
12053
|
-
let o = n < t ?
|
|
12061
|
+
else Rv(a) && e.charCodeAt(1) === jv && (r = e.slice(0, 2), n = 2, t > 2 && q(e.charCodeAt(2)) && (i = !0, n = 3));
|
|
12062
|
+
let o = n < t ? zv(e.slice(n), !i, "\\", q) : "";
|
|
12054
12063
|
return o.length === 0 && !i && (o = "."), o.length > 0 && q(e.charCodeAt(t - 1)) && (o += "\\"), r === void 0 ? i ? `\\${o}` : o : i ? `${r}\\${o}` : `${r}${o}`;
|
|
12055
12064
|
},
|
|
12056
12065
|
isAbsolute(e) {
|
|
12057
|
-
|
|
12066
|
+
Fv(e, "path");
|
|
12058
12067
|
let t = e.length;
|
|
12059
12068
|
if (t === 0) return !1;
|
|
12060
12069
|
let n = e.charCodeAt(0);
|
|
12061
|
-
return q(n) || t > 2 &&
|
|
12070
|
+
return q(n) || t > 2 && Rv(n) && e.charCodeAt(1) === jv && q(e.charCodeAt(2));
|
|
12062
12071
|
},
|
|
12063
12072
|
join(...e) {
|
|
12064
12073
|
if (e.length === 0) return ".";
|
|
12065
12074
|
let t, n;
|
|
12066
12075
|
for (let r = 0; r < e.length; ++r) {
|
|
12067
12076
|
let i = e[r];
|
|
12068
|
-
|
|
12077
|
+
Fv(i, "path"), i.length > 0 && (t === void 0 ? t = n = i : t += `\\${i}`);
|
|
12069
12078
|
}
|
|
12070
12079
|
if (t === void 0) return ".";
|
|
12071
12080
|
let r = !0, i = 0;
|
|
@@ -12078,53 +12087,53 @@ var Bv = {
|
|
|
12078
12087
|
for (; i < t.length && q(t.charCodeAt(i));) i++;
|
|
12079
12088
|
i >= 2 && (t = `\\${t.slice(i)}`);
|
|
12080
12089
|
}
|
|
12081
|
-
return
|
|
12090
|
+
return Vv.normalize(t);
|
|
12082
12091
|
},
|
|
12083
12092
|
relative(e, t) {
|
|
12084
|
-
if (
|
|
12085
|
-
let n =
|
|
12093
|
+
if (Fv(e, "from"), Fv(t, "to"), e === t) return "";
|
|
12094
|
+
let n = Vv.resolve(e), r = Vv.resolve(t);
|
|
12086
12095
|
if (n === r || (e = n.toLowerCase(), t = r.toLowerCase(), e === t)) return "";
|
|
12087
12096
|
let i = 0;
|
|
12088
|
-
for (; i < e.length && e.charCodeAt(i) ===
|
|
12097
|
+
for (; i < e.length && e.charCodeAt(i) === Av;) i++;
|
|
12089
12098
|
let a = e.length;
|
|
12090
|
-
for (; a - 1 > i && e.charCodeAt(a - 1) ===
|
|
12099
|
+
for (; a - 1 > i && e.charCodeAt(a - 1) === Av;) a--;
|
|
12091
12100
|
let o = a - i, s = 0;
|
|
12092
|
-
for (; s < t.length && t.charCodeAt(s) ===
|
|
12101
|
+
for (; s < t.length && t.charCodeAt(s) === Av;) s++;
|
|
12093
12102
|
let c = t.length;
|
|
12094
|
-
for (; c - 1 > s && t.charCodeAt(c - 1) ===
|
|
12103
|
+
for (; c - 1 > s && t.charCodeAt(c - 1) === Av;) c--;
|
|
12095
12104
|
let l = c - s, u = o < l ? o : l, d = -1, f = 0;
|
|
12096
12105
|
for (; f < u; f++) {
|
|
12097
12106
|
let n = e.charCodeAt(i + f);
|
|
12098
12107
|
if (n !== t.charCodeAt(s + f)) break;
|
|
12099
|
-
n ===
|
|
12108
|
+
n === Av && (d = f);
|
|
12100
12109
|
}
|
|
12101
12110
|
if (f !== u) {
|
|
12102
12111
|
if (d === -1) return r;
|
|
12103
12112
|
} else {
|
|
12104
12113
|
if (l > u) {
|
|
12105
|
-
if (t.charCodeAt(s + f) ===
|
|
12114
|
+
if (t.charCodeAt(s + f) === Av) return r.slice(s + f + 1);
|
|
12106
12115
|
if (f === 2) return r.slice(s + f);
|
|
12107
12116
|
}
|
|
12108
|
-
o > u && (e.charCodeAt(i + f) ===
|
|
12117
|
+
o > u && (e.charCodeAt(i + f) === Av ? d = f : f === 2 && (d = 3)), d === -1 && (d = 0);
|
|
12109
12118
|
}
|
|
12110
12119
|
let p = "";
|
|
12111
|
-
for (f = i + d + 1; f <= a; ++f) (f === a || e.charCodeAt(f) ===
|
|
12112
|
-
return s += d, p.length > 0 ? `${p}${r.slice(s, c)}` : (r.charCodeAt(s) ===
|
|
12120
|
+
for (f = i + d + 1; f <= a; ++f) (f === a || e.charCodeAt(f) === Av) && (p += p.length === 0 ? ".." : "\\..");
|
|
12121
|
+
return s += d, p.length > 0 ? `${p}${r.slice(s, c)}` : (r.charCodeAt(s) === Av && ++s, r.slice(s, c));
|
|
12113
12122
|
},
|
|
12114
12123
|
toNamespacedPath(e) {
|
|
12115
12124
|
if (typeof e != "string" || e.length === 0) return e;
|
|
12116
|
-
let t =
|
|
12125
|
+
let t = Vv.resolve(e);
|
|
12117
12126
|
if (t.length <= 2) return e;
|
|
12118
|
-
if (t.charCodeAt(0) ===
|
|
12119
|
-
if (t.charCodeAt(1) ===
|
|
12127
|
+
if (t.charCodeAt(0) === Av) {
|
|
12128
|
+
if (t.charCodeAt(1) === Av) {
|
|
12120
12129
|
let e = t.charCodeAt(2);
|
|
12121
|
-
if (e !==
|
|
12130
|
+
if (e !== Mv && e !== Ov) return `\\\\?\\UNC\\${t.slice(2)}`;
|
|
12122
12131
|
}
|
|
12123
|
-
} else if (
|
|
12132
|
+
} else if (Rv(t.charCodeAt(0)) && t.charCodeAt(1) === jv && t.charCodeAt(2) === Av) return `\\\\?\\${t}`;
|
|
12124
12133
|
return e;
|
|
12125
12134
|
},
|
|
12126
12135
|
dirname(e) {
|
|
12127
|
-
|
|
12136
|
+
Fv(e, "path");
|
|
12128
12137
|
let t = e.length;
|
|
12129
12138
|
if (t === 0) return ".";
|
|
12130
12139
|
let n = -1, r = 0, i = e.charCodeAt(0);
|
|
@@ -12142,7 +12151,7 @@ var Bv = {
|
|
|
12142
12151
|
}
|
|
12143
12152
|
}
|
|
12144
12153
|
}
|
|
12145
|
-
} else
|
|
12154
|
+
} else Rv(i) && e.charCodeAt(1) === jv && (n = t > 2 && q(e.charCodeAt(2)) ? 3 : 2, r = n);
|
|
12146
12155
|
let a = -1, o = !0;
|
|
12147
12156
|
for (let n = t - 1; n >= r; --n) if (q(e.charCodeAt(n))) {
|
|
12148
12157
|
if (!o) {
|
|
@@ -12157,9 +12166,9 @@ var Bv = {
|
|
|
12157
12166
|
return e.slice(0, a);
|
|
12158
12167
|
},
|
|
12159
12168
|
basename(e, t) {
|
|
12160
|
-
t !== void 0 &&
|
|
12169
|
+
t !== void 0 && Fv(t, "ext"), Fv(e, "path");
|
|
12161
12170
|
let n = 0, r = -1, i = !0, a;
|
|
12162
|
-
if (e.length >= 2 &&
|
|
12171
|
+
if (e.length >= 2 && Rv(e.charCodeAt(0)) && e.charCodeAt(1) === jv && (n = 2), t !== void 0 && t.length > 0 && t.length <= e.length) {
|
|
12163
12172
|
if (t === e) return "";
|
|
12164
12173
|
let o = t.length - 1, s = -1;
|
|
12165
12174
|
for (a = e.length - 1; a >= n; --a) {
|
|
@@ -12182,9 +12191,9 @@ var Bv = {
|
|
|
12182
12191
|
return r === -1 ? "" : e.slice(n, r);
|
|
12183
12192
|
},
|
|
12184
12193
|
extname(e) {
|
|
12185
|
-
|
|
12194
|
+
Fv(e, "path");
|
|
12186
12195
|
let t = 0, n = -1, r = 0, i = -1, a = !0, o = 0;
|
|
12187
|
-
e.length >= 2 && e.charCodeAt(1) ===
|
|
12196
|
+
e.length >= 2 && e.charCodeAt(1) === jv && Rv(e.charCodeAt(0)) && (t = r = 2);
|
|
12188
12197
|
for (let s = e.length - 1; s >= t; --s) {
|
|
12189
12198
|
let t = e.charCodeAt(s);
|
|
12190
12199
|
if (q(t)) {
|
|
@@ -12194,13 +12203,13 @@ var Bv = {
|
|
|
12194
12203
|
}
|
|
12195
12204
|
continue;
|
|
12196
12205
|
}
|
|
12197
|
-
i === -1 && (a = !1, i = s + 1), t ===
|
|
12206
|
+
i === -1 && (a = !1, i = s + 1), t === Ov ? n === -1 ? n = s : o !== 1 && (o = 1) : n !== -1 && (o = -1);
|
|
12198
12207
|
}
|
|
12199
12208
|
return n === -1 || i === -1 || o === 0 || o === 1 && n === i - 1 && n === r + 1 ? "" : e.slice(n, i);
|
|
12200
12209
|
},
|
|
12201
|
-
format:
|
|
12210
|
+
format: Bv.bind(null, "\\"),
|
|
12202
12211
|
parse(e) {
|
|
12203
|
-
|
|
12212
|
+
Fv(e, "path");
|
|
12204
12213
|
let t = {
|
|
12205
12214
|
root: "",
|
|
12206
12215
|
dir: "",
|
|
@@ -12223,7 +12232,7 @@ var Bv = {
|
|
|
12223
12232
|
}
|
|
12224
12233
|
}
|
|
12225
12234
|
}
|
|
12226
|
-
} else if (
|
|
12235
|
+
} else if (Rv(i) && e.charCodeAt(1) === jv) {
|
|
12227
12236
|
if (n <= 2) return t.root = t.dir = e, t;
|
|
12228
12237
|
if (r = 2, q(e.charCodeAt(2))) {
|
|
12229
12238
|
if (n === 3) return t.root = t.dir = e, t;
|
|
@@ -12240,7 +12249,7 @@ var Bv = {
|
|
|
12240
12249
|
}
|
|
12241
12250
|
continue;
|
|
12242
12251
|
}
|
|
12243
|
-
s === -1 && (c = !1, s = l + 1), i ===
|
|
12252
|
+
s === -1 && (c = !1, s = l + 1), i === Ov ? a === -1 ? a = l : u !== 1 && (u = 1) : a !== -1 && (u = -1);
|
|
12244
12253
|
}
|
|
12245
12254
|
return s !== -1 && (a === -1 || u === 0 || u === 1 && a === s - 1 && a === o + 1 ? t.base = t.name = e.slice(o, s) : (t.name = e.slice(o, a), t.base = e.slice(o, s), t.ext = e.slice(a, s))), o > 0 && o !== r ? t.dir = e.slice(0, o - 1) : t.dir = t.root, t;
|
|
12246
12255
|
},
|
|
@@ -12248,64 +12257,64 @@ var Bv = {
|
|
|
12248
12257
|
delimiter: ";",
|
|
12249
12258
|
win32: null,
|
|
12250
12259
|
posix: null
|
|
12251
|
-
},
|
|
12252
|
-
if (
|
|
12260
|
+
}, Hv = (() => {
|
|
12261
|
+
if (Iv) {
|
|
12253
12262
|
let e = /\\/g;
|
|
12254
12263
|
return () => {
|
|
12255
|
-
let t =
|
|
12264
|
+
let t = xv().replace(e, "/");
|
|
12256
12265
|
return t.slice(t.indexOf("/"));
|
|
12257
12266
|
};
|
|
12258
12267
|
}
|
|
12259
|
-
return () =>
|
|
12260
|
-
})(),
|
|
12268
|
+
return () => xv();
|
|
12269
|
+
})(), Uv = {
|
|
12261
12270
|
resolve(...e) {
|
|
12262
12271
|
let t = "", n = !1;
|
|
12263
12272
|
for (let r = e.length - 1; r >= -1 && !n; r--) {
|
|
12264
|
-
let i = r >= 0 ? e[r] :
|
|
12265
|
-
|
|
12273
|
+
let i = r >= 0 ? e[r] : Hv();
|
|
12274
|
+
Fv(i, "path"), i.length !== 0 && (t = `${i}/${t}`, n = i.charCodeAt(0) === kv);
|
|
12266
12275
|
}
|
|
12267
|
-
return t =
|
|
12276
|
+
return t = zv(t, !n, "/", Lv), n ? `/${t}` : t.length > 0 ? t : ".";
|
|
12268
12277
|
},
|
|
12269
12278
|
normalize(e) {
|
|
12270
|
-
if (
|
|
12271
|
-
let t = e.charCodeAt(0) ===
|
|
12272
|
-
return e =
|
|
12279
|
+
if (Fv(e, "path"), e.length === 0) return ".";
|
|
12280
|
+
let t = e.charCodeAt(0) === kv, n = e.charCodeAt(e.length - 1) === kv;
|
|
12281
|
+
return e = zv(e, !t, "/", Lv), e.length === 0 ? t ? "/" : n ? "./" : "." : (n && (e += "/"), t ? `/${e}` : e);
|
|
12273
12282
|
},
|
|
12274
12283
|
isAbsolute(e) {
|
|
12275
|
-
return
|
|
12284
|
+
return Fv(e, "path"), e.length > 0 && e.charCodeAt(0) === kv;
|
|
12276
12285
|
},
|
|
12277
12286
|
join(...e) {
|
|
12278
12287
|
if (e.length === 0) return ".";
|
|
12279
12288
|
let t;
|
|
12280
12289
|
for (let n = 0; n < e.length; ++n) {
|
|
12281
12290
|
let r = e[n];
|
|
12282
|
-
|
|
12291
|
+
Fv(r, "path"), r.length > 0 && (t === void 0 ? t = r : t += `/${r}`);
|
|
12283
12292
|
}
|
|
12284
|
-
return t === void 0 ? "." :
|
|
12293
|
+
return t === void 0 ? "." : Uv.normalize(t);
|
|
12285
12294
|
},
|
|
12286
12295
|
relative(e, t) {
|
|
12287
|
-
if (
|
|
12296
|
+
if (Fv(e, "from"), Fv(t, "to"), e === t || (e = Uv.resolve(e), t = Uv.resolve(t), e === t)) return "";
|
|
12288
12297
|
let n = e.length, r = n - 1, i = t.length - 1, a = r < i ? r : i, o = -1, s = 0;
|
|
12289
12298
|
for (; s < a; s++) {
|
|
12290
12299
|
let n = e.charCodeAt(1 + s);
|
|
12291
12300
|
if (n !== t.charCodeAt(1 + s)) break;
|
|
12292
|
-
n ===
|
|
12301
|
+
n === kv && (o = s);
|
|
12293
12302
|
}
|
|
12294
12303
|
if (s === a) if (i > a) {
|
|
12295
|
-
if (t.charCodeAt(1 + s) ===
|
|
12304
|
+
if (t.charCodeAt(1 + s) === kv) return t.slice(1 + s + 1);
|
|
12296
12305
|
if (s === 0) return t.slice(1 + s);
|
|
12297
|
-
} else r > a && (e.charCodeAt(1 + s) ===
|
|
12306
|
+
} else r > a && (e.charCodeAt(1 + s) === kv ? o = s : s === 0 && (o = 0));
|
|
12298
12307
|
let c = "";
|
|
12299
|
-
for (s = 1 + o + 1; s <= n; ++s) (s === n || e.charCodeAt(s) ===
|
|
12308
|
+
for (s = 1 + o + 1; s <= n; ++s) (s === n || e.charCodeAt(s) === kv) && (c += c.length === 0 ? ".." : "/..");
|
|
12300
12309
|
return `${c}${t.slice(1 + o)}`;
|
|
12301
12310
|
},
|
|
12302
12311
|
toNamespacedPath(e) {
|
|
12303
12312
|
return e;
|
|
12304
12313
|
},
|
|
12305
12314
|
dirname(e) {
|
|
12306
|
-
if (
|
|
12307
|
-
let t = e.charCodeAt(0) ===
|
|
12308
|
-
for (let t = e.length - 1; t >= 1; --t) if (e.charCodeAt(t) ===
|
|
12315
|
+
if (Fv(e, "path"), e.length === 0) return ".";
|
|
12316
|
+
let t = e.charCodeAt(0) === kv, n = -1, r = !0;
|
|
12317
|
+
for (let t = e.length - 1; t >= 1; --t) if (e.charCodeAt(t) === kv) {
|
|
12309
12318
|
if (!r) {
|
|
12310
12319
|
n = t;
|
|
12311
12320
|
break;
|
|
@@ -12314,14 +12323,14 @@ var Bv = {
|
|
|
12314
12323
|
return n === -1 ? t ? "/" : "." : t && n === 1 ? "//" : e.slice(0, n);
|
|
12315
12324
|
},
|
|
12316
12325
|
basename(e, t) {
|
|
12317
|
-
t !== void 0 &&
|
|
12326
|
+
t !== void 0 && Fv(t, "ext"), Fv(e, "path");
|
|
12318
12327
|
let n = 0, r = -1, i = !0, a;
|
|
12319
12328
|
if (t !== void 0 && t.length > 0 && t.length <= e.length) {
|
|
12320
12329
|
if (t === e) return "";
|
|
12321
12330
|
let o = t.length - 1, s = -1;
|
|
12322
12331
|
for (a = e.length - 1; a >= 0; --a) {
|
|
12323
12332
|
let c = e.charCodeAt(a);
|
|
12324
|
-
if (c ===
|
|
12333
|
+
if (c === kv) {
|
|
12325
12334
|
if (!i) {
|
|
12326
12335
|
n = a + 1;
|
|
12327
12336
|
break;
|
|
@@ -12330,7 +12339,7 @@ var Bv = {
|
|
|
12330
12339
|
}
|
|
12331
12340
|
return n === r ? r = s : r === -1 && (r = e.length), e.slice(n, r);
|
|
12332
12341
|
}
|
|
12333
|
-
for (a = e.length - 1; a >= 0; --a) if (e.charCodeAt(a) ===
|
|
12342
|
+
for (a = e.length - 1; a >= 0; --a) if (e.charCodeAt(a) === kv) {
|
|
12334
12343
|
if (!i) {
|
|
12335
12344
|
n = a + 1;
|
|
12336
12345
|
break;
|
|
@@ -12339,24 +12348,24 @@ var Bv = {
|
|
|
12339
12348
|
return r === -1 ? "" : e.slice(n, r);
|
|
12340
12349
|
},
|
|
12341
12350
|
extname(e) {
|
|
12342
|
-
|
|
12351
|
+
Fv(e, "path");
|
|
12343
12352
|
let t = -1, n = 0, r = -1, i = !0, a = 0;
|
|
12344
12353
|
for (let o = e.length - 1; o >= 0; --o) {
|
|
12345
12354
|
let s = e.charCodeAt(o);
|
|
12346
|
-
if (s ===
|
|
12355
|
+
if (s === kv) {
|
|
12347
12356
|
if (!i) {
|
|
12348
12357
|
n = o + 1;
|
|
12349
12358
|
break;
|
|
12350
12359
|
}
|
|
12351
12360
|
continue;
|
|
12352
12361
|
}
|
|
12353
|
-
r === -1 && (i = !1, r = o + 1), s ===
|
|
12362
|
+
r === -1 && (i = !1, r = o + 1), s === Ov ? t === -1 ? t = o : a !== 1 && (a = 1) : t !== -1 && (a = -1);
|
|
12354
12363
|
}
|
|
12355
12364
|
return t === -1 || r === -1 || a === 0 || a === 1 && t === r - 1 && t === n + 1 ? "" : e.slice(t, r);
|
|
12356
12365
|
},
|
|
12357
|
-
format:
|
|
12366
|
+
format: Bv.bind(null, "/"),
|
|
12358
12367
|
parse(e) {
|
|
12359
|
-
|
|
12368
|
+
Fv(e, "path");
|
|
12360
12369
|
let t = {
|
|
12361
12370
|
root: "",
|
|
12362
12371
|
dir: "",
|
|
@@ -12365,19 +12374,19 @@ var Bv = {
|
|
|
12365
12374
|
name: ""
|
|
12366
12375
|
};
|
|
12367
12376
|
if (e.length === 0) return t;
|
|
12368
|
-
let n = e.charCodeAt(0) ===
|
|
12377
|
+
let n = e.charCodeAt(0) === kv, r;
|
|
12369
12378
|
n ? (t.root = "/", r = 1) : r = 0;
|
|
12370
12379
|
let i = -1, a = 0, o = -1, s = !0, c = e.length - 1, l = 0;
|
|
12371
12380
|
for (; c >= r; --c) {
|
|
12372
12381
|
let t = e.charCodeAt(c);
|
|
12373
|
-
if (t ===
|
|
12382
|
+
if (t === kv) {
|
|
12374
12383
|
if (!s) {
|
|
12375
12384
|
a = c + 1;
|
|
12376
12385
|
break;
|
|
12377
12386
|
}
|
|
12378
12387
|
continue;
|
|
12379
12388
|
}
|
|
12380
|
-
o === -1 && (s = !1, o = c + 1), t ===
|
|
12389
|
+
o === -1 && (s = !1, o = c + 1), t === Ov ? i === -1 ? i = c : l !== 1 && (l = 1) : i !== -1 && (l = -1);
|
|
12381
12390
|
}
|
|
12382
12391
|
if (o !== -1) {
|
|
12383
12392
|
let r = a === 0 && n ? 1 : a;
|
|
@@ -12390,69 +12399,69 @@ var Bv = {
|
|
|
12390
12399
|
win32: null,
|
|
12391
12400
|
posix: null
|
|
12392
12401
|
};
|
|
12393
|
-
|
|
12402
|
+
Uv.win32 = Vv.win32 = Vv, Uv.posix = Vv.posix = Uv, Iv ? Vv.normalize : Uv.normalize, Iv ? Vv.resolve : Uv.resolve, Iv ? Vv.relative : Uv.relative, Iv ? Vv.dirname : Uv.dirname, Iv ? Vv.basename : Uv.basename, Iv ? Vv.extname : Uv.extname, Iv ? Vv.sep : Uv.sep;
|
|
12394
12403
|
//#endregion
|
|
12395
12404
|
//#region ../../node_modules/monaco-editor-core/esm/vs/base/common/uri.js
|
|
12396
|
-
var
|
|
12397
|
-
function
|
|
12405
|
+
var Wv = /^\w[\w\d+.-]*$/, Gv = /^\//, Kv = /^\/\//;
|
|
12406
|
+
function qv(e, t) {
|
|
12398
12407
|
if (!e.scheme && t) throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);
|
|
12399
|
-
if (e.scheme && !
|
|
12408
|
+
if (e.scheme && !Wv.test(e.scheme)) throw Error("[UriError]: Scheme contains illegal characters.");
|
|
12400
12409
|
if (e.path) {
|
|
12401
12410
|
if (e.authority) {
|
|
12402
|
-
if (!
|
|
12403
|
-
} else if (
|
|
12411
|
+
if (!Gv.test(e.path)) throw Error("[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character");
|
|
12412
|
+
} else if (Kv.test(e.path)) throw Error("[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")");
|
|
12404
12413
|
}
|
|
12405
12414
|
}
|
|
12406
|
-
function
|
|
12415
|
+
function Jv(e, t) {
|
|
12407
12416
|
return !e && !t ? "file" : e;
|
|
12408
12417
|
}
|
|
12409
|
-
function
|
|
12418
|
+
function Yv(e, t) {
|
|
12410
12419
|
switch (e) {
|
|
12411
12420
|
case "https":
|
|
12412
12421
|
case "http":
|
|
12413
12422
|
case "file":
|
|
12414
|
-
t ? t[0] !==
|
|
12423
|
+
t ? t[0] !== Xv && (t = Xv + t) : t = Xv;
|
|
12415
12424
|
break;
|
|
12416
12425
|
}
|
|
12417
12426
|
return t;
|
|
12418
12427
|
}
|
|
12419
|
-
var J = "",
|
|
12428
|
+
var J = "", Xv = "/", Zv = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/, Qv = class e {
|
|
12420
12429
|
static isUri(t) {
|
|
12421
12430
|
return t instanceof e ? !0 : t ? typeof t.authority == "string" && typeof t.fragment == "string" && typeof t.path == "string" && typeof t.query == "string" && typeof t.scheme == "string" && typeof t.fsPath == "string" && typeof t.with == "function" && typeof t.toString == "function" : !1;
|
|
12422
12431
|
}
|
|
12423
12432
|
constructor(e, t, n, r, i, a = !1) {
|
|
12424
|
-
typeof e == "object" ? (this.scheme = e.scheme || J, this.authority = e.authority || J, this.path = e.path || J, this.query = e.query || J, this.fragment = e.fragment || J) : (this.scheme =
|
|
12433
|
+
typeof e == "object" ? (this.scheme = e.scheme || J, this.authority = e.authority || J, this.path = e.path || J, this.query = e.query || J, this.fragment = e.fragment || J) : (this.scheme = Jv(e, a), this.authority = t || J, this.path = Yv(this.scheme, n || J), this.query = r || J, this.fragment = i || J, qv(this, a));
|
|
12425
12434
|
}
|
|
12426
12435
|
get fsPath() {
|
|
12427
|
-
return
|
|
12436
|
+
return iy(this, !1);
|
|
12428
12437
|
}
|
|
12429
12438
|
with(e) {
|
|
12430
12439
|
if (!e) return this;
|
|
12431
12440
|
let { scheme: t, authority: n, path: r, query: i, fragment: a } = e;
|
|
12432
|
-
return t === void 0 ? t = this.scheme : t === null && (t = J), n === void 0 ? n = this.authority : n === null && (n = J), r === void 0 ? r = this.path : r === null && (r = J), i === void 0 ? i = this.query : i === null && (i = J), a === void 0 ? a = this.fragment : a === null && (a = J), t === this.scheme && n === this.authority && r === this.path && i === this.query && a === this.fragment ? this : new
|
|
12441
|
+
return t === void 0 ? t = this.scheme : t === null && (t = J), n === void 0 ? n = this.authority : n === null && (n = J), r === void 0 ? r = this.path : r === null && (r = J), i === void 0 ? i = this.query : i === null && (i = J), a === void 0 ? a = this.fragment : a === null && (a = J), t === this.scheme && n === this.authority && r === this.path && i === this.query && a === this.fragment ? this : new ey(t, n, r, i, a);
|
|
12433
12442
|
}
|
|
12434
12443
|
static parse(e, t = !1) {
|
|
12435
|
-
let n =
|
|
12436
|
-
return n ? new
|
|
12444
|
+
let n = Zv.exec(e);
|
|
12445
|
+
return n ? new ey(n[2] || J, cy(n[4] || J), cy(n[5] || J), cy(n[7] || J), cy(n[9] || J), t) : new ey(J, J, J, J, J);
|
|
12437
12446
|
}
|
|
12438
12447
|
static file(e) {
|
|
12439
12448
|
let t = J;
|
|
12440
|
-
if (
|
|
12441
|
-
let n = e.indexOf(
|
|
12442
|
-
n === -1 ? (t = e.substring(2), e =
|
|
12449
|
+
if (hv && (e = e.replace(/\\/g, Xv)), e[0] === Xv && e[1] === Xv) {
|
|
12450
|
+
let n = e.indexOf(Xv, 2);
|
|
12451
|
+
n === -1 ? (t = e.substring(2), e = Xv) : (t = e.substring(2, n), e = e.substring(n) || Xv);
|
|
12443
12452
|
}
|
|
12444
|
-
return new
|
|
12453
|
+
return new ey("file", t, e, J, J);
|
|
12445
12454
|
}
|
|
12446
12455
|
static from(e, t) {
|
|
12447
|
-
return new
|
|
12456
|
+
return new ey(e.scheme, e.authority, e.path, e.query, e.fragment, t);
|
|
12448
12457
|
}
|
|
12449
12458
|
static joinPath(t, ...n) {
|
|
12450
12459
|
if (!t.path) throw Error("[UriError]: cannot call joinPath on URI without path");
|
|
12451
12460
|
let r;
|
|
12452
|
-
return r =
|
|
12461
|
+
return r = hv && t.scheme === "file" ? e.file(Vv.join(iy(t, !0), ...n)).path : Uv.join(t.path, ...n), t.with({ path: r });
|
|
12453
12462
|
}
|
|
12454
12463
|
toString(e = !1) {
|
|
12455
|
-
return
|
|
12464
|
+
return ay(this, e);
|
|
12456
12465
|
}
|
|
12457
12466
|
toJSON() {
|
|
12458
12467
|
return this;
|
|
@@ -12460,25 +12469,25 @@ var J = "", Yv = "/", Xv = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?
|
|
|
12460
12469
|
static revive(t) {
|
|
12461
12470
|
if (!t || t instanceof e) return t;
|
|
12462
12471
|
{
|
|
12463
|
-
let e = new
|
|
12464
|
-
return e._formatted = t.external ?? null, e._fsPath = t._sep ===
|
|
12472
|
+
let e = new ey(t);
|
|
12473
|
+
return e._formatted = t.external ?? null, e._fsPath = t._sep === $v ? t.fsPath ?? null : null, e;
|
|
12465
12474
|
}
|
|
12466
12475
|
}
|
|
12467
|
-
},
|
|
12476
|
+
}, $v = hv ? 1 : void 0, ey = class extends Qv {
|
|
12468
12477
|
constructor() {
|
|
12469
12478
|
super(...arguments), this._formatted = null, this._fsPath = null;
|
|
12470
12479
|
}
|
|
12471
12480
|
get fsPath() {
|
|
12472
|
-
return this._fsPath ||=
|
|
12481
|
+
return this._fsPath ||= iy(this, !1), this._fsPath;
|
|
12473
12482
|
}
|
|
12474
12483
|
toString(e = !1) {
|
|
12475
|
-
return e ?
|
|
12484
|
+
return e ? ay(this, !0) : (this._formatted ||= ay(this, !1), this._formatted);
|
|
12476
12485
|
}
|
|
12477
12486
|
toJSON() {
|
|
12478
12487
|
let e = { $mid: 1 };
|
|
12479
|
-
return this._fsPath && (e.fsPath = this._fsPath, e._sep =
|
|
12488
|
+
return this._fsPath && (e.fsPath = this._fsPath, e._sep = $v), this._formatted && (e.external = this._formatted), this.path && (e.path = this.path), this.scheme && (e.scheme = this.scheme), this.authority && (e.authority = this.authority), this.query && (e.query = this.query), this.fragment && (e.fragment = this.fragment), e;
|
|
12480
12489
|
}
|
|
12481
|
-
},
|
|
12490
|
+
}, ty = {
|
|
12482
12491
|
58: "%3A",
|
|
12483
12492
|
47: "%2F",
|
|
12484
12493
|
63: "%3F",
|
|
@@ -12499,34 +12508,34 @@ var J = "", Yv = "/", Xv = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?
|
|
|
12499
12508
|
61: "%3D",
|
|
12500
12509
|
32: "%20"
|
|
12501
12510
|
};
|
|
12502
|
-
function
|
|
12511
|
+
function ny(e, t, n) {
|
|
12503
12512
|
let r, i = -1;
|
|
12504
12513
|
for (let a = 0; a < e.length; a++) {
|
|
12505
12514
|
let o = e.charCodeAt(a);
|
|
12506
12515
|
if (o >= 97 && o <= 122 || o >= 65 && o <= 90 || o >= 48 && o <= 57 || o === 45 || o === 46 || o === 95 || o === 126 || t && o === 47 || n && o === 91 || n && o === 93 || n && o === 58) i !== -1 && (r += encodeURIComponent(e.substring(i, a)), i = -1), r !== void 0 && (r += e.charAt(a));
|
|
12507
12516
|
else {
|
|
12508
12517
|
r === void 0 && (r = e.substr(0, a));
|
|
12509
|
-
let t =
|
|
12518
|
+
let t = ty[o];
|
|
12510
12519
|
t === void 0 ? i === -1 && (i = a) : (i !== -1 && (r += encodeURIComponent(e.substring(i, a)), i = -1), r += t);
|
|
12511
12520
|
}
|
|
12512
12521
|
}
|
|
12513
12522
|
return i !== -1 && (r += encodeURIComponent(e.substring(i))), r === void 0 ? e : r;
|
|
12514
12523
|
}
|
|
12515
|
-
function
|
|
12524
|
+
function ry(e) {
|
|
12516
12525
|
let t;
|
|
12517
12526
|
for (let n = 0; n < e.length; n++) {
|
|
12518
12527
|
let r = e.charCodeAt(n);
|
|
12519
|
-
r === 35 || r === 63 ? (t === void 0 && (t = e.substr(0, n)), t +=
|
|
12528
|
+
r === 35 || r === 63 ? (t === void 0 && (t = e.substr(0, n)), t += ty[r]) : t !== void 0 && (t += e[n]);
|
|
12520
12529
|
}
|
|
12521
12530
|
return t === void 0 ? e : t;
|
|
12522
12531
|
}
|
|
12523
|
-
function
|
|
12532
|
+
function iy(e, t) {
|
|
12524
12533
|
let n;
|
|
12525
|
-
return n = e.authority && e.path.length > 1 && e.scheme === "file" ? `//${e.authority}${e.path}` : e.path.charCodeAt(0) === 47 && (e.path.charCodeAt(1) >= 65 && e.path.charCodeAt(1) <= 90 || e.path.charCodeAt(1) >= 97 && e.path.charCodeAt(1) <= 122) && e.path.charCodeAt(2) === 58 ? t ? e.path.substr(1) : e.path[1].toLowerCase() + e.path.substr(2) : e.path,
|
|
12534
|
+
return n = e.authority && e.path.length > 1 && e.scheme === "file" ? `//${e.authority}${e.path}` : e.path.charCodeAt(0) === 47 && (e.path.charCodeAt(1) >= 65 && e.path.charCodeAt(1) <= 90 || e.path.charCodeAt(1) >= 97 && e.path.charCodeAt(1) <= 122) && e.path.charCodeAt(2) === 58 ? t ? e.path.substr(1) : e.path[1].toLowerCase() + e.path.substr(2) : e.path, hv && (n = n.replace(/\//g, "\\")), n;
|
|
12526
12535
|
}
|
|
12527
|
-
function
|
|
12528
|
-
let n = t ?
|
|
12529
|
-
if (i && (r += i, r += ":"), (a || i === "file") && (r +=
|
|
12536
|
+
function ay(e, t) {
|
|
12537
|
+
let n = t ? ry : ny, r = "", { scheme: i, authority: a, path: o, query: s, fragment: c } = e;
|
|
12538
|
+
if (i && (r += i, r += ":"), (a || i === "file") && (r += Xv, r += Xv), a) {
|
|
12530
12539
|
let e = a.indexOf("@");
|
|
12531
12540
|
if (e !== -1) {
|
|
12532
12541
|
let t = a.substr(0, e);
|
|
@@ -12544,18 +12553,18 @@ function iy(e, t) {
|
|
|
12544
12553
|
}
|
|
12545
12554
|
r += n(o, !0, !1);
|
|
12546
12555
|
}
|
|
12547
|
-
return s && (r += "?", r += n(s, !1, !1)), c && (r += "#", r += t ? c :
|
|
12556
|
+
return s && (r += "?", r += n(s, !1, !1)), c && (r += "#", r += t ? c : ny(c, !1, !1)), r;
|
|
12548
12557
|
}
|
|
12549
|
-
function
|
|
12558
|
+
function oy(e) {
|
|
12550
12559
|
try {
|
|
12551
12560
|
return decodeURIComponent(e);
|
|
12552
12561
|
} catch {
|
|
12553
|
-
return e.length > 3 ? e.substr(0, 3) +
|
|
12562
|
+
return e.length > 3 ? e.substr(0, 3) + oy(e.substr(3)) : e;
|
|
12554
12563
|
}
|
|
12555
12564
|
}
|
|
12556
|
-
var
|
|
12557
|
-
function
|
|
12558
|
-
return e.match(
|
|
12565
|
+
var sy = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
|
|
12566
|
+
function cy(e) {
|
|
12567
|
+
return e.match(sy) ? e.replace(sy, (e) => oy(e)) : e;
|
|
12559
12568
|
}
|
|
12560
12569
|
//#endregion
|
|
12561
12570
|
//#region src/services/types.ts
|
|
@@ -12563,15 +12572,15 @@ var Y = /* @__PURE__ */ function(e) {
|
|
|
12563
12572
|
return e[e.Function = 1] = "Function", e[e.Constructor = 2] = "Constructor", e[e.Field = 3] = "Field", e[e.Variable = 4] = "Variable", e[e.Class = 5] = "Class", e[e.Struct = 6] = "Struct", e[e.Interface = 7] = "Interface", e[e.Module = 8] = "Module", e[e.Property = 9] = "Property", e[e.Event = 10] = "Event", e[e.Operator = 11] = "Operator", e[e.Unit = 12] = "Unit", e[e.Value = 13] = "Value", e[e.Constant = 14] = "Constant", e[e.Enum = 15] = "Enum", e[e.EnumMember = 16] = "EnumMember", e[e.Keyword = 17] = "Keyword", e[e.Text = 18] = "Text", e[e.Color = 19] = "Color", e[e.File = 20] = "File", e[e.Reference = 21] = "Reference", e[e.Customcolor = 22] = "Customcolor", e[e.Folder = 23] = "Folder", e[e.TypeParameter = 24] = "TypeParameter", e[e.User = 25] = "User", e[e.Issue = 26] = "Issue", e[e.Snippet = 27] = "Snippet", e;
|
|
12564
12573
|
}({}), X = /* @__PURE__ */ function(e) {
|
|
12565
12574
|
return e[e.None = 0] = "None", e[e.KeepWhitespace = 1] = "KeepWhitespace", e[e.InsertAsSnippet = 4] = "InsertAsSnippet", e;
|
|
12566
|
-
}({}),
|
|
12575
|
+
}({}), ly = /* @__PURE__ */ function(e) {
|
|
12567
12576
|
return e[e.Hint = 1] = "Hint", e[e.Info = 2] = "Info", e[e.Warning = 4] = "Warning", e[e.Error = 8] = "Error", e;
|
|
12568
12577
|
}({});
|
|
12569
12578
|
//#endregion
|
|
12570
12579
|
//#region src/services/utils.ts
|
|
12571
|
-
function
|
|
12580
|
+
function uy(e, t) {
|
|
12572
12581
|
return e.getOffsetAt(t);
|
|
12573
12582
|
}
|
|
12574
|
-
function
|
|
12583
|
+
function dy(e, t) {
|
|
12575
12584
|
let { startPos: n, endPos: r } = t;
|
|
12576
12585
|
return {
|
|
12577
12586
|
startLineNumber: n.line + 1,
|
|
@@ -12582,7 +12591,7 @@ function uy(e, t) {
|
|
|
12582
12591
|
}
|
|
12583
12592
|
//#endregion
|
|
12584
12593
|
//#region src/services/code_actions/provider.ts
|
|
12585
|
-
var
|
|
12594
|
+
var fy = class {
|
|
12586
12595
|
constructor(e) {
|
|
12587
12596
|
this.compiler = e;
|
|
12588
12597
|
}
|
|
@@ -12592,7 +12601,7 @@ var dy = class {
|
|
|
12592
12601
|
if (!a.length) return;
|
|
12593
12602
|
let o = [];
|
|
12594
12603
|
for (let t of n.markers) for (let n of a) {
|
|
12595
|
-
let r =
|
|
12604
|
+
let r = dy(e, n.nodeOrToken);
|
|
12596
12605
|
if (!(r.startLineNumber !== t.startLineNumber || r.startColumn !== t.startColumn || r.endLineNumber !== t.endLineNumber || r.endColumn !== t.endColumn)) for (let r of n.quickFixes ?? []) o.push(this.quickFixToCodeAction(r, e, t));
|
|
12597
12606
|
}
|
|
12598
12607
|
let s = Na(o, (e) => {
|
|
@@ -12605,7 +12614,7 @@ var dy = class {
|
|
|
12605
12614
|
};
|
|
12606
12615
|
}
|
|
12607
12616
|
quickFixToCodeAction(e, t, n) {
|
|
12608
|
-
let r =
|
|
12617
|
+
let r = Qv.parse(e.filepath.toUri({ protocol: t.uri.scheme })), i = { edits: e.edits.map((e) => {
|
|
12609
12618
|
let n = t.getPositionAt(e.start), i = t.getPositionAt(e.end);
|
|
12610
12619
|
return {
|
|
12611
12620
|
resource: r,
|
|
@@ -12628,12 +12637,12 @@ var dy = class {
|
|
|
12628
12637
|
diagnostics: [n]
|
|
12629
12638
|
};
|
|
12630
12639
|
}
|
|
12631
|
-
},
|
|
12640
|
+
}, py = class {
|
|
12632
12641
|
constructor(e) {
|
|
12633
12642
|
this.compiler = e;
|
|
12634
12643
|
}
|
|
12635
12644
|
provideDefinition(e, n) {
|
|
12636
|
-
let { uri: r } = e, i = vo.fromUri(String(e.uri)), a =
|
|
12645
|
+
let { uri: r } = e, i = vo.fromUri(String(e.uri)), a = uy(e, n), o = [...this.compiler.container.stack(i, a)];
|
|
12637
12646
|
for (; o.length !== 0;) {
|
|
12638
12647
|
let e = o.pop();
|
|
12639
12648
|
if (!e) continue;
|
|
@@ -12642,7 +12651,7 @@ var dy = class {
|
|
|
12642
12651
|
let i;
|
|
12643
12652
|
if (n.declaration && [qp.PRIMARY_EXPRESSION, qp.VARIABLE].includes(e.kind) && ({declaration: i} = n), i) {
|
|
12644
12653
|
let { startPos: e, endPos: t } = i, n = r;
|
|
12645
|
-
return r && i.filepath && (n =
|
|
12654
|
+
return r && i.filepath && (n = Qv.parse(i.filepath.toUri({ protocol: r.scheme }))), [{
|
|
12646
12655
|
range: {
|
|
12647
12656
|
startColumn: e.column + 1,
|
|
12648
12657
|
startLineNumber: e.line + 1,
|
|
@@ -12655,7 +12664,7 @@ var dy = class {
|
|
|
12655
12664
|
}
|
|
12656
12665
|
return [];
|
|
12657
12666
|
}
|
|
12658
|
-
},
|
|
12667
|
+
}, my = class {
|
|
12659
12668
|
constructor(e) {
|
|
12660
12669
|
this.compiler = e;
|
|
12661
12670
|
}
|
|
@@ -12687,7 +12696,7 @@ var dy = class {
|
|
|
12687
12696
|
code: e.code ? String(e.code) : void 0
|
|
12688
12697
|
};
|
|
12689
12698
|
return e.relatedLocations?.length && (t.relatedInformation = e.relatedLocations.map((e) => ({
|
|
12690
|
-
resource:
|
|
12699
|
+
resource: Qv.parse(e.nodeOrToken.filepath.toUri()),
|
|
12691
12700
|
message: e.message,
|
|
12692
12701
|
startLineNumber: e.nodeOrToken.startPos.line + 1,
|
|
12693
12702
|
startColumn: e.nodeOrToken.startPos.column + 1,
|
|
@@ -12711,14 +12720,14 @@ var dy = class {
|
|
|
12711
12720
|
};
|
|
12712
12721
|
}
|
|
12713
12722
|
getSeverityValue(e) {
|
|
12714
|
-
return e === "error" ?
|
|
12723
|
+
return e === "error" ? ly.Error : e === "warning" ? ly.Warning : ly.Info;
|
|
12715
12724
|
}
|
|
12716
|
-
},
|
|
12725
|
+
}, hy = class {
|
|
12717
12726
|
constructor(e) {
|
|
12718
12727
|
this.compiler = e;
|
|
12719
12728
|
}
|
|
12720
12729
|
provideReferences(e, n) {
|
|
12721
|
-
let { uri: r } = e, i = vo.fromUri(String(r)), a =
|
|
12730
|
+
let { uri: r } = e, i = vo.fromUri(String(r)), a = uy(e, n);
|
|
12722
12731
|
this.compiler.bindProject();
|
|
12723
12732
|
let o = [...this.compiler.container.stack(i, a)];
|
|
12724
12733
|
for (; o.length !== 0;) {
|
|
@@ -12731,7 +12740,7 @@ var dy = class {
|
|
|
12731
12740
|
let n = this.compiler.nodeSymbol(e).getFiltered(t) ?? this.compiler.nodeReferee(e).getFiltered(t), i = n ? this.compiler.symbolReferences(n) : void 0;
|
|
12732
12741
|
if (i && i.length > 0) return i.map((e) => {
|
|
12733
12742
|
let t = r;
|
|
12734
|
-
return r && e.filepath && (t =
|
|
12743
|
+
return r && e.filepath && (t = Qv.parse(e.filepath.toUri({ protocol: r.scheme }))), {
|
|
12735
12744
|
range: {
|
|
12736
12745
|
startColumn: e.startPos.column + 1,
|
|
12737
12746
|
startLineNumber: e.startPos.line + 1,
|
|
@@ -12748,16 +12757,16 @@ var dy = class {
|
|
|
12748
12757
|
};
|
|
12749
12758
|
//#endregion
|
|
12750
12759
|
//#region src/core/utils/span.ts
|
|
12751
|
-
function
|
|
12760
|
+
function gy(e, t) {
|
|
12752
12761
|
return e >= t.start && e < t.end;
|
|
12753
12762
|
}
|
|
12754
|
-
function
|
|
12763
|
+
function _y(e, t) {
|
|
12755
12764
|
let n = t.bodyColon?.start ?? t.body?.start;
|
|
12756
12765
|
return n === void 0 ? e >= t.start && e <= t.end : e >= t.start && e < n;
|
|
12757
12766
|
}
|
|
12758
12767
|
//#endregion
|
|
12759
12768
|
//#region src/services/suggestions/utils/useMerger.ts
|
|
12760
|
-
function
|
|
12769
|
+
function vy(e, t) {
|
|
12761
12770
|
let n = [], r = e.parseFile(t).getValue()?.ast;
|
|
12762
12771
|
if (!r) return n;
|
|
12763
12772
|
for (let e of r.uses) {
|
|
@@ -12784,21 +12793,21 @@ function _y(e, t) {
|
|
|
12784
12793
|
}
|
|
12785
12794
|
return n;
|
|
12786
12795
|
}
|
|
12787
|
-
function
|
|
12788
|
-
let o =
|
|
12796
|
+
function yy(e, t, n, r, i, a) {
|
|
12797
|
+
let o = vy(e, i), s = r.relativeTo(i.dirname).replace(/\.dbml$/, ""), c = o.findIndex((e) => e.sourceFile === s), l = `${n} ${t}`;
|
|
12789
12798
|
if (c !== -1) {
|
|
12790
12799
|
let e = o[c];
|
|
12791
12800
|
return e.specifiers.some((e) => e.name === t) ? { topInsert: "" } : {
|
|
12792
|
-
topInsert:
|
|
12793
|
-
removeRange:
|
|
12801
|
+
topInsert: by(Ma([...e.specifiers.filter((e) => e.name !== "*").map((e) => `${e.kind ?? n} ${e.name}${e.alias ? ` as ${e.alias}` : ""}`), l]), s, "\n"),
|
|
12802
|
+
removeRange: xy(a, e.startOffset, e.endOffset)
|
|
12794
12803
|
};
|
|
12795
12804
|
}
|
|
12796
|
-
return { topInsert:
|
|
12805
|
+
return { topInsert: by([l], s, "\n") };
|
|
12797
12806
|
}
|
|
12798
|
-
function
|
|
12807
|
+
function by(e, t, n) {
|
|
12799
12808
|
return `use {${n}${e.map((e) => ` ${e}`).join(n)}${n}} from '${t}'${n}${n}`;
|
|
12800
12809
|
}
|
|
12801
|
-
function
|
|
12810
|
+
function xy(e, t, n) {
|
|
12802
12811
|
let r = e.lastIndexOf("\n", t - 1) + 1, i = n;
|
|
12803
12812
|
for (; i < e.length && (e[i] === " " || e[i] === " ");) i++;
|
|
12804
12813
|
return i < e.length && e[i] === "\r" && i++, i < e.length && e[i] === "\n" && i++, {
|
|
@@ -12808,7 +12817,7 @@ function by(e, t, n) {
|
|
|
12808
12817
|
}
|
|
12809
12818
|
//#endregion
|
|
12810
12819
|
//#region src/services/suggestions/utils/index.ts
|
|
12811
|
-
function
|
|
12820
|
+
function Sy(e) {
|
|
12812
12821
|
switch (e) {
|
|
12813
12822
|
case R.Schema: return Y.Module;
|
|
12814
12823
|
case R.Table:
|
|
@@ -12821,7 +12830,7 @@ function xy(e) {
|
|
|
12821
12830
|
default: return Y.Text;
|
|
12822
12831
|
}
|
|
12823
12832
|
}
|
|
12824
|
-
function
|
|
12833
|
+
function Cy(e, t) {
|
|
12825
12834
|
if (!e || Ua(e)) return !1;
|
|
12826
12835
|
for (let n of e.trailingTrivia) {
|
|
12827
12836
|
if (n.start > t) break;
|
|
@@ -12832,7 +12841,7 @@ function Sy(e, t) {
|
|
|
12832
12841
|
function Z() {
|
|
12833
12842
|
return { suggestions: [] };
|
|
12834
12843
|
}
|
|
12835
|
-
function
|
|
12844
|
+
function wy(e) {
|
|
12836
12845
|
return {
|
|
12837
12846
|
...e,
|
|
12838
12847
|
suggestions: e.suggestions.map((e) => ({
|
|
@@ -12841,17 +12850,17 @@ function Cy(e) {
|
|
|
12841
12850
|
}))
|
|
12842
12851
|
};
|
|
12843
12852
|
}
|
|
12844
|
-
function
|
|
12853
|
+
function Ty(e) {
|
|
12845
12854
|
return {
|
|
12846
12855
|
...e,
|
|
12847
12856
|
suggestions: e.suggestions.map((e) => ({
|
|
12848
12857
|
...e,
|
|
12849
|
-
insertText: e.quoted ? e.insertText :
|
|
12858
|
+
insertText: e.quoted ? e.insertText : Mg(e.insertText ?? ""),
|
|
12850
12859
|
quoted: !0
|
|
12851
12860
|
}))
|
|
12852
12861
|
};
|
|
12853
12862
|
}
|
|
12854
|
-
function
|
|
12863
|
+
function Ey(e, t = ", ") {
|
|
12855
12864
|
let n = e.suggestions.map((e) => typeof e.label == "string" ? e.label : e.label.label).join(t);
|
|
12856
12865
|
return n ? {
|
|
12857
12866
|
...e,
|
|
@@ -12867,7 +12876,7 @@ function Ty(e, t = ", ") {
|
|
|
12867
12876
|
}
|
|
12868
12877
|
//#endregion
|
|
12869
12878
|
//#region src/services/suggestions/crossFile.ts
|
|
12870
|
-
function
|
|
12879
|
+
function Dy(e, n, r) {
|
|
12871
12880
|
let i = [], a = /* @__PURE__ */ new Set(), o = e.layout.getSource(r) ?? "";
|
|
12872
12881
|
for (let s of e.layout.getEntrypoints()) {
|
|
12873
12882
|
if (s.equals(r)) continue;
|
|
@@ -12875,13 +12884,13 @@ function Ey(e, n, r) {
|
|
|
12875
12884
|
if (c) for (let t of [...c.nonSchemaMembers, ...c.schemaMembers]) {
|
|
12876
12885
|
if (!n.includes(t.kind)) continue;
|
|
12877
12886
|
let c = t.name;
|
|
12878
|
-
!c || a.has(c) || (a.add(c), i.push(
|
|
12887
|
+
!c || a.has(c) || (a.add(c), i.push(Oy(e, c, t.kind, s, r, o)));
|
|
12879
12888
|
}
|
|
12880
12889
|
}
|
|
12881
12890
|
return i;
|
|
12882
12891
|
}
|
|
12883
|
-
function
|
|
12884
|
-
let o =
|
|
12892
|
+
function Oy(e, t, n, r, i, a) {
|
|
12893
|
+
let o = yy(e, t, n, r, i, a), s = [];
|
|
12885
12894
|
if (o.topInsert && s.push({
|
|
12886
12895
|
range: {
|
|
12887
12896
|
startLineNumber: 1,
|
|
@@ -12891,7 +12900,7 @@ function Dy(e, t, n, r, i, a) {
|
|
|
12891
12900
|
},
|
|
12892
12901
|
text: o.topInsert
|
|
12893
12902
|
}), o.removeRange) {
|
|
12894
|
-
let e =
|
|
12903
|
+
let e = ky(a, o.removeRange.startOffset), t = ky(a, o.removeRange.endOffset);
|
|
12895
12904
|
s.push({
|
|
12896
12905
|
range: {
|
|
12897
12906
|
startLineNumber: e.line,
|
|
@@ -12906,14 +12915,14 @@ function Dy(e, t, n, r, i, a) {
|
|
|
12906
12915
|
label: t,
|
|
12907
12916
|
insertText: t,
|
|
12908
12917
|
insertTextRules: X.KeepWhitespace,
|
|
12909
|
-
kind:
|
|
12918
|
+
kind: Sy(n),
|
|
12910
12919
|
detail: `from ${r.basename}`,
|
|
12911
|
-
sortText: `zzz_${
|
|
12920
|
+
sortText: `zzz_${Sy(n).toString().padStart(2, "0")}_${t}`,
|
|
12912
12921
|
range: void 0,
|
|
12913
12922
|
additionalTextEdits: s
|
|
12914
12923
|
};
|
|
12915
12924
|
}
|
|
12916
|
-
function
|
|
12925
|
+
function ky(e, t) {
|
|
12917
12926
|
let n = 1, r = 1;
|
|
12918
12927
|
for (let i = 0; i < t && i < e.length; i++) e[i] === "\n" ? (n++, r = 1) : r++;
|
|
12919
12928
|
return {
|
|
@@ -12923,11 +12932,11 @@ function Oy(e, t) {
|
|
|
12923
12932
|
}
|
|
12924
12933
|
//#endregion
|
|
12925
12934
|
//#region src/services/suggestions/recordRowSnippet.ts
|
|
12926
|
-
function
|
|
12935
|
+
function Ay(e, t, n, i, a) {
|
|
12927
12936
|
let o = e.container.element(i, a);
|
|
12928
|
-
return !(o instanceof V) || !o.isKind(r.Records) || !(o.body instanceof W) || !o.body || !
|
|
12937
|
+
return !(o instanceof V) || !o.isKind(r.Records) || !(o.body instanceof W) || !o.body || !gy(a, o.body) || t.getLineContent(n.lineNumber).trim() !== "" ? null : o.parent instanceof B ? jy(e, o) : My(e, o);
|
|
12929
12938
|
}
|
|
12930
|
-
function
|
|
12939
|
+
function jy(e, n) {
|
|
12931
12940
|
if (!(n.name instanceof am)) return Z();
|
|
12932
12941
|
let r = n.name.argumentList?.elementList || [], i = r.map((n) => e.nodeReferee(n).getFiltered(t));
|
|
12933
12942
|
if (!i || i.length === 0) return Z();
|
|
@@ -12948,7 +12957,7 @@ function Ay(e, n) {
|
|
|
12948
12957
|
range: void 0
|
|
12949
12958
|
}] };
|
|
12950
12959
|
}
|
|
12951
|
-
function
|
|
12960
|
+
function My(e, n) {
|
|
12952
12961
|
let r = n.parent;
|
|
12953
12962
|
if (!(r instanceof V)) return Z();
|
|
12954
12963
|
let i = e.nodeSymbol(r).getFiltered(t);
|
|
@@ -12986,40 +12995,40 @@ function jy(e, n) {
|
|
|
12986
12995
|
}
|
|
12987
12996
|
//#endregion
|
|
12988
12997
|
//#region src/services/suggestions/use.ts
|
|
12989
|
-
function
|
|
12998
|
+
function Ny(e, t, n, r, i) {
|
|
12990
12999
|
let a = e.parse.ast(t);
|
|
12991
|
-
for (let o of a.body) if (o instanceof Jp && n >= o.start && n <= o.fullEnd) return
|
|
13000
|
+
for (let o of a.body) if (o instanceof Jp && n >= o.start && n <= o.fullEnd) return Py(e, t, n, o, i, r);
|
|
12992
13001
|
return null;
|
|
12993
13002
|
}
|
|
12994
|
-
function
|
|
12995
|
-
if (r.importPath &&
|
|
13003
|
+
function Py(e, t, n, r, i, a) {
|
|
13004
|
+
if (r.importPath && gy(n, r.importPath)) return zy(e, t, r.importPath, i, r);
|
|
12996
13005
|
if (r.importPath && n >= r.importPath.end) return Z();
|
|
12997
|
-
if (r.fromKeyword && n > r.fromKeyword.end) return
|
|
13006
|
+
if (r.fromKeyword && n > r.fromKeyword.end) return zy(e, t, void 0, i, r);
|
|
12998
13007
|
if (r.specifiers instanceof Xp) {
|
|
12999
13008
|
if (!r.specifiers.openBrace) {
|
|
13000
|
-
let e =
|
|
13001
|
-
return
|
|
13009
|
+
let e = Ry();
|
|
13010
|
+
return Cy(r.useKeyword, n) ? wy(e) : e;
|
|
13002
13011
|
}
|
|
13003
|
-
return
|
|
13012
|
+
return Fy(e, t, n, r.specifiers, r.importPath, a);
|
|
13004
13013
|
}
|
|
13005
13014
|
if (r.specifiers instanceof sm) return Z();
|
|
13006
|
-
let o =
|
|
13007
|
-
return
|
|
13015
|
+
let o = Ry();
|
|
13016
|
+
return Cy(r.useKeyword, n) ? wy(o) : o;
|
|
13008
13017
|
}
|
|
13009
|
-
function
|
|
13018
|
+
function Fy(e, t, n, r, i, a) {
|
|
13010
13019
|
for (let o of r.specifiers) {
|
|
13011
13020
|
let r = !Number.isNaN(o.start) && n >= o.start && n <= o.end, s = a === o.importKind || a === o.asKeyword;
|
|
13012
13021
|
if (r || s) {
|
|
13013
13022
|
if (o.importKind && n > o.importKind.end) {
|
|
13014
13023
|
let n = o.getSymbolKind();
|
|
13015
|
-
if (n !== void 0 && n !== R.Schema) return
|
|
13024
|
+
if (n !== void 0 && n !== R.Schema) return Ly(e, t, i, n);
|
|
13016
13025
|
}
|
|
13017
|
-
return
|
|
13026
|
+
return Iy();
|
|
13018
13027
|
}
|
|
13019
13028
|
}
|
|
13020
|
-
return
|
|
13029
|
+
return Iy();
|
|
13021
13030
|
}
|
|
13022
|
-
function
|
|
13031
|
+
function Iy() {
|
|
13023
13032
|
return { suggestions: Object.keys(Cp).map((e) => ({
|
|
13024
13033
|
label: e.toLowerCase(),
|
|
13025
13034
|
insertText: `${e.toLowerCase()} `,
|
|
@@ -13028,7 +13037,7 @@ function Fy() {
|
|
|
13028
13037
|
range: void 0
|
|
13029
13038
|
})) };
|
|
13030
13039
|
}
|
|
13031
|
-
function
|
|
13040
|
+
function Ly(e, n, r, i) {
|
|
13032
13041
|
if (!r) return Z();
|
|
13033
13042
|
let a = yo(n, r.value);
|
|
13034
13043
|
if (!a) return Z();
|
|
@@ -13047,11 +13056,11 @@ function Iy(e, n, r, i) {
|
|
|
13047
13056
|
label: e,
|
|
13048
13057
|
insertText: e,
|
|
13049
13058
|
insertTextRules: X.KeepWhitespace,
|
|
13050
|
-
kind:
|
|
13059
|
+
kind: Sy(i),
|
|
13051
13060
|
range: void 0
|
|
13052
13061
|
})) };
|
|
13053
13062
|
}
|
|
13054
|
-
function
|
|
13063
|
+
function Ry() {
|
|
13055
13064
|
return { suggestions: [{
|
|
13056
13065
|
label: "* from",
|
|
13057
13066
|
detail: "import all",
|
|
@@ -13068,10 +13077,10 @@ function Ly() {
|
|
|
13068
13077
|
range: void 0
|
|
13069
13078
|
}] };
|
|
13070
13079
|
}
|
|
13071
|
-
function
|
|
13080
|
+
function zy(e, t, n, r, i) {
|
|
13072
13081
|
let a = t.dirname, o = n ? n.value : "./", s = n === void 0, c;
|
|
13073
13082
|
if (n) {
|
|
13074
|
-
let e =
|
|
13083
|
+
let e = dy(r, n);
|
|
13075
13084
|
c = {
|
|
13076
13085
|
startLineNumber: e.startLineNumber,
|
|
13077
13086
|
startColumn: e.startColumn + 1,
|
|
@@ -13085,7 +13094,7 @@ function Ry(e, t, n, r, i) {
|
|
|
13085
13094
|
let r = n.relativeTo(a);
|
|
13086
13095
|
if (r.endsWith(".dbml") && (r = r.slice(0, -So.length)), r.startsWith(".") || (r = `./${r}`), o && !r.startsWith(o)) continue;
|
|
13087
13096
|
let d = `${o}${r.slice(o.length).split("/")[0]}`, f = vo.resolve(a, d), p = e.layout.isDirectory(f);
|
|
13088
|
-
if (
|
|
13097
|
+
if (Vy(e, n, By(i)) && u.set(d, !0), l.has(d)) continue;
|
|
13089
13098
|
let m = s ? `'${d}'` : d;
|
|
13090
13099
|
l.set(d, {
|
|
13091
13100
|
label: d,
|
|
@@ -13099,7 +13108,7 @@ function Ry(e, t, n, r, i) {
|
|
|
13099
13108
|
for (let [e, t] of l) u.get(e) && (t.sortText = `${t.kind === Y.File ? "0" : "1"}${e}`, t.detail = "best match");
|
|
13100
13109
|
return { suggestions: [...l.values()] };
|
|
13101
13110
|
}
|
|
13102
|
-
function
|
|
13111
|
+
function By(e) {
|
|
13103
13112
|
let t = e.specifiers;
|
|
13104
13113
|
return t instanceof Xp ? t.specifiers.flatMap((e) => {
|
|
13105
13114
|
let t = I(e.name), n = e.importKind?.value.toLowerCase();
|
|
@@ -13109,84 +13118,84 @@ function zy(e) {
|
|
|
13109
13118
|
}];
|
|
13110
13119
|
}) : [];
|
|
13111
13120
|
}
|
|
13112
|
-
function
|
|
13121
|
+
function Vy(e, n, r) {
|
|
13113
13122
|
if (r.length === 0) return !1;
|
|
13114
13123
|
let i = e.usableMembers(n).getFiltered(t);
|
|
13115
13124
|
return i ? r.every(({ name: e, kind: t }) => i.nonSchemaMembers.some((n) => n.kind === t && n.name === e)) : !1;
|
|
13116
13125
|
}
|
|
13117
13126
|
//#endregion
|
|
13118
13127
|
//#region src/services/suggestions/provider.ts
|
|
13119
|
-
var
|
|
13128
|
+
var Hy = class {
|
|
13120
13129
|
constructor(e, t = {}) {
|
|
13121
13130
|
this.compiler = e, this.triggerCharacters = t.triggerCharacters ?? [];
|
|
13122
13131
|
}
|
|
13123
13132
|
provideCompletionItems(e, t) {
|
|
13124
|
-
let n = vo.fromUri(String(e.uri)), r =
|
|
13133
|
+
let n = vo.fromUri(String(e.uri)), r = uy(e, t), i = Ay(this.compiler, e, t, n, r);
|
|
13125
13134
|
if (i !== null) return i;
|
|
13126
13135
|
let a = this.compiler.token.flatStream(n), { token: o, index: s } = this.compiler.container.token(n, r), c = s === void 0 ? a[0] : a[s + 1];
|
|
13127
13136
|
if ([
|
|
13128
13137
|
...o?.trailingTrivia || [],
|
|
13129
13138
|
...o?.leadingTrivia || [],
|
|
13130
13139
|
...c?.leadingTrivia || []
|
|
13131
|
-
].find((e) => Ka(e) &&
|
|
13132
|
-
if (s === void 0) return
|
|
13133
|
-
let l =
|
|
13140
|
+
].find((e) => Ka(e) && gy(r, e))) return Z();
|
|
13141
|
+
if (s === void 0) return tb();
|
|
13142
|
+
let l = Ny(this.compiler, n, r, o, e);
|
|
13134
13143
|
if (l !== null) return l;
|
|
13135
|
-
if ([y.STRING_LITERAL, y.QUOTED_STRING].includes(o.kind) &&
|
|
13144
|
+
if ([y.STRING_LITERAL, y.QUOTED_STRING].includes(o.kind) && gy(r, o)) return Z();
|
|
13136
13145
|
let u = this.compiler.container.element(n, r);
|
|
13137
|
-
if (this.compiler.container.scopeKind(n, r) === Q.TOPLEVEL || u instanceof V && u.type && u.type.start <= r && u.type.end >= r) return
|
|
13146
|
+
if (this.compiler.container.scopeKind(n, r) === Q.TOPLEVEL || u instanceof V && u.type && u.type.start <= r && u.type.end >= r) return tb();
|
|
13138
13147
|
let d = [...this.compiler.container.stack(n, r)].reverse();
|
|
13139
13148
|
for (let e of d) if (e instanceof Qp) switch (e.op?.value) {
|
|
13140
13149
|
case ">":
|
|
13141
13150
|
case "<":
|
|
13142
13151
|
case "<>":
|
|
13143
|
-
case "-": return
|
|
13144
|
-
case "~": return
|
|
13152
|
+
case "-": return Wy(this.compiler, n, r, e);
|
|
13153
|
+
case "~": return Uy(this.compiler, n, r);
|
|
13145
13154
|
default:
|
|
13146
13155
|
}
|
|
13147
13156
|
else if (e instanceof $p) switch (e.op?.value) {
|
|
13148
13157
|
case ">":
|
|
13149
13158
|
case "<":
|
|
13150
13159
|
case "<>":
|
|
13151
|
-
case "-": return
|
|
13152
|
-
case ".": return
|
|
13160
|
+
case "-": return Wy(this.compiler, n, r, e);
|
|
13161
|
+
case ".": return $y(this.compiler, n, r, e);
|
|
13153
13162
|
default:
|
|
13154
13163
|
}
|
|
13155
|
-
else if (e instanceof H) return
|
|
13156
|
-
else if (e instanceof G) return
|
|
13157
|
-
else if (e instanceof nm) return
|
|
13158
|
-
else if (e instanceof rm) return
|
|
13159
|
-
else if (e instanceof am) return
|
|
13160
|
-
else if (e instanceof U) return
|
|
13164
|
+
else if (e instanceof H) return Yy(this.compiler, n, r, e);
|
|
13165
|
+
else if (e instanceof G) return Yy(this.compiler, n, r, e);
|
|
13166
|
+
else if (e instanceof nm) return qy(this.compiler, n, r, e);
|
|
13167
|
+
else if (e instanceof rm) return Jy(this.compiler, n, r);
|
|
13168
|
+
else if (e instanceof am) return sb(this.compiler, n, r, e);
|
|
13169
|
+
else if (e instanceof U) return eb(this.compiler, n, r, e);
|
|
13161
13170
|
else if (e instanceof V) {
|
|
13162
|
-
if (
|
|
13163
|
-
if (e.bodyColon && r >= e.bodyColon.end || e.body &&
|
|
13171
|
+
if (_y(r, e)) return ob(this.compiler, n, r, e);
|
|
13172
|
+
if (e.bodyColon && r >= e.bodyColon.end || e.body && gy(r, e.body)) return eb(this.compiler, n, r, void 0);
|
|
13164
13173
|
}
|
|
13165
13174
|
return Z();
|
|
13166
13175
|
}
|
|
13167
13176
|
};
|
|
13168
|
-
function
|
|
13169
|
-
return
|
|
13177
|
+
function Uy(e, t, n) {
|
|
13178
|
+
return Ky(e, t, n, e.parse.ast(t), [R.TablePartial]);
|
|
13170
13179
|
}
|
|
13171
|
-
function
|
|
13180
|
+
function Wy(e, t, n, r) {
|
|
13172
13181
|
let i = e.container.scopeKind(t, n);
|
|
13173
13182
|
if ([
|
|
13174
13183
|
Q.REF,
|
|
13175
13184
|
Q.TABLE,
|
|
13176
13185
|
Q.TABLEPARTIAL
|
|
13177
13186
|
].includes(i)) {
|
|
13178
|
-
let i =
|
|
13187
|
+
let i = Ky(e, t, n, e.container.element(t, n), [
|
|
13179
13188
|
R.Table,
|
|
13180
13189
|
R.Schema,
|
|
13181
13190
|
R.Column
|
|
13182
13191
|
]);
|
|
13183
|
-
return
|
|
13192
|
+
return Cy(r.op, n) ? wy(i) : i;
|
|
13184
13193
|
}
|
|
13185
13194
|
return Z();
|
|
13186
13195
|
}
|
|
13187
|
-
function
|
|
13196
|
+
function Gy(e, n, r) {
|
|
13188
13197
|
let i = e.symbolMembers(n).getFiltered(t);
|
|
13189
|
-
return i ?
|
|
13198
|
+
return i ? Ty({ suggestions: i.filter((e) => r.includes(e.kind)).filter((e) => !(e instanceof Ep && e.isPublicSchema())).flatMap((e) => {
|
|
13190
13199
|
let t = e.name;
|
|
13191
13200
|
if (t === void 0) return [];
|
|
13192
13201
|
let r = e.originalFilepath, i = r && !r.equals(n.filepath) ? `from ${r.basename}` : "this file";
|
|
@@ -13194,21 +13203,21 @@ function Wy(e, n, r) {
|
|
|
13194
13203
|
label: t,
|
|
13195
13204
|
insertText: t,
|
|
13196
13205
|
insertTextRules: X.KeepWhitespace,
|
|
13197
|
-
kind:
|
|
13198
|
-
sortText:
|
|
13206
|
+
kind: Sy(e.kind),
|
|
13207
|
+
sortText: Sy(e.kind).toString().padStart(2, "0"),
|
|
13199
13208
|
detail: i,
|
|
13200
13209
|
range: void 0
|
|
13201
13210
|
};
|
|
13202
13211
|
}).filter((e) => e.label !== "") }) : Z();
|
|
13203
13212
|
}
|
|
13204
|
-
function
|
|
13213
|
+
function Ky(e, n, r, i, a) {
|
|
13205
13214
|
if (i === void 0) return Z();
|
|
13206
13215
|
let o = i, s = { suggestions: [] }, c;
|
|
13207
13216
|
for (; o;) {
|
|
13208
13217
|
o instanceof B && (c = o);
|
|
13209
13218
|
let n = e.nodeSymbol(o).getFiltered(t);
|
|
13210
13219
|
if (n) {
|
|
13211
|
-
let t =
|
|
13220
|
+
let t = Gy(e, n, a).suggestions, r = (e) => {
|
|
13212
13221
|
switch (e) {
|
|
13213
13222
|
case Y.Field: return 0;
|
|
13214
13223
|
case Y.Module: return 1;
|
|
@@ -13222,60 +13231,60 @@ function Gy(e, n, r, i, a) {
|
|
|
13222
13231
|
}
|
|
13223
13232
|
if (c?.filepath) {
|
|
13224
13233
|
let t = c.filepath, n = new Set(s.suggestions.map((e) => typeof e.label == "string" ? e.label : e.label.label));
|
|
13225
|
-
for (let r of
|
|
13234
|
+
for (let r of Dy(e, a, t)) {
|
|
13226
13235
|
let e = typeof r.label == "string" ? r.label : r.label.label;
|
|
13227
13236
|
n.has(e) || (n.add(e), s.suggestions.push(r));
|
|
13228
13237
|
}
|
|
13229
13238
|
}
|
|
13230
|
-
return
|
|
13239
|
+
return Ty(s);
|
|
13231
13240
|
}
|
|
13232
|
-
function
|
|
13241
|
+
function qy(e, n, i, a) {
|
|
13233
13242
|
let o = e.container.scopeKind(n, i), s = e.container.element(n, i), c = [...e.container.stack(n, i)];
|
|
13234
|
-
for (let t of c) if (t instanceof am && t.argumentList === a) return
|
|
13235
|
-
if (s instanceof V && s.isKind(r.Records) && !(s.name instanceof am) &&
|
|
13243
|
+
for (let t of c) if (t instanceof am && t.argumentList === a) return sb(e, n, i, t);
|
|
13244
|
+
if (s instanceof V && s.isKind(r.Records) && !(s.name instanceof am) && _y(i, s)) {
|
|
13236
13245
|
let n = s.parent ? e.nodeSymbol(s.parent).getFiltered(t) : void 0, r = s.name ? e.nodeReferee(s.name).getFiltered(t) : void 0, i = n || r;
|
|
13237
13246
|
if (i) {
|
|
13238
|
-
let t =
|
|
13239
|
-
return qf(a) ?
|
|
13247
|
+
let t = Gy(e, i, [R.Column]);
|
|
13248
|
+
return qf(a) ? Ey(t) : t;
|
|
13240
13249
|
}
|
|
13241
13250
|
}
|
|
13242
13251
|
switch (o) {
|
|
13243
|
-
case Q.INDEXES: return
|
|
13252
|
+
case Q.INDEXES: return db(e, n, i);
|
|
13244
13253
|
case Q.REF:
|
|
13245
13254
|
for (; c.length > 0;) {
|
|
13246
13255
|
let t = c.pop();
|
|
13247
|
-
if (t instanceof $p && t.op?.value === ".") return
|
|
13256
|
+
if (t instanceof $p && t.op?.value === ".") return $y(e, n, i, t);
|
|
13248
13257
|
}
|
|
13249
|
-
return
|
|
13258
|
+
return ab(e, n, i);
|
|
13250
13259
|
default: break;
|
|
13251
13260
|
}
|
|
13252
13261
|
return Z();
|
|
13253
13262
|
}
|
|
13254
|
-
function
|
|
13255
|
-
return e.container.scopeKind(t, n) === Q.RECORDS ?
|
|
13263
|
+
function Jy(e, t, n) {
|
|
13264
|
+
return e.container.scopeKind(t, n) === Q.RECORDS ? Ky(e, t, n, e.container.element(t, n), [
|
|
13256
13265
|
R.Schema,
|
|
13257
13266
|
R.Enum,
|
|
13258
13267
|
R.EnumField
|
|
13259
13268
|
]) : Z();
|
|
13260
13269
|
}
|
|
13261
|
-
function
|
|
13270
|
+
function Yy(e, t, n, r) {
|
|
13262
13271
|
let { token: i } = e.container.token(t, n);
|
|
13263
13272
|
if ([y.COMMA, y.LBRACKET].includes(i?.kind)) {
|
|
13264
|
-
let r =
|
|
13265
|
-
return i?.kind === y.COMMA &&
|
|
13273
|
+
let r = Xy(e, t, n);
|
|
13274
|
+
return i?.kind === y.COMMA && Cy(i, n) ? wy(r) : r;
|
|
13266
13275
|
}
|
|
13267
|
-
if (r.name && r.name.start <= n && r.name.end >= n) return
|
|
13276
|
+
if (r.name && r.name.start <= n && r.name.end >= n) return Xy(e, t, n);
|
|
13268
13277
|
if (r.name instanceof Zp) {
|
|
13269
|
-
let a =
|
|
13270
|
-
return i?.kind === y.COLON &&
|
|
13278
|
+
let a = Zy(e, t, n, Gf(r.name) ?? "");
|
|
13279
|
+
return i?.kind === y.COLON && Cy(i, n) ? wy(a) : a;
|
|
13271
13280
|
}
|
|
13272
13281
|
return Z();
|
|
13273
13282
|
}
|
|
13274
|
-
function
|
|
13283
|
+
function Xy(e, t, n) {
|
|
13275
13284
|
let r = e.container.element(t, n);
|
|
13276
13285
|
if (r instanceof B) return Z();
|
|
13277
13286
|
let a = e.container.scopeKind(t, n);
|
|
13278
|
-
if (r.body && !
|
|
13287
|
+
if (r.body && !gy(n, r.body)) {
|
|
13279
13288
|
let e;
|
|
13280
13289
|
switch (a) {
|
|
13281
13290
|
case Q.TABLE:
|
|
@@ -13377,7 +13386,7 @@ function Yy(e, t, n) {
|
|
|
13377
13386
|
}
|
|
13378
13387
|
return Z();
|
|
13379
13388
|
}
|
|
13380
|
-
function
|
|
13389
|
+
function Zy(e, t, n, r) {
|
|
13381
13390
|
switch (r?.toLowerCase()) {
|
|
13382
13391
|
case "update":
|
|
13383
13392
|
case "delete": return { suggestions: [
|
|
@@ -13408,12 +13417,12 @@ function Xy(e, t, n, r) {
|
|
|
13408
13417
|
range: void 0
|
|
13409
13418
|
})) };
|
|
13410
13419
|
break;
|
|
13411
|
-
case "default": return
|
|
13420
|
+
case "default": return Ky(e, t, n, e.container.element(t, n), [R.Schema, R.Enum]);
|
|
13412
13421
|
default: break;
|
|
13413
13422
|
}
|
|
13414
13423
|
return Z();
|
|
13415
13424
|
}
|
|
13416
|
-
function
|
|
13425
|
+
function Qy(e, n, r) {
|
|
13417
13426
|
if (!r) return [];
|
|
13418
13427
|
let i = [], a = r;
|
|
13419
13428
|
for (; a;) {
|
|
@@ -13431,43 +13440,43 @@ function Zy(e, n, r) {
|
|
|
13431
13440
|
}
|
|
13432
13441
|
return i;
|
|
13433
13442
|
}
|
|
13434
|
-
function
|
|
13443
|
+
function $y(e, n, r, i) {
|
|
13435
13444
|
let a = Yf(i) ?? [];
|
|
13436
|
-
return a.pop(), a.some((e) => !A(e)) ? Z() :
|
|
13445
|
+
return a.pop(), a.some((e) => !A(e)) ? Z() : Ty({ suggestions: Qy(e, a.map((e) => I(e)), e.container.element(n, r)).flatMap((n) => e.symbolMembers(n).getFiltered(t) || []).flatMap((e) => {
|
|
13437
13446
|
let t = e.name;
|
|
13438
13447
|
return t === void 0 ? [] : {
|
|
13439
13448
|
label: t,
|
|
13440
13449
|
insertText: t,
|
|
13441
|
-
kind:
|
|
13450
|
+
kind: Sy(e.kind),
|
|
13442
13451
|
range: void 0
|
|
13443
13452
|
};
|
|
13444
13453
|
}) });
|
|
13445
13454
|
}
|
|
13446
|
-
function
|
|
13455
|
+
function eb(e, t, n, i) {
|
|
13447
13456
|
switch (e.container.scopeKind(t, n)) {
|
|
13448
13457
|
case Q.TABLE:
|
|
13449
|
-
case Q.TABLEPARTIAL: return
|
|
13450
|
-
case Q.PROJECT: return
|
|
13451
|
-
case Q.INDEXES: return
|
|
13452
|
-
case Q.ENUM: return
|
|
13458
|
+
case Q.TABLEPARTIAL: return rb(e, t, n, i);
|
|
13459
|
+
case Q.PROJECT: return ib(e, t, n, i);
|
|
13460
|
+
case Q.INDEXES: return lb(e, t, n);
|
|
13461
|
+
case Q.ENUM: return nb(e, t, n, i);
|
|
13453
13462
|
case Q.REF: {
|
|
13454
|
-
let r =
|
|
13455
|
-
return e.container.token(t, n).token?.kind === y.COLON &&
|
|
13463
|
+
let r = ab(e, t, n);
|
|
13464
|
+
return e.container.token(t, n).token?.kind === y.COLON && Cy(e.container.token(t, n).token, n) ? wy(r) : r;
|
|
13456
13465
|
}
|
|
13457
|
-
case Q.TABLEGROUP: return
|
|
13458
|
-
case Q.DIAGRAMVIEW: return
|
|
13466
|
+
case Q.TABLEGROUP: return cb(e, t);
|
|
13467
|
+
case Q.DIAGRAMVIEW: return mb();
|
|
13459
13468
|
case Q.CUSTOM: {
|
|
13460
13469
|
let i = e.container.element(t, n);
|
|
13461
13470
|
if (i instanceof V) {
|
|
13462
13471
|
let a = i.parentNode, o = a instanceof W ? a.parentNode : void 0;
|
|
13463
|
-
if (o instanceof V && o.isKind(r.DiagramView)) return
|
|
13472
|
+
if (o instanceof V && o.isKind(r.DiagramView)) return hb(e, t, n, i);
|
|
13464
13473
|
}
|
|
13465
13474
|
return Z();
|
|
13466
13475
|
}
|
|
13467
13476
|
default: return Z();
|
|
13468
13477
|
}
|
|
13469
13478
|
}
|
|
13470
|
-
function
|
|
13479
|
+
function tb() {
|
|
13471
13480
|
return { suggestions: [
|
|
13472
13481
|
"Table",
|
|
13473
13482
|
"TableGroup",
|
|
@@ -13486,14 +13495,14 @@ function eb() {
|
|
|
13486
13495
|
range: void 0
|
|
13487
13496
|
})) };
|
|
13488
13497
|
}
|
|
13489
|
-
function
|
|
13490
|
-
return r?.callee &&
|
|
13498
|
+
function nb(e, t, n, r) {
|
|
13499
|
+
return r?.callee && fb(n, r) === 1 ? Ky(e, t, n, e.container.element(t, n), [
|
|
13491
13500
|
R.Schema,
|
|
13492
13501
|
R.Table,
|
|
13493
13502
|
R.Column
|
|
13494
13503
|
]) : Z();
|
|
13495
13504
|
}
|
|
13496
|
-
function
|
|
13505
|
+
function rb(e, t, n, r) {
|
|
13497
13506
|
let i = [
|
|
13498
13507
|
"Note",
|
|
13499
13508
|
"indexes",
|
|
@@ -13507,17 +13516,17 @@ function nb(e, t, n, r) {
|
|
|
13507
13516
|
kind: Y.Keyword,
|
|
13508
13517
|
range: void 0
|
|
13509
13518
|
})) };
|
|
13510
|
-
let a =
|
|
13519
|
+
let a = fb(n, r);
|
|
13511
13520
|
return a === 0 ? { suggestions: i.map((e) => ({
|
|
13512
13521
|
label: e,
|
|
13513
13522
|
insertText: e,
|
|
13514
13523
|
insertTextRules: X.KeepWhitespace,
|
|
13515
13524
|
kind: Y.Keyword,
|
|
13516
13525
|
range: void 0
|
|
13517
|
-
})) } : a === 1 ?
|
|
13526
|
+
})) } : a === 1 ? ub(e, t, n) : Z();
|
|
13518
13527
|
}
|
|
13519
|
-
function
|
|
13520
|
-
return !r?.callee ||
|
|
13528
|
+
function ib(e, t, n, r) {
|
|
13529
|
+
return !r?.callee || fb(n, r) === 0 ? { suggestions: [
|
|
13521
13530
|
"Table",
|
|
13522
13531
|
"TableGroup",
|
|
13523
13532
|
"Enum",
|
|
@@ -13532,47 +13541,47 @@ function rb(e, t, n, r) {
|
|
|
13532
13541
|
range: void 0
|
|
13533
13542
|
})) } : Z();
|
|
13534
13543
|
}
|
|
13535
|
-
function
|
|
13536
|
-
return
|
|
13544
|
+
function ab(e, t, n) {
|
|
13545
|
+
return Ky(e, t, n, e.container.element(t, n), [
|
|
13537
13546
|
R.Schema,
|
|
13538
13547
|
R.Table,
|
|
13539
13548
|
R.Column
|
|
13540
13549
|
]);
|
|
13541
13550
|
}
|
|
13542
|
-
function
|
|
13543
|
-
return i.isKind(r.Records) ?
|
|
13551
|
+
function ob(e, t, n, i) {
|
|
13552
|
+
return i.isKind(r.Records) ? Ky(e, t, n, i.parent, [R.Schema, R.Table]) : Z();
|
|
13544
13553
|
}
|
|
13545
|
-
function
|
|
13546
|
-
let o = e.container.element(n, i), s = a.callee &&
|
|
13547
|
-
if (o instanceof V && o.isKind(r.Records) &&
|
|
13548
|
-
if (s) return
|
|
13554
|
+
function sb(e, n, i, a) {
|
|
13555
|
+
let o = e.container.element(n, i), s = a.callee && gy(i, a.callee), c = a.argumentList && gy(i, a.argumentList);
|
|
13556
|
+
if (o instanceof V && o.isKind(r.Records) && _y(i, o)) {
|
|
13557
|
+
if (s) return Ky(e, n, i, o.parent, [R.Schema, R.Table]);
|
|
13549
13558
|
if (!c) return Z();
|
|
13550
13559
|
let r = a.callee;
|
|
13551
13560
|
if (!r) return Z();
|
|
13552
13561
|
let l = Yf(r) ?? [r], u = l[l.length - 1], d = u ? e.nodeReferee(u).getFiltered(t) : void 0;
|
|
13553
13562
|
if (!d) return Z();
|
|
13554
|
-
let f =
|
|
13555
|
-
return !p || !qf(p) ? f :
|
|
13563
|
+
let f = Gy(e, d, [R.Column]), { argumentList: p } = a;
|
|
13564
|
+
return !p || !qf(p) ? f : Ey(f);
|
|
13556
13565
|
}
|
|
13557
13566
|
let l = [...e.container.stack(n, i)];
|
|
13558
13567
|
for (let o of l) {
|
|
13559
13568
|
if (!c || !(o instanceof U) || o.callee !== a || (I(a.callee) ?? "").toLowerCase() !== r.Records) continue;
|
|
13560
13569
|
let s = e.nodeSymbol(e.container.element(n, i)).getFiltered(t);
|
|
13561
13570
|
if (!s) return Z();
|
|
13562
|
-
let l =
|
|
13563
|
-
return !u || !qf(u) ? l :
|
|
13571
|
+
let l = Gy(e, s, [R.Column]), { argumentList: u } = a;
|
|
13572
|
+
return !u || !qf(u) ? l : Ey(l);
|
|
13564
13573
|
}
|
|
13565
13574
|
return Z();
|
|
13566
13575
|
}
|
|
13567
|
-
function
|
|
13568
|
-
return { suggestions: [...
|
|
13576
|
+
function cb(e, t) {
|
|
13577
|
+
return { suggestions: [...Ty({ suggestions: (e.parse.publicSymbolTable(t) ?? []).flatMap((e) => {
|
|
13569
13578
|
if (e.kind !== R.Table && e.kind !== R.Schema) return [];
|
|
13570
13579
|
let t = e.name;
|
|
13571
13580
|
return t === void 0 || e instanceof Ep && e.isPublicSchema() ? [] : {
|
|
13572
13581
|
label: t,
|
|
13573
13582
|
insertText: t,
|
|
13574
13583
|
insertTextRules: X.KeepWhitespace,
|
|
13575
|
-
kind:
|
|
13584
|
+
kind: Sy(e.kind),
|
|
13576
13585
|
range: void 0
|
|
13577
13586
|
};
|
|
13578
13587
|
}) }).suggestions, ...["Note"].map((e) => ({
|
|
@@ -13583,10 +13592,10 @@ function sb(e, t) {
|
|
|
13583
13592
|
range: void 0
|
|
13584
13593
|
}))] };
|
|
13585
13594
|
}
|
|
13586
|
-
function cb(e, t, n) {
|
|
13587
|
-
return ub(e, t, n);
|
|
13588
|
-
}
|
|
13589
13595
|
function lb(e, t, n) {
|
|
13596
|
+
return db(e, t, n);
|
|
13597
|
+
}
|
|
13598
|
+
function ub(e, t, n) {
|
|
13590
13599
|
return { suggestions: [...(/* @__PURE__ */ "integer.int.tinyint.smallint.mediumint.bigint.bit.bool.binary.varbinary.logical.char.nchar.varchar.varchar2.nvarchar.nvarchar2.binary_float.binary_double.float.double.decimal.dec.real.money.smallmoney.enum.tinyblob.tinytext.blob.text.mediumblob.mediumtext.longblob.longtext.ntext.set.inet6.uuid.image.date.time.datetime.datetime2.timestamp.year.smalldatetime.datetimeoffset.XML.sql_variant.uniqueidentifier.CURSOR.BFILE.CLOB.NCLOB.RAW".split(".")).map((e) => ({
|
|
13591
13600
|
label: e,
|
|
13592
13601
|
insertText: e,
|
|
@@ -13594,36 +13603,36 @@ function lb(e, t, n) {
|
|
|
13594
13603
|
kind: Y.TypeParameter,
|
|
13595
13604
|
sortText: Y.TypeParameter.toString().padStart(2, "0"),
|
|
13596
13605
|
range: void 0
|
|
13597
|
-
})), ...
|
|
13606
|
+
})), ...Ky(e, t, n, e.container.element(t, n), [R.Enum, R.Schema]).suggestions] };
|
|
13598
13607
|
}
|
|
13599
|
-
function
|
|
13608
|
+
function db(e, n, r) {
|
|
13600
13609
|
let i = e.container.element(n, r)?.parent, a = i ? e.nodeSymbol(i).getFiltered(t) : void 0;
|
|
13601
13610
|
if (!a || !a?.isKind(R.Table)) return Z();
|
|
13602
13611
|
let o = e.symbolMembers(a).getFiltered(t);
|
|
13603
|
-
return o ?
|
|
13612
|
+
return o ? Ty({ suggestions: o.flatMap((n) => {
|
|
13604
13613
|
let r = n.declaration ? e.nodeFullname(n.declaration) : void 0, i = r && !r.hasValue(t) ? r.getValue()?.at(-1) : void 0;
|
|
13605
13614
|
return i ? {
|
|
13606
13615
|
label: i,
|
|
13607
13616
|
insertText: i,
|
|
13608
13617
|
insertTextRules: X.KeepWhitespace,
|
|
13609
|
-
kind:
|
|
13618
|
+
kind: Sy(R.Column),
|
|
13610
13619
|
range: void 0
|
|
13611
13620
|
} : [];
|
|
13612
13621
|
}) }) : Z();
|
|
13613
13622
|
}
|
|
13614
|
-
function
|
|
13623
|
+
function fb(e, t) {
|
|
13615
13624
|
if (!t.callee) return -1;
|
|
13616
13625
|
let n = [t.callee, ...t.args], r = n.findIndex((t) => e <= t.end);
|
|
13617
13626
|
return r === -1 ? n.length : r;
|
|
13618
13627
|
}
|
|
13619
|
-
var
|
|
13628
|
+
var pb = {
|
|
13620
13629
|
label: "*",
|
|
13621
13630
|
insertText: "*",
|
|
13622
13631
|
insertTextRules: X.KeepWhitespace,
|
|
13623
13632
|
kind: Y.Keyword,
|
|
13624
13633
|
range: void 0
|
|
13625
13634
|
};
|
|
13626
|
-
function
|
|
13635
|
+
function mb() {
|
|
13627
13636
|
return { suggestions: [...[
|
|
13628
13637
|
"Tables",
|
|
13629
13638
|
"TableGroups",
|
|
@@ -13635,14 +13644,14 @@ function pb() {
|
|
|
13635
13644
|
insertTextRules: X.KeepWhitespace,
|
|
13636
13645
|
kind: Y.Keyword,
|
|
13637
13646
|
range: void 0
|
|
13638
|
-
})),
|
|
13647
|
+
})), pb] };
|
|
13639
13648
|
}
|
|
13640
|
-
function
|
|
13649
|
+
function hb(e, t, n, i) {
|
|
13641
13650
|
switch (i.getElementKind()) {
|
|
13642
|
-
case r.DiagramViewTables: return { suggestions: [
|
|
13643
|
-
case r.DiagramViewTableGroups: return { suggestions: [
|
|
13651
|
+
case r.DiagramViewTables: return { suggestions: [pb, ...Ky(e, t, n, e.parse.ast(t), [R.Table, R.Schema]).suggestions] };
|
|
13652
|
+
case r.DiagramViewTableGroups: return { suggestions: [pb, ...Ky(e, t, n, e.parse.ast(t), [R.TableGroup]).suggestions] };
|
|
13644
13653
|
case r.DiagramViewSchemas: return { suggestions: [
|
|
13645
|
-
|
|
13654
|
+
pb,
|
|
13646
13655
|
{
|
|
13647
13656
|
label: b,
|
|
13648
13657
|
insertText: b,
|
|
@@ -13650,15 +13659,15 @@ function mb(e, t, n, i) {
|
|
|
13650
13659
|
kind: Y.Module,
|
|
13651
13660
|
range: void 0
|
|
13652
13661
|
},
|
|
13653
|
-
...
|
|
13662
|
+
...Ky(e, t, n, e.parse.ast(t), [R.Schema]).suggestions
|
|
13654
13663
|
] };
|
|
13655
|
-
case r.DiagramViewNotes: return { suggestions: [
|
|
13664
|
+
case r.DiagramViewNotes: return { suggestions: [pb, ...Ky(e, t, n, e.parse.ast(t), [R.StickyNote]).suggestions] };
|
|
13656
13665
|
default: return Z();
|
|
13657
13666
|
}
|
|
13658
13667
|
}
|
|
13659
13668
|
//#endregion
|
|
13660
13669
|
//#region src/services/monarch.ts
|
|
13661
|
-
var
|
|
13670
|
+
var gb = {
|
|
13662
13671
|
comments: {
|
|
13663
13672
|
lineComment: "//",
|
|
13664
13673
|
blockComment: ["/*", "*/"]
|
|
@@ -13724,7 +13733,7 @@ var hb = {
|
|
|
13724
13733
|
increaseIndentPattern: /^(.*\{[^}]*|\s*[{[].*)$/,
|
|
13725
13734
|
decreaseIndentPattern: /^(.*\}.*|\s*[}\]].*)$/
|
|
13726
13735
|
}
|
|
13727
|
-
},
|
|
13736
|
+
}, _b = {
|
|
13728
13737
|
tokenPostfix: ".dbml",
|
|
13729
13738
|
brackets: [
|
|
13730
13739
|
{
|
|
@@ -13926,12 +13935,12 @@ var hb = {
|
|
|
13926
13935
|
};
|
|
13927
13936
|
//#endregion
|
|
13928
13937
|
//#region src/compiler/queries/container/stack.ts
|
|
13929
|
-
function
|
|
13938
|
+
function vb(e, t) {
|
|
13930
13939
|
let n = this.token.flatStream(e), { index: r, token: i } = this.container.token(e, t), a = r === void 0 ? -1 : ga(n, (e) => !e.isInvalid, r);
|
|
13931
13940
|
if (a === -1) return [this.parse.ast(e)];
|
|
13932
13941
|
let o = n[a].start, s = this.parse.ast(e), c = [s];
|
|
13933
13942
|
for (;;) {
|
|
13934
|
-
let e = Am(s).find((e) =>
|
|
13943
|
+
let e = Am(s).find((e) => gy(o, e));
|
|
13935
13944
|
if (e === void 0 || e instanceof Ba) break;
|
|
13936
13945
|
c.push(e), s = e;
|
|
13937
13946
|
}
|
|
@@ -13952,7 +13961,7 @@ function _b(e, t) {
|
|
|
13952
13961
|
}
|
|
13953
13962
|
//#endregion
|
|
13954
13963
|
//#region src/compiler/queries/container/token.ts
|
|
13955
|
-
function
|
|
13964
|
+
function yb(e, t) {
|
|
13956
13965
|
let n = this.token.flatStream(e).findIndex((e) => e.start >= t);
|
|
13957
13966
|
return n === void 0 || n <= 0 ? {
|
|
13958
13967
|
token: void 0,
|
|
@@ -13964,14 +13973,14 @@ function vb(e, t) {
|
|
|
13964
13973
|
}
|
|
13965
13974
|
//#endregion
|
|
13966
13975
|
//#region src/compiler/queries/container/element.ts
|
|
13967
|
-
function
|
|
13976
|
+
function bb(e, t) {
|
|
13968
13977
|
let n = this.container.stack(e, t);
|
|
13969
13978
|
for (let e = n.length - 1; e >= 0; --e) if (n[e] instanceof V) return n[e];
|
|
13970
13979
|
return this.parse.ast(e);
|
|
13971
13980
|
}
|
|
13972
13981
|
//#endregion
|
|
13973
13982
|
//#region src/compiler/queries/container/scope.ts
|
|
13974
|
-
function
|
|
13983
|
+
function xb(e, n) {
|
|
13975
13984
|
let r = this.container.element(e, n);
|
|
13976
13985
|
if (!r) return;
|
|
13977
13986
|
let i = this.nodeSymbol(r);
|
|
@@ -13986,7 +13995,7 @@ var Q = /* @__PURE__ */ function(e) {
|
|
|
13986
13995
|
}({});
|
|
13987
13996
|
//#endregion
|
|
13988
13997
|
//#region src/compiler/queries/container/scopeKind.ts
|
|
13989
|
-
function
|
|
13998
|
+
function Sb(e, t) {
|
|
13990
13999
|
let n = this.container.element(e, t);
|
|
13991
14000
|
if (n instanceof B) return Q.TOPLEVEL;
|
|
13992
14001
|
switch (n.type?.value.toLowerCase()) {
|
|
@@ -14006,9 +14015,9 @@ function xb(e, t) {
|
|
|
14006
14015
|
}
|
|
14007
14016
|
//#endregion
|
|
14008
14017
|
//#region src/compiler/queries/canonicalName.ts
|
|
14009
|
-
function
|
|
14018
|
+
function Cb(e, t) {
|
|
14010
14019
|
let r = t.originalSymbol;
|
|
14011
|
-
if (r.filepath.equals(e)) return n.create(
|
|
14020
|
+
if (r.filepath.equals(e)) return n.create(Tb(this, r));
|
|
14012
14021
|
let i = [...this.symbolUses(r).getValue(), ...this.symbolAliases(r).getValue()].filter((t) => t.filepath.equals(e));
|
|
14013
14022
|
for (let e of i) {
|
|
14014
14023
|
let t = e.name;
|
|
@@ -14017,12 +14026,12 @@ function Sb(e, t) {
|
|
|
14017
14026
|
schema: "",
|
|
14018
14027
|
name: t
|
|
14019
14028
|
});
|
|
14020
|
-
let i =
|
|
14029
|
+
let i = wb(this, e);
|
|
14021
14030
|
if (i.length > 0) return n.create({
|
|
14022
14031
|
schema: i.join("."),
|
|
14023
14032
|
name: t
|
|
14024
14033
|
});
|
|
14025
|
-
let a =
|
|
14034
|
+
let a = Tb(this, r);
|
|
14026
14035
|
return a ? n.create({
|
|
14027
14036
|
...a,
|
|
14028
14037
|
name: t
|
|
@@ -14031,9 +14040,9 @@ function Sb(e, t) {
|
|
|
14031
14040
|
name: t
|
|
14032
14041
|
});
|
|
14033
14042
|
}
|
|
14034
|
-
return n.create(
|
|
14043
|
+
return n.create(Tb(this, r));
|
|
14035
14044
|
}
|
|
14036
|
-
function
|
|
14045
|
+
function wb(e, t) {
|
|
14037
14046
|
let n = [], r = t;
|
|
14038
14047
|
for (; r;) {
|
|
14039
14048
|
let t = e.symbolParent(r).find((e) => e instanceof Ep && e.isKind(R.Schema));
|
|
@@ -14042,7 +14051,7 @@ function Cb(e, t) {
|
|
|
14042
14051
|
}
|
|
14043
14052
|
return n;
|
|
14044
14053
|
}
|
|
14045
|
-
function
|
|
14054
|
+
function Tb(e, n) {
|
|
14046
14055
|
if (!n.declaration) return n.name ? {
|
|
14047
14056
|
schema: b,
|
|
14048
14057
|
name: n.name
|
|
@@ -14060,7 +14069,7 @@ function wb(e, n) {
|
|
|
14060
14069
|
}
|
|
14061
14070
|
//#endregion
|
|
14062
14071
|
//#region src/compiler/queries/files/fileDependencies.ts
|
|
14063
|
-
function
|
|
14072
|
+
function Eb(e) {
|
|
14064
14073
|
let { ast: t } = this.parseFile(e).getValue(), n = [], r = /* @__PURE__ */ new Set();
|
|
14065
14074
|
for (let i of t.body) {
|
|
14066
14075
|
if (!(i instanceof Jp) || !i.importPath) continue;
|
|
@@ -14071,7 +14080,7 @@ function Tb(e) {
|
|
|
14071
14080
|
}
|
|
14072
14081
|
//#endregion
|
|
14073
14082
|
//#region src/compiler/queries/files/reachableFiles.ts
|
|
14074
|
-
function
|
|
14083
|
+
function Db(e, t) {
|
|
14075
14084
|
let n = /* @__PURE__ */ new Set(), r = [], i = [...t], a = 0;
|
|
14076
14085
|
for (; a < i.length;) {
|
|
14077
14086
|
let t = i[a++], o = t.intern();
|
|
@@ -14082,49 +14091,49 @@ function Eb(e, t) {
|
|
|
14082
14091
|
}
|
|
14083
14092
|
return r;
|
|
14084
14093
|
}
|
|
14085
|
-
function
|
|
14086
|
-
return
|
|
14094
|
+
function Ob(e) {
|
|
14095
|
+
return Db(this, e ? [e] : this.layout.getEntrypoints());
|
|
14087
14096
|
}
|
|
14088
14097
|
//#endregion
|
|
14089
14098
|
//#region src/compiler/queries/legacy/parse.ts
|
|
14090
|
-
function
|
|
14099
|
+
function kb(e) {
|
|
14091
14100
|
return this.bindFile(e), this.parseFile(e).getValue().ast;
|
|
14092
14101
|
}
|
|
14093
|
-
function
|
|
14102
|
+
function Ab(e) {
|
|
14094
14103
|
return this.interpretFile(e).getErrors();
|
|
14095
14104
|
}
|
|
14096
|
-
function
|
|
14105
|
+
function jb(e) {
|
|
14097
14106
|
return this.interpretFile(e).getWarnings();
|
|
14098
14107
|
}
|
|
14099
|
-
function
|
|
14108
|
+
function Mb(e) {
|
|
14100
14109
|
return this.parseFile(e).getValue().tokens;
|
|
14101
14110
|
}
|
|
14102
|
-
function
|
|
14111
|
+
function Nb(e) {
|
|
14103
14112
|
let n = this.parseFile(e).getValue().ast, r = this.nodeSymbol(n).getFiltered(t);
|
|
14104
14113
|
if (r) return this.interpretSymbol(r, e).getFiltered(t);
|
|
14105
14114
|
}
|
|
14106
|
-
function
|
|
14115
|
+
function Pb(e) {
|
|
14107
14116
|
let n = this.parseFile(e).getValue().ast, r = this.nodeSymbol(n).getFiltered(t);
|
|
14108
14117
|
if (r) return this.symbolMembers(r).getFiltered(t);
|
|
14109
14118
|
}
|
|
14110
14119
|
//#endregion
|
|
14111
14120
|
//#region src/compiler/queries/legacy/token.ts
|
|
14112
|
-
function
|
|
14121
|
+
function Fb(e) {
|
|
14113
14122
|
return this.parseFile(e).getValue().tokens.flatMap((e) => [
|
|
14114
14123
|
...e.leadingInvalid,
|
|
14115
14124
|
e,
|
|
14116
14125
|
...e.trailingInvalid
|
|
14117
14126
|
]);
|
|
14118
14127
|
}
|
|
14119
|
-
function
|
|
14128
|
+
function Ib(e) {
|
|
14120
14129
|
return this.parseFile(e).getValue().tokens.filter(Za);
|
|
14121
14130
|
}
|
|
14122
14131
|
//#endregion
|
|
14123
14132
|
//#region src/compiler/queries/nodeAtPosition.ts
|
|
14124
|
-
function
|
|
14133
|
+
function Lb(e, t) {
|
|
14125
14134
|
let n = this.parse.ast(e);
|
|
14126
14135
|
for (;;) {
|
|
14127
|
-
let e = Am(n).find((e) =>
|
|
14136
|
+
let e = Am(n).find((e) => gy(t, e));
|
|
14128
14137
|
if (e === void 0) return n;
|
|
14129
14138
|
if (e instanceof Ba) return e;
|
|
14130
14139
|
n = e;
|
|
@@ -14132,12 +14141,12 @@ function Ib(e, t) {
|
|
|
14132
14141
|
}
|
|
14133
14142
|
//#endregion
|
|
14134
14143
|
//#region src/compiler/queries/pipeline/bind.ts
|
|
14135
|
-
function
|
|
14144
|
+
function Rb(e) {
|
|
14136
14145
|
let t = this.validateFile(e), r = this.parseFile(e).getValue().ast, i = this.bindNode(r).map(() => void 0);
|
|
14137
14146
|
return new n(void 0, [...t.getErrors(), ...i.getErrors()], [...t.getWarnings(), ...i.getWarnings()]);
|
|
14138
14147
|
}
|
|
14139
|
-
function
|
|
14140
|
-
let e =
|
|
14148
|
+
function zb() {
|
|
14149
|
+
let e = Lg(this, this.layout.getEntrypoints()), t = /* @__PURE__ */ new Map();
|
|
14141
14150
|
for (let n of e) {
|
|
14142
14151
|
let e = this.bindFile(n);
|
|
14143
14152
|
t.set(n.absolute, e);
|
|
@@ -14146,11 +14155,11 @@ function Rb() {
|
|
|
14146
14155
|
}
|
|
14147
14156
|
//#endregion
|
|
14148
14157
|
//#region src/compiler/queries/pipeline/interpret.ts
|
|
14149
|
-
function
|
|
14158
|
+
function Bb(e) {
|
|
14150
14159
|
let { ast: r } = this.parseFile(e).getValue(), i = this.nodeSymbol(r).getFiltered(t);
|
|
14151
14160
|
return i ? this.interpretSymbol(i, e).map((e) => e === t || !e ? void 0 : e) : n.create(void 0);
|
|
14152
14161
|
}
|
|
14153
|
-
function
|
|
14162
|
+
function Vb() {
|
|
14154
14163
|
let e = [], r = [], i = [], a = /* @__PURE__ */ new Set(), o = [];
|
|
14155
14164
|
for (let e of this.layout.getEntrypoints()) for (let t of this.reachableFiles(e)) {
|
|
14156
14165
|
let e = t.intern();
|
|
@@ -14171,12 +14180,12 @@ function Bb() {
|
|
|
14171
14180
|
}
|
|
14172
14181
|
//#endregion
|
|
14173
14182
|
//#region src/compiler/queries/pipeline/validate.ts
|
|
14174
|
-
function
|
|
14183
|
+
function Hb(e) {
|
|
14175
14184
|
return this.parseFile(e).chain(({ ast: e }) => this.validateNode(e).map(() => void 0));
|
|
14176
14185
|
}
|
|
14177
14186
|
//#endregion
|
|
14178
14187
|
//#region src/core/lexer/lexer.ts
|
|
14179
|
-
var
|
|
14188
|
+
var Ub = class {
|
|
14180
14189
|
constructor(e, t) {
|
|
14181
14190
|
this.start = {
|
|
14182
14191
|
offset: 0,
|
|
@@ -14460,9 +14469,9 @@ var Hb = class {
|
|
|
14460
14469
|
default: return this.text[this.current.offset - 1];
|
|
14461
14470
|
}
|
|
14462
14471
|
}
|
|
14463
|
-
},
|
|
14472
|
+
}, Wb = /* @__PURE__ */ function(e) {
|
|
14464
14473
|
return e[e.ListExpression = 0] = "ListExpression", e[e.GroupExpression = 1] = "GroupExpression", e[e.BlockExpression = 2] = "BlockExpression", e;
|
|
14465
|
-
}({}),
|
|
14474
|
+
}({}), Gb = class {
|
|
14466
14475
|
constructor() {
|
|
14467
14476
|
this.stack = [], this.numberOfNestedLParens = 0, this.numberOfNestedLBrackets = 0, this.numberOfNestedLBraces = 0;
|
|
14468
14477
|
}
|
|
@@ -14512,7 +14521,7 @@ var Hb = class {
|
|
|
14512
14521
|
default: break;
|
|
14513
14522
|
}
|
|
14514
14523
|
}
|
|
14515
|
-
},
|
|
14524
|
+
}, Kb = class {
|
|
14516
14525
|
constructor(e, t) {
|
|
14517
14526
|
this.generator = e, this.filepath = t;
|
|
14518
14527
|
}
|
|
@@ -14523,9 +14532,9 @@ var Hb = class {
|
|
|
14523
14532
|
constructor(e, t, n) {
|
|
14524
14533
|
this.token = e, this.partialNode = t, this.handlerContext = n;
|
|
14525
14534
|
}
|
|
14526
|
-
},
|
|
14535
|
+
}, qb = class {
|
|
14527
14536
|
constructor(e, t, n, r) {
|
|
14528
|
-
this.current = 0, this.errors = [], this.contextStack = new
|
|
14537
|
+
this.current = 0, this.errors = [], this.contextStack = new Gb(), this.useSpecifierList = this.contextStack.withContextDo(Wb.BlockExpression, () => {
|
|
14529
14538
|
let e = { specifiers: [] }, t = () => this.nodeFactory.create(Xp, e);
|
|
14530
14539
|
try {
|
|
14531
14540
|
this.consume("Expect an opening brace '{'", y.LBRACE), e.openBrace = this.previous();
|
|
@@ -14574,7 +14583,7 @@ var Hb = class {
|
|
|
14574
14583
|
if (this.check(y.COLON, y.LBRACE, y.LBRACKET)) break;
|
|
14575
14584
|
K(e), this.advance();
|
|
14576
14585
|
}
|
|
14577
|
-
}, this.blockExpression = this.contextStack.withContextDo(
|
|
14586
|
+
}, this.blockExpression = this.contextStack.withContextDo(Wb.BlockExpression, () => {
|
|
14578
14587
|
let e = { body: [] }, t = () => this.nodeFactory.create(W, e);
|
|
14579
14588
|
try {
|
|
14580
14589
|
this.consume("Expect an opening brace '{'", y.LBRACE), e.blockOpenBrace = this.previous();
|
|
@@ -14604,7 +14613,7 @@ var Hb = class {
|
|
|
14604
14613
|
if (this.check(y.RBRACE) || Ha(this.previous(), e)) break;
|
|
14605
14614
|
K(e), this.advance();
|
|
14606
14615
|
}
|
|
14607
|
-
}, this.tupleExpression = this.contextStack.withContextDo(
|
|
14616
|
+
}, this.tupleExpression = this.contextStack.withContextDo(Wb.GroupExpression, () => {
|
|
14608
14617
|
let e = {
|
|
14609
14618
|
elementList: [],
|
|
14610
14619
|
commaList: []
|
|
@@ -14648,7 +14657,7 @@ var Hb = class {
|
|
|
14648
14657
|
if (this.check(y.RPAREN, y.COMMA)) break;
|
|
14649
14658
|
K(e), this.advance();
|
|
14650
14659
|
}
|
|
14651
|
-
}, this.listExpression = this.contextStack.withContextDo(
|
|
14660
|
+
}, this.listExpression = this.contextStack.withContextDo(Wb.ListExpression, () => {
|
|
14652
14661
|
let e = {
|
|
14653
14662
|
elementList: [],
|
|
14654
14663
|
commaList: []
|
|
@@ -14700,7 +14709,7 @@ var Hb = class {
|
|
|
14700
14709
|
if (this.check(y.COMMA, y.RBRACKET)) break;
|
|
14701
14710
|
K(e), this.advance();
|
|
14702
14711
|
}
|
|
14703
|
-
}, this.source = e, this.tokens = t, this.nodeFactory = new
|
|
14712
|
+
}, this.source = e, this.tokens = t, this.nodeFactory = new Kb(n, r), this.filepath = r;
|
|
14704
14713
|
}
|
|
14705
14714
|
isAtEnd() {
|
|
14706
14715
|
return this.current >= this.tokens.length || this.tokens[this.current].kind === y.EOF;
|
|
@@ -14948,7 +14957,7 @@ var Hb = class {
|
|
|
14948
14957
|
for (; !this.isAtEnd();) {
|
|
14949
14958
|
let n = this.peek();
|
|
14950
14959
|
if (n.kind === y.LPAREN) {
|
|
14951
|
-
let { left: r } =
|
|
14960
|
+
let { left: r } = $b(n);
|
|
14952
14961
|
if (r < e || Ha(this.previous(), n) && !this.contextStack.isWithinGroupExpressionContext() && !this.contextStack.isWithinListExpressionContext()) break;
|
|
14953
14962
|
try {
|
|
14954
14963
|
t = this.nodeFactory.create(am, {
|
|
@@ -14975,7 +14984,7 @@ var Hb = class {
|
|
|
14975
14984
|
}), new $(e.token, t, e.handlerContext)) : e;
|
|
14976
14985
|
}
|
|
14977
14986
|
} else if (za(n)) {
|
|
14978
|
-
let r = n, i =
|
|
14987
|
+
let r = n, i = $b(r);
|
|
14979
14988
|
if (i.left !== null) {
|
|
14980
14989
|
if (i.left <= e) break;
|
|
14981
14990
|
this.advance(), t = this.nodeFactory.create(em, {
|
|
@@ -14983,7 +14992,7 @@ var Hb = class {
|
|
|
14983
14992
|
op: r
|
|
14984
14993
|
});
|
|
14985
14994
|
} else {
|
|
14986
|
-
let n =
|
|
14995
|
+
let n = Yb(r);
|
|
14987
14996
|
if (n.left === null || n.left <= e) break;
|
|
14988
14997
|
this.advance();
|
|
14989
14998
|
try {
|
|
@@ -15009,7 +15018,7 @@ var Hb = class {
|
|
|
15009
15018
|
if (za(this.peek())) {
|
|
15010
15019
|
let t = {};
|
|
15011
15020
|
t.op = this.peek();
|
|
15012
|
-
let n =
|
|
15021
|
+
let n = Zb(t.op);
|
|
15013
15022
|
if (n.right === null) throw this.logError(t.op, E.UNKNOWN_PREFIX_OP, `Unexpected '${t.op.value}' in an expression`), new $(t.op, this.nodeFactory.create(um, { prevToken: t.op }), this.contextStack.findHandlerContext(this.tokens, this.current));
|
|
15014
15023
|
this.advance();
|
|
15015
15024
|
try {
|
|
@@ -15081,7 +15090,7 @@ var Hb = class {
|
|
|
15081
15090
|
logError(e, t, n) {
|
|
15082
15091
|
this.errors.push(new D(t, n, e));
|
|
15083
15092
|
}
|
|
15084
|
-
},
|
|
15093
|
+
}, Jb = {
|
|
15085
15094
|
"+": {
|
|
15086
15095
|
left: 9,
|
|
15087
15096
|
right: 10
|
|
@@ -15183,13 +15192,13 @@ var Hb = class {
|
|
|
15183
15192
|
right: 17
|
|
15184
15193
|
}
|
|
15185
15194
|
};
|
|
15186
|
-
function
|
|
15187
|
-
return
|
|
15195
|
+
function Yb(e) {
|
|
15196
|
+
return Jb[e.value] || {
|
|
15188
15197
|
left: null,
|
|
15189
15198
|
right: null
|
|
15190
15199
|
};
|
|
15191
15200
|
}
|
|
15192
|
-
var
|
|
15201
|
+
var Xb = {
|
|
15193
15202
|
"+": {
|
|
15194
15203
|
left: null,
|
|
15195
15204
|
right: 15
|
|
@@ -15267,34 +15276,34 @@ var Yb = {
|
|
|
15267
15276
|
right: 15
|
|
15268
15277
|
}
|
|
15269
15278
|
};
|
|
15270
|
-
function
|
|
15271
|
-
return
|
|
15279
|
+
function Zb(e) {
|
|
15280
|
+
return Xb[e.value] || {
|
|
15272
15281
|
left: null,
|
|
15273
15282
|
right: null
|
|
15274
15283
|
};
|
|
15275
15284
|
}
|
|
15276
|
-
var
|
|
15285
|
+
var Qb = { "(": {
|
|
15277
15286
|
left: 14,
|
|
15278
15287
|
right: null
|
|
15279
15288
|
} };
|
|
15280
|
-
function
|
|
15281
|
-
return
|
|
15289
|
+
function $b(e) {
|
|
15290
|
+
return Qb[e.value] || {
|
|
15282
15291
|
left: null,
|
|
15283
15292
|
right: null
|
|
15284
15293
|
};
|
|
15285
15294
|
}
|
|
15286
15295
|
//#endregion
|
|
15287
15296
|
//#region src/compiler/queries/pipeline/parse.ts
|
|
15288
|
-
function
|
|
15297
|
+
function ex(e) {
|
|
15289
15298
|
let t = this.getSource(e);
|
|
15290
|
-
return new
|
|
15299
|
+
return new Ub(t ?? "", e).lex().chain((n) => new qb(t ?? "", n, this.nodeIdGenerator, e).parse()).map(({ ast: t, tokens: n }) => ({
|
|
15291
15300
|
ast: t,
|
|
15292
15301
|
tokens: n,
|
|
15293
15302
|
path: e
|
|
15294
15303
|
}));
|
|
15295
15304
|
}
|
|
15296
|
-
function
|
|
15297
|
-
let e =
|
|
15305
|
+
function tx() {
|
|
15306
|
+
let e = Lg(this, this.layout.getEntrypoints()), t = /* @__PURE__ */ new Map();
|
|
15298
15307
|
for (let n of e) {
|
|
15299
15308
|
let e = this.parseFile(n);
|
|
15300
15309
|
t.set(n.absolute, e);
|
|
@@ -15303,17 +15312,17 @@ function ex() {
|
|
|
15303
15312
|
}
|
|
15304
15313
|
//#endregion
|
|
15305
15314
|
//#region src/compiler/queries/symbol/lookupMembers.ts
|
|
15306
|
-
function
|
|
15315
|
+
function nx(e) {
|
|
15307
15316
|
let n = this.symbolMembers(e).getFiltered(t), r = /* @__PURE__ */ new Map();
|
|
15308
15317
|
if (n) for (let e of n) {
|
|
15309
|
-
let t = e instanceof Wp ?
|
|
15318
|
+
let t = e instanceof Wp ? dg.visibleName(this, e)?.at(-1) : e.name;
|
|
15310
15319
|
if (t === void 0) continue;
|
|
15311
15320
|
let n = r.get(t);
|
|
15312
15321
|
n || (n = [], r.set(t, n)), n.push(e);
|
|
15313
15322
|
}
|
|
15314
15323
|
return r;
|
|
15315
15324
|
}
|
|
15316
|
-
function
|
|
15325
|
+
function rx(e, n, r) {
|
|
15317
15326
|
let i;
|
|
15318
15327
|
if (e instanceof Tp) i = e;
|
|
15319
15328
|
else {
|
|
@@ -15326,13 +15335,13 @@ function nx(e, n, r) {
|
|
|
15326
15335
|
}
|
|
15327
15336
|
//#endregion
|
|
15328
15337
|
//#region src/compiler/queries/symbol/symbolAliases.ts
|
|
15329
|
-
function
|
|
15338
|
+
function ix(e) {
|
|
15330
15339
|
let t = e.originalSymbol;
|
|
15331
|
-
return
|
|
15340
|
+
return Rg(this).map((n) => n.filter((n) => n instanceof Up && n.originalSymbol === t && n !== e));
|
|
15332
15341
|
}
|
|
15333
15342
|
//#endregion
|
|
15334
15343
|
//#region src/compiler/queries/resolutionIndex.ts
|
|
15335
|
-
function
|
|
15344
|
+
function ax() {
|
|
15336
15345
|
let e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map(), r = this.parseProject();
|
|
15337
15346
|
this.bindProject();
|
|
15338
15347
|
let i = /* @__PURE__ */ new Set(), a = (t, n) => {
|
|
@@ -15395,29 +15404,29 @@ function ix() {
|
|
|
15395
15404
|
parents: s
|
|
15396
15405
|
};
|
|
15397
15406
|
}
|
|
15398
|
-
function
|
|
15407
|
+
function ox(e) {
|
|
15399
15408
|
return this.resolutionIndex().parents.get(e.intern()) ?? [];
|
|
15400
15409
|
}
|
|
15401
|
-
function
|
|
15410
|
+
function sx(e) {
|
|
15402
15411
|
return this.resolutionIndex().references.get(e.intern()) ?? [];
|
|
15403
15412
|
}
|
|
15404
|
-
function
|
|
15413
|
+
function cx(e) {
|
|
15405
15414
|
return this.resolutionIndex().metadata.get(e.intern()) ?? [];
|
|
15406
15415
|
}
|
|
15407
15416
|
//#endregion
|
|
15408
15417
|
//#region src/compiler/queries/symbol/symbolUses.ts
|
|
15409
|
-
function
|
|
15418
|
+
function lx(e) {
|
|
15410
15419
|
let t = e.originalSymbol;
|
|
15411
|
-
return
|
|
15420
|
+
return Rg(this).map((n) => n.filter((n) => n instanceof Wp && n.originalSymbol === t && n !== e));
|
|
15412
15421
|
}
|
|
15413
15422
|
//#endregion
|
|
15414
15423
|
//#region src/compiler/queries/transform/utils.ts
|
|
15415
|
-
function
|
|
15424
|
+
function ux(e) {
|
|
15416
15425
|
if (typeof e != "string") return {
|
|
15417
15426
|
schema: e.schema ?? "public",
|
|
15418
15427
|
table: e.table
|
|
15419
15428
|
};
|
|
15420
|
-
let t =
|
|
15429
|
+
let t = Ig(e);
|
|
15421
15430
|
if (t.length === 0) return {
|
|
15422
15431
|
schema: b,
|
|
15423
15432
|
table: ""
|
|
@@ -15436,25 +15445,25 @@ function lx(e) {
|
|
|
15436
15445
|
table: n
|
|
15437
15446
|
};
|
|
15438
15447
|
}
|
|
15439
|
-
function
|
|
15448
|
+
function dx(e, n, r, i) {
|
|
15440
15449
|
let a = e.parseFile(n).getValue().ast, o = e.nodeSymbol(a).getFiltered(t);
|
|
15441
15450
|
if (!o) return null;
|
|
15442
15451
|
if (r === "public") return e.lookupMembers(o, R.Table, i) ?? null;
|
|
15443
15452
|
let s = e.lookupMembers(o, R.Schema, r);
|
|
15444
15453
|
return s ? e.lookupMembers(s, R.Table, i) ?? null : null;
|
|
15445
15454
|
}
|
|
15446
|
-
function
|
|
15455
|
+
function fx(e) {
|
|
15447
15456
|
return e.startsWith("\"") && e.endsWith("\"") && e.length >= 2 ? e.slice(1, -1) : e;
|
|
15448
15457
|
}
|
|
15449
15458
|
//#endregion
|
|
15450
15459
|
//#region src/compiler/queries/transform/renameTable.ts
|
|
15451
|
-
function
|
|
15460
|
+
function px(e, t) {
|
|
15452
15461
|
if (!e || !(e instanceof V)) return !1;
|
|
15453
15462
|
let n = e.name;
|
|
15454
15463
|
return n ? t.substring(n.start, n.end).includes("\"") : !1;
|
|
15455
15464
|
}
|
|
15456
|
-
function
|
|
15457
|
-
let r = !
|
|
15465
|
+
function mx(e, t, n) {
|
|
15466
|
+
let r = !jg(t), i = !jg(e), a = n || r, o = n || i;
|
|
15458
15467
|
return {
|
|
15459
15468
|
schema: e,
|
|
15460
15469
|
table: t,
|
|
@@ -15464,10 +15473,10 @@ function px(e, t, n) {
|
|
|
15464
15473
|
shouldQuoteTable: a
|
|
15465
15474
|
};
|
|
15466
15475
|
}
|
|
15467
|
-
function
|
|
15468
|
-
return n === i && r === a ? !1 :
|
|
15476
|
+
function hx(e, t, n, r, i, a) {
|
|
15477
|
+
return n === i && r === a ? !1 : dx(e, t, i, a) !== null;
|
|
15469
15478
|
}
|
|
15470
|
-
function
|
|
15479
|
+
function gx(e, t, n) {
|
|
15471
15480
|
let r = e.start - 1;
|
|
15472
15481
|
for (; r >= 0 && /\s/.test(n[r]);) r--;
|
|
15473
15482
|
if (r < 0 || n[r] !== ".") return null;
|
|
@@ -15482,19 +15491,19 @@ function hx(e, t, n) {
|
|
|
15482
15491
|
for (a = r + 1; r >= 0 && /[a-zA-Z0-9_]/.test(n[r]);) r--;
|
|
15483
15492
|
i = r + 1;
|
|
15484
15493
|
}
|
|
15485
|
-
return
|
|
15494
|
+
return fx(n.substring(i, a)) === t ? {
|
|
15486
15495
|
start: i,
|
|
15487
15496
|
end: e.end
|
|
15488
15497
|
} : null;
|
|
15489
15498
|
}
|
|
15490
|
-
function
|
|
15499
|
+
function _x(e) {
|
|
15491
15500
|
return e.schema === "public" ? e.formattedTable : `${e.formattedSchema}.${e.formattedTable}`;
|
|
15492
15501
|
}
|
|
15493
|
-
function
|
|
15494
|
-
let a = [], o = /* @__PURE__ */ new Set(), s =
|
|
15502
|
+
function vx(e, t, n, r, i) {
|
|
15503
|
+
let a = [], o = /* @__PURE__ */ new Set(), s = _x(r);
|
|
15495
15504
|
for (let r of e) {
|
|
15496
|
-
if (
|
|
15497
|
-
let e =
|
|
15505
|
+
if (fx(i.substring(r.start, r.end)) !== n) continue;
|
|
15506
|
+
let e = gx(r, t, i) ?? {
|
|
15498
15507
|
start: r.start,
|
|
15499
15508
|
end: r.end
|
|
15500
15509
|
}, c = `${e.start}-${e.end}`;
|
|
@@ -15506,19 +15515,19 @@ function _x(e, t, n, r, i) {
|
|
|
15506
15515
|
}
|
|
15507
15516
|
return a;
|
|
15508
15517
|
}
|
|
15509
|
-
function
|
|
15510
|
-
let i =
|
|
15511
|
-
if (!u || u instanceof Up ||
|
|
15518
|
+
function yx(e, n, r) {
|
|
15519
|
+
let i = ux(n), a = ux(r), o = i.schema, s = i.table, c = a.schema, l = a.table, u = dx(this, e, o, s);
|
|
15520
|
+
if (!u || u instanceof Up || hx(this, e, o, s, c, l)) return /* @__PURE__ */ new Map();
|
|
15512
15521
|
if (u instanceof Wp && u.useSpecifierDeclaration instanceof Yp && u.useSpecifierDeclaration.alias) {
|
|
15513
15522
|
let n = u.useSpecifierDeclaration;
|
|
15514
|
-
if (this.nodeAlias(n).getFiltered(t) === s) return
|
|
15523
|
+
if (this.nodeAlias(n).getFiltered(t) === s) return bx(this, e, n, u, c, l);
|
|
15515
15524
|
}
|
|
15516
|
-
return
|
|
15525
|
+
return xx(this, u, o, s, c, l);
|
|
15517
15526
|
}
|
|
15518
|
-
function
|
|
15527
|
+
function bx(e, t, n, r, i, a) {
|
|
15519
15528
|
let o = e.getSource(t) ?? "";
|
|
15520
15529
|
if (!n.alias) return /* @__PURE__ */ new Map();
|
|
15521
|
-
let s =
|
|
15530
|
+
let s = mx(i, a, o.substring(n.alias.start, n.alias.end).includes("\"")), c = [];
|
|
15522
15531
|
c.push({
|
|
15523
15532
|
start: n.alias.start,
|
|
15524
15533
|
end: n.alias.end,
|
|
@@ -15530,14 +15539,14 @@ function yx(e, t, n, r, i, a) {
|
|
|
15530
15539
|
end: e.end,
|
|
15531
15540
|
newText: s.formattedTable
|
|
15532
15541
|
});
|
|
15533
|
-
return new Map([[t.absolute,
|
|
15542
|
+
return new Map([[t.absolute, Dh(o, c)]]);
|
|
15534
15543
|
}
|
|
15535
|
-
function
|
|
15544
|
+
function xx(e, t, n, r, i, a) {
|
|
15536
15545
|
let o = t.originalSymbol, s = o.declaration;
|
|
15537
15546
|
if (!s || !(s instanceof V)) return /* @__PURE__ */ new Map();
|
|
15538
15547
|
let c = s.filepath;
|
|
15539
15548
|
if (!c) return /* @__PURE__ */ new Map();
|
|
15540
|
-
let l =
|
|
15549
|
+
let l = mx(i, a, px(s, e.getSource(c) ?? "")), u = /* @__PURE__ */ new Map(), d = (e, t) => {
|
|
15541
15550
|
let n = e.absolute, r = u.get(n);
|
|
15542
15551
|
r || (r = {
|
|
15543
15552
|
fp: e,
|
|
@@ -15547,27 +15556,27 @@ function bx(e, t, n, r, i, a) {
|
|
|
15547
15556
|
f && d(c, {
|
|
15548
15557
|
start: f.start,
|
|
15549
15558
|
end: f.end,
|
|
15550
|
-
newText:
|
|
15559
|
+
newText: _x(l)
|
|
15551
15560
|
});
|
|
15552
15561
|
let p = e.symbolReferences(o);
|
|
15553
15562
|
for (let t of p) {
|
|
15554
15563
|
if (t === f) continue;
|
|
15555
15564
|
let i = t.filepath, a = e.getSource(i) ?? "";
|
|
15556
|
-
for (let e of
|
|
15565
|
+
for (let e of vx([t], n, r, l, a)) d(i, e);
|
|
15557
15566
|
}
|
|
15558
15567
|
let m = /* @__PURE__ */ new Map();
|
|
15559
15568
|
for (let { fp: t, edits: n } of u.values()) {
|
|
15560
15569
|
let r = e.getSource(t) ?? "";
|
|
15561
|
-
m.set(t.absolute,
|
|
15570
|
+
m.set(t.absolute, Dh(r, n));
|
|
15562
15571
|
}
|
|
15563
15572
|
return m;
|
|
15564
15573
|
}
|
|
15565
15574
|
//#endregion
|
|
15566
15575
|
//#region src/compiler/queries/transform/syncDiagramView.ts
|
|
15567
|
-
function
|
|
15568
|
-
let t = [], n = new
|
|
15576
|
+
function Sx(e) {
|
|
15577
|
+
let t = [], n = new Ub(e, wo).lex();
|
|
15569
15578
|
if (n.getErrors().length > 0) return t;
|
|
15570
|
-
let i = new
|
|
15579
|
+
let i = new qb(e, n.getValue(), new Kp(), wo).parse();
|
|
15571
15580
|
if (i.getErrors().length > 0) return t;
|
|
15572
15581
|
let a = i.getValue().ast;
|
|
15573
15582
|
for (let e of a.declarations) if (e.isKind(r.DiagramView)) {
|
|
@@ -15580,66 +15589,66 @@ function xx(e) {
|
|
|
15580
15589
|
}
|
|
15581
15590
|
return t;
|
|
15582
15591
|
}
|
|
15583
|
-
function
|
|
15592
|
+
function Cx(e, t, n) {
|
|
15584
15593
|
e.push(` ${t} {`), n.forEach((t) => e.push(` ${t}`)), e.push(" }");
|
|
15585
15594
|
}
|
|
15586
|
-
function
|
|
15595
|
+
function wx(e, t) {
|
|
15587
15596
|
e.push(` ${t} { * }`);
|
|
15588
15597
|
}
|
|
15589
|
-
function
|
|
15598
|
+
function Tx(e) {
|
|
15590
15599
|
return e == null ? "null" : e.length === 0 ? "empty" : "items";
|
|
15591
15600
|
}
|
|
15592
|
-
function
|
|
15593
|
-
let n = `DiagramView ${
|
|
15594
|
-
let t =
|
|
15595
|
-
return e.schemaName === "public" ? t : `${
|
|
15601
|
+
function Ex(e, t) {
|
|
15602
|
+
let n = `DiagramView ${Mg(e)} {`, r = (e) => Mg(e.name), i = t?.tables?.map((e) => {
|
|
15603
|
+
let t = Mg(e.name);
|
|
15604
|
+
return e.schemaName === "public" ? t : `${Mg(e.schemaName)}.${t}`;
|
|
15596
15605
|
}) ?? [], a = t?.tableGroups?.map(r) ?? [], o = t?.schemas?.map(r) ?? [], s = t?.stickyNotes?.map(r) ?? [];
|
|
15597
15606
|
if (!t) return `${n}\n}`;
|
|
15598
15607
|
let c = {
|
|
15599
|
-
tables:
|
|
15600
|
-
tableGroups:
|
|
15601
|
-
schemas:
|
|
15602
|
-
stickyNotes:
|
|
15608
|
+
tables: Tx(t.tables),
|
|
15609
|
+
tableGroups: Tx(t.tableGroups),
|
|
15610
|
+
schemas: Tx(t.schemas),
|
|
15611
|
+
stickyNotes: Tx(t.stickyNotes)
|
|
15603
15612
|
};
|
|
15604
15613
|
if (Object.values(c).every((e) => e === "null")) return `${n}\n}`;
|
|
15605
15614
|
if (Object.values(c).every((e) => e === "empty")) return `${n}\n *\n}`;
|
|
15606
15615
|
let l = c.tables === "items" || c.tableGroups === "items" || c.schemas === "items", u = c.tables === "empty" && c.tableGroups === "empty" && c.schemas === "empty", d = [n];
|
|
15607
|
-
return l ? (c.tables === "items" &&
|
|
15616
|
+
return l ? (c.tables === "items" && Cx(d, "Tables", i), c.tableGroups === "items" && Cx(d, "TableGroups", a), c.schemas === "items" && Cx(d, "Schemas", o)) : u && wx(d, "Tables"), c.stickyNotes === "items" ? Cx(d, "Notes", s) : c.stickyNotes === "empty" && wx(d, "Notes"), d.push("}"), d.join("\n");
|
|
15608
15617
|
}
|
|
15609
|
-
function
|
|
15610
|
-
let r = this.getSource(e) ?? "", i = n ??
|
|
15618
|
+
function Dx(e, t, n) {
|
|
15619
|
+
let r = this.getSource(e) ?? "", i = n ?? Sx(r), a = [];
|
|
15611
15620
|
for (let e of t) {
|
|
15612
|
-
let t =
|
|
15621
|
+
let t = Ox(r, e, i);
|
|
15613
15622
|
a.push(...t);
|
|
15614
15623
|
}
|
|
15615
15624
|
return a.sort((e, t) => t.start - e.start), {
|
|
15616
|
-
newDbml:
|
|
15625
|
+
newDbml: Dh(r, a, !0),
|
|
15617
15626
|
edits: a
|
|
15618
15627
|
};
|
|
15619
15628
|
}
|
|
15620
|
-
function
|
|
15629
|
+
function Ox(e, t, n) {
|
|
15621
15630
|
switch (t.operation) {
|
|
15622
|
-
case "create": return
|
|
15623
|
-
case "update": return
|
|
15624
|
-
case "delete": return
|
|
15631
|
+
case "create": return kx(e, t, n);
|
|
15632
|
+
case "update": return Ax(e, t, n);
|
|
15633
|
+
case "delete": return jx(e, t, n);
|
|
15625
15634
|
default: return [];
|
|
15626
15635
|
}
|
|
15627
15636
|
}
|
|
15628
|
-
function
|
|
15629
|
-
if (n.find((e) => e.name === t.name)) return
|
|
15630
|
-
let r = "\n\n" +
|
|
15637
|
+
function kx(e, t, n) {
|
|
15638
|
+
if (n.find((e) => e.name === t.name)) return Ax(e, t, n);
|
|
15639
|
+
let r = "\n\n" + Ex(t.name, t.visibleEntities) + "\n";
|
|
15631
15640
|
return [{
|
|
15632
15641
|
start: e.length,
|
|
15633
15642
|
end: e.length,
|
|
15634
15643
|
newText: r
|
|
15635
15644
|
}];
|
|
15636
15645
|
}
|
|
15637
|
-
function
|
|
15646
|
+
function Ax(e, t, n) {
|
|
15638
15647
|
let r = n.find((e) => e.name === t.name);
|
|
15639
15648
|
if (!r) return [];
|
|
15640
15649
|
let i = [];
|
|
15641
15650
|
if (t.newName || t.visibleEntities) {
|
|
15642
|
-
let e =
|
|
15651
|
+
let e = Ex(t.newName || t.name, t.visibleEntities);
|
|
15643
15652
|
i.push({
|
|
15644
15653
|
start: r.startIndex,
|
|
15645
15654
|
end: r.endIndex,
|
|
@@ -15648,7 +15657,7 @@ function kx(e, t, n) {
|
|
|
15648
15657
|
}
|
|
15649
15658
|
return i;
|
|
15650
15659
|
}
|
|
15651
|
-
function
|
|
15660
|
+
function jx(e, t, n) {
|
|
15652
15661
|
let r = n.find((e) => e.name === t.name);
|
|
15653
15662
|
if (!r) return [];
|
|
15654
15663
|
let i = r.startIndex, a = r.endIndex;
|
|
@@ -15668,25 +15677,25 @@ function Ax(e, t, n) {
|
|
|
15668
15677
|
}
|
|
15669
15678
|
//#endregion
|
|
15670
15679
|
//#region src/compiler/index.ts
|
|
15671
|
-
var
|
|
15680
|
+
var Mx = Symbol("COMPUTING"), Nx = class {
|
|
15672
15681
|
constructor(e) {
|
|
15673
|
-
this.layout = e, this.nodeIdGenerator = new Kp(), this.symbolIdGenerator = new wp(), this.symbolFactory = new Qa(this.symbolIdGenerator), this.sourceSnapshot = /* @__PURE__ */ new Map(), this.globalCache = /* @__PURE__ */ new Map(), this.globallyQuerying = !1, this.localCache = /* @__PURE__ */ new Map(), this.parseFile = this.localQuery(
|
|
15674
|
-
invalidStream: this.localQuery(
|
|
15675
|
-
flatStream: this.localQuery(
|
|
15682
|
+
this.layout = e, this.nodeIdGenerator = new Kp(), this.symbolIdGenerator = new wp(), this.symbolFactory = new Qa(this.symbolIdGenerator), this.sourceSnapshot = /* @__PURE__ */ new Map(), this.globalCache = /* @__PURE__ */ new Map(), this.globallyQuerying = !1, this.localCache = /* @__PURE__ */ new Map(), this.parseFile = this.localQuery(ex), this.parseProject = this.globalQuery(tx), this.validateNode = this.localQuery(ev), this.validateFile = this.localQuery(Hb), this.nodeFullname = this.localQuery(nv), this.nodeAlias = this.localQuery(rv), this.nodeSettings = this.localQuery(tv), this.canonicalName = this.globalQuery(Cb), this.bindNode = this.globalQuery(p_), this.bindFile = this.globalQuery(Rb), this.bindProject = this.globalQuery(zb), this.interpretSymbol = this.globalQuery(h_), this.interpretMetadata = this.globalQuery(g_), this.interpretFile = this.globalQuery(Bb), this.interpretProject = this.globalQuery(Vb), this.nodeSymbol = this.globalQuery(u_), this.nodeMetadata = this.globalQuery(m_), this.symbolMembers = this.globalQuery(d_), this.symbolMembersLookupMap = this.globalQuery(nx), this.lookupMembers = this.globalQuery(rx), this.nodeReferee = this.globalQuery(f_), this.resolutionIndex = this.globalQuery(ax), this.symbolReferences = this.globalQuery(sx), this.symbolParent = this.globalQuery(ox), this.symbolMetadata = this.globalQuery(cx), this.symbolAliases = this.globalQuery(ix), this.symbolUses = this.globalQuery(lx), this.fileDependencies = this.localQuery(Eb), this.reachableFiles = this.globalQuery(Ob), this.usableMembers = this.globalQuery(mg), this.nodeAtPosition = this.localQuery(Lb), this.renameTable = yx.bind(this), this.syncDiagramView = Dx.bind(this), this.addSetting = kh.bind(this), this.updateSetting = Nh.bind(this), this.removeSetting = Ph.bind(this), this.token = {
|
|
15683
|
+
invalidStream: this.localQuery(Ib),
|
|
15684
|
+
flatStream: this.localQuery(Fb)
|
|
15676
15685
|
}, this.parse = {
|
|
15677
15686
|
source: (e) => this.getSource(e) || "",
|
|
15678
|
-
ast: (e = wo) =>
|
|
15679
|
-
errors: (e = wo) =>
|
|
15680
|
-
warnings: (e = wo) =>
|
|
15681
|
-
tokens: (e = wo) =>
|
|
15682
|
-
rawDb: (e = wo) =>
|
|
15683
|
-
publicSymbolTable: (e = wo) =>
|
|
15687
|
+
ast: (e = wo) => kb.call(this, e),
|
|
15688
|
+
errors: (e = wo) => Ab.call(this, e),
|
|
15689
|
+
warnings: (e = wo) => jb.call(this, e),
|
|
15690
|
+
tokens: (e = wo) => Mb.call(this, e),
|
|
15691
|
+
rawDb: (e = wo) => Nb.call(this, e),
|
|
15692
|
+
publicSymbolTable: (e = wo) => Pb.call(this, e)
|
|
15684
15693
|
}, this.container = {
|
|
15685
|
-
stack: this.localQuery(
|
|
15686
|
-
token: this.localQuery(
|
|
15687
|
-
element: this.localQuery(
|
|
15688
|
-
scope: this.localQuery(
|
|
15689
|
-
scopeKind: this.localQuery(
|
|
15694
|
+
stack: this.localQuery(vb),
|
|
15695
|
+
token: this.localQuery(yb),
|
|
15696
|
+
element: this.localQuery(bb),
|
|
15697
|
+
scope: this.localQuery(xb),
|
|
15698
|
+
scopeKind: this.localQuery(Sb)
|
|
15690
15699
|
};
|
|
15691
15700
|
}
|
|
15692
15701
|
getSource(e) {
|
|
@@ -15699,7 +15708,7 @@ var jx = Symbol("COMPUTING"), Mx = class {
|
|
|
15699
15708
|
cleanStaleGlobalCache() {
|
|
15700
15709
|
let e = this.layout.getEntrypoints(), t = !1;
|
|
15701
15710
|
this.entrypointsSnapshot !== void 0 && (this.entrypointsSnapshot.length !== e.length || this.entrypointsSnapshot.some((t, n) => t.absolute !== e[n].absolute)) && (t = !0), this.entrypointsSnapshot = e;
|
|
15702
|
-
for (let t of
|
|
15711
|
+
for (let t of Db(this, e)) this.cleanStaleLocalCache(t);
|
|
15703
15712
|
t && this.globalCache.clear();
|
|
15704
15713
|
}
|
|
15705
15714
|
globalQuery(e) {
|
|
@@ -15712,10 +15721,10 @@ var jx = Symbol("COMPUTING"), Mx = class {
|
|
|
15712
15721
|
r || (r = /* @__PURE__ */ new Map(), this.globalCache.set(t, r));
|
|
15713
15722
|
let i = n.length === 0 ? "" : n.length === 1 ? Lm(n[0]) : n.map((e) => Lm(e)).join("\0"), a = r.get(i);
|
|
15714
15723
|
if (a) {
|
|
15715
|
-
if (a ===
|
|
15724
|
+
if (a === Mx) throw Error(`Cycle detected in query: ${e.name}(${i})`);
|
|
15716
15725
|
return a;
|
|
15717
15726
|
}
|
|
15718
|
-
r.set(i,
|
|
15727
|
+
r.set(i, Mx);
|
|
15719
15728
|
try {
|
|
15720
15729
|
let t = e.apply(this, n);
|
|
15721
15730
|
return r.set(i, t), t;
|
|
@@ -15737,10 +15746,10 @@ var jx = Symbol("COMPUTING"), Mx = class {
|
|
|
15737
15746
|
let c = s.get(t);
|
|
15738
15747
|
if (c || (c = /* @__PURE__ */ new Map(), s.set(t, c)), c.has(o)) {
|
|
15739
15748
|
let t = c.get(o);
|
|
15740
|
-
if (t ===
|
|
15749
|
+
if (t === Mx) throw Error(`Cycle detected in query: ${e.name}(${a}, ${o})`);
|
|
15741
15750
|
return t;
|
|
15742
15751
|
}
|
|
15743
|
-
c.set(o,
|
|
15752
|
+
c.set(o, Mx);
|
|
15744
15753
|
try {
|
|
15745
15754
|
let t = e.apply(this, n);
|
|
15746
15755
|
return c.set(o, t), t;
|
|
@@ -15750,19 +15759,19 @@ var jx = Symbol("COMPUTING"), Mx = class {
|
|
|
15750
15759
|
});
|
|
15751
15760
|
}
|
|
15752
15761
|
findDiagramViewBlocks(e) {
|
|
15753
|
-
return
|
|
15762
|
+
return Sx(this.getSource(e) ?? "");
|
|
15754
15763
|
}
|
|
15755
15764
|
initMonacoServices(e) {
|
|
15756
15765
|
let t = e?.autocompletion?.triggerCharacters ?? [];
|
|
15757
15766
|
return {
|
|
15758
|
-
definitionProvider: new
|
|
15759
|
-
referenceProvider: new
|
|
15760
|
-
autocompletionProvider: new
|
|
15761
|
-
diagnosticsProvider: new
|
|
15762
|
-
codeActionProvider: new
|
|
15767
|
+
definitionProvider: new py(this),
|
|
15768
|
+
referenceProvider: new hy(this),
|
|
15769
|
+
autocompletionProvider: new Hy(this, { triggerCharacters: t }),
|
|
15770
|
+
diagnosticsProvider: new my(this),
|
|
15771
|
+
codeActionProvider: new fy(this)
|
|
15763
15772
|
};
|
|
15764
15773
|
}
|
|
15765
|
-
},
|
|
15774
|
+
}, Px = class e {
|
|
15766
15775
|
constructor(e = {}) {
|
|
15767
15776
|
this.files = e instanceof Map ? new Map(e) : new Map(Object.entries(e));
|
|
15768
15777
|
}
|
|
@@ -15806,4 +15815,4 @@ var jx = Symbol("COMPUTING"), Mx = class {
|
|
|
15806
15815
|
}
|
|
15807
15816
|
};
|
|
15808
15817
|
//#endregion
|
|
15809
|
-
export { dm as ArrayNode, H as AttributeNode, W as BlockExpressionNode, af as CARDINALITY_MANY, nf as CARDINALITY_MAYBE, tf as CARDINALITY_ONE, rf as CARDINALITY_SOME, am as CallExpressionNode, rm as CommaExpressionNode, D as CompileError, E as CompileErrorCode,
|
|
15818
|
+
export { dm as ArrayNode, H as AttributeNode, W as BlockExpressionNode, af as CARDINALITY_MANY, nf as CARDINALITY_MAYBE, tf as CARDINALITY_ONE, rf as CARDINALITY_SOME, am as CallExpressionNode, rm as CommaExpressionNode, D as CompileError, E as CompileErrorCode, Nx as Compiler, X as CompletionItemInsertTextRule, Y as CompletionItemKind, fy as DBMLCodeActionProvider, Hy as DBMLCompletionItemProvider, py as DBMLDefinitionProvider, my as DBMLDiagnosticsProvider, hy as DBMLReferencesProvider, wo as DEFAULT_ENTRY, V as ElementDeclarationNode, r as ElementKind, um as EmptyNode, cp as FALSY_VALUES, vo as Filepath, U as FunctionApplicationNode, tm as FunctionExpressionNode, im as GroupExpressionNode, Zp as IdentifierStreamNode, $p as InfixExpressionNode, G as ListExpressionNode, om as LiteralNode, ly as MarkerSeverity, Px as MemoryProjectLayout, em as PostfixExpressionNode, Qp as PrefixExpressionNode, lm as PrimaryExpressionNode, B as ProgramNode, Q as ScopeKind, R as SymbolKind, z as SyntaxNode, Kp as SyntaxNodeIdGenerator, qp as SyntaxNodeKind, Ba as SyntaxToken, y as SyntaxTokenKind, sp as TRUTHY_VALUES, nm as TupleExpressionNode, t as UNHANDLED, Qv as Uri, Jp as UseDeclarationNode, Xp as UseSpecifierListNode, Yp as UseSpecifierNode, cm as VariableNode, sm as WildcardNode, Mg as addDoubleQuoteIfNeeded, gb as dbmlLanguageConfig, _b as dbmlMonarchTokensProvider, Pg as escapeString, Qf as extractNumericLiteral, ip as extractSignedNumber, Fg as formatRecordValue, of as getMultiplicities, Vo as getRecordValueType, sf as getRelationshipOp, zm as inferMultiplicitiesFromColumns, Ro as isBinaryType, Io as isBooleanType, zo as isDateTimeType, np as isEmptyStringLiteral, Po as isFloatType, rp as isFunctionExpression, No as isIntegerType, tp as isNullish, Fo as isNumericType, Ra as isOp, za as isOpToken, Bo as isSerialType, Lo as isStringType, La as isTriviaToken, jg as isValidIdentifier, Mo as normalizeTypeName, $d as parseCardinality, Ig as splitQualifiedIdentifier, lp as tryExtractBoolean, hp as tryExtractDateTime, up as tryExtractEnum, op as tryExtractInteger, ap as tryExtractNumeric, dp as tryExtractString, Ng as unescapeString, wh as validateForeignKeys, mh as validatePrimaryKey, bh as validateUnique };
|