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