@likec4/language-server 1.12.1 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.cjs +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.mts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/model-graph/index.cjs +1 -1
- package/dist/model-graph/index.d.cts +1 -1
- package/dist/model-graph/index.d.mts +1 -1
- package/dist/model-graph/index.d.ts +1 -1
- package/dist/model-graph/index.mjs +1 -1
- package/dist/shared/{language-server.CzkWpuWT.d.mts → language-server.B-9_mDoo.d.mts} +7 -2
- package/dist/shared/{language-server.BH0brgLf.cjs → language-server.C2ebP2pZ.cjs} +80 -90
- package/dist/shared/{language-server.DJAHXekh.d.cts → language-server.C3oS5yhF.d.cts} +7 -2
- package/dist/shared/{language-server.3Bh0zvVS.cjs → language-server.CbDa016p.cjs} +9 -7
- package/dist/shared/{language-server.DtLmc4Fz.d.cts → language-server.Cnq_hgfm.d.cts} +6 -1
- package/dist/shared/{language-server.BYjS7OIz.mjs → language-server.CrE0nFSB.mjs} +79 -89
- package/dist/shared/{language-server.BxxqS4Id.mjs → language-server.DFLaUdYu.mjs} +7 -6
- package/dist/shared/{language-server.BCDM5gt9.d.ts → language-server.eY70DuKx.d.ts} +6 -1
- package/dist/shared/{language-server.B8Ce0R_D.d.ts → language-server.r5AXAWzc.d.ts} +7 -2
- package/dist/shared/{language-server.BN7V1vQA.d.mts → language-server.ryB8CivX.d.mts} +6 -1
- package/package.json +7 -7
- package/src/ast.ts +1 -1
- package/src/generated/ast.ts +3 -1
- package/src/generated/grammar.ts +1 -1
- package/src/like-c4.langium +4 -2
- package/src/lsp/CompletionProvider.ts +2 -2
- package/src/model/model-parser.ts +78 -69
- package/src/model-change/ModelChanges.ts +0 -28
- package/src/model-change/changeViewLayout.ts +5 -5
- package/src/model-graph/compute-view/compute.ts +1 -1
- package/src/model-graph/dynamic-view/compute.ts +1 -1
- package/src/model-graph/utils/sortNodes.ts +3 -3
- package/src/test/testServices.ts +9 -5
- package/src/utils/graphlib.ts +5 -7
- package/src/validation/_shared.ts +2 -1
- package/src/validation/index.ts +0 -2
- package/src/validation/specification.ts +0 -11
- package/src/view-utils/resolve-extended-views.ts +2 -2
|
@@ -448,6 +448,7 @@ interface ModelViews extends AstNode {
|
|
|
448
448
|
readonly $container: LikeC4Grammar;
|
|
449
449
|
readonly $type: 'ModelViews';
|
|
450
450
|
name: 'views';
|
|
451
|
+
styles: Array<ViewRuleStyle>;
|
|
451
452
|
views: Array<LikeC4View>;
|
|
452
453
|
}
|
|
453
454
|
declare const ModelViews = "ModelViews";
|
|
@@ -650,7 +651,7 @@ interface ViewRuleAutoLayout extends AstNode {
|
|
|
650
651
|
}
|
|
651
652
|
declare const ViewRuleAutoLayout = "ViewRuleAutoLayout";
|
|
652
653
|
interface ViewRuleStyle extends AstNode {
|
|
653
|
-
readonly $container: DynamicViewBody | ElementViewBody;
|
|
654
|
+
readonly $container: DynamicViewBody | ElementViewBody | ModelViews;
|
|
654
655
|
readonly $type: 'ViewRuleStyle';
|
|
655
656
|
props: Array<NotationProperty | StyleProperty>;
|
|
656
657
|
target: ElementExpressionsIterator;
|
|
@@ -955,7 +956,7 @@ interface ParsedLikeC4LangiumDocument extends Omit<LangiumDocument<LikeC4Grammar
|
|
|
955
956
|
}
|
|
956
957
|
type Guard<N extends AstNode> = (n: AstNode) => n is N;
|
|
957
958
|
type Guarded<G> = G extends Guard<infer N> ? N : never;
|
|
958
|
-
declare const isValidatableAstNode: (n: AstNode) => n is Guarded<typeof isRelation | typeof
|
|
959
|
+
declare const isValidatableAstNode: (n: AstNode) => n is Guarded<typeof isRelation | typeof isLikeC4View | typeof isExtendElement | typeof isElement | typeof isDynamicViewPredicateIterator | typeof isElementPredicateWith | typeof isRelationPredicateWith | typeof isElementExpression | typeof isRelationExpression | typeof isDynamicViewParallelSteps | typeof isDynamicViewStep | typeof isViewProperty | typeof isStyleProperty | typeof isTags | typeof isViewRule | typeof isDynamicViewRule | typeof isElementViewBody | typeof isDynamicViewBody | typeof isRelationProperty | typeof isRelationBody | typeof isElementProperty | typeof isElementBody | typeof isExtendElementBody | typeof isSpecificationElementKind | typeof isSpecificationRelationshipKind | typeof isSpecificationTag | typeof isSpecificationColor | typeof isSpecificationRule | typeof isModelViews | typeof isModel>;
|
|
959
960
|
type ValidatableAstNode = Guarded<typeof isValidatableAstNode>;
|
|
960
961
|
declare function checksFromDiagnostics(doc: LikeC4LangiumDocument): {
|
|
961
962
|
isValid: (n: ValidatableAstNode) => boolean;
|
|
@@ -1087,11 +1088,15 @@ declare class LikeC4ModelParser {
|
|
|
1087
1088
|
private parseRelationPredicateWith;
|
|
1088
1089
|
private parseRelationExpr;
|
|
1089
1090
|
private parseViewRule;
|
|
1091
|
+
private parseViewRuleStyle;
|
|
1092
|
+
private parseRuleStyle;
|
|
1090
1093
|
private parseViewManualLaout;
|
|
1091
1094
|
private parseDynamicParallelSteps;
|
|
1092
1095
|
private parseDynamicStep;
|
|
1093
1096
|
private parseElementView;
|
|
1094
1097
|
private parseDynamicElementView;
|
|
1098
|
+
private parseDynamicViewRule;
|
|
1099
|
+
private parseDynamicViewIncludePredicate;
|
|
1095
1100
|
protected resolveFqn(node: Element | ExtendElement): c4.Fqn;
|
|
1096
1101
|
private getAstNodePath;
|
|
1097
1102
|
private getMetadata;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const core = require('@likec4/core');
|
|
4
4
|
const remeda = require('remeda');
|
|
5
|
-
const
|
|
5
|
+
const dagre = require('@dagrejs/dagre');
|
|
6
6
|
const objectHash = require('object-hash');
|
|
7
7
|
|
|
8
8
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
|
|
9
9
|
|
|
10
|
-
const
|
|
10
|
+
const dagre__default = /*#__PURE__*/_interopDefaultCompat(dagre);
|
|
11
11
|
const objectHash__default = /*#__PURE__*/_interopDefaultCompat(objectHash);
|
|
12
12
|
|
|
13
13
|
function calcViewLayoutHash(view) {
|
|
@@ -305,9 +305,10 @@ function buildElementNotations(nodes) {
|
|
|
305
305
|
);
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
const
|
|
308
|
+
const Graph = dagre__default.graphlib.Graph;
|
|
309
|
+
const postorder = dagre__default.graphlib.alg.postorder;
|
|
310
|
+
const findCycles = dagre__default.graphlib.alg.findCycles;
|
|
311
|
+
const isAcyclic = dagre__default.graphlib.alg.isAcyclic;
|
|
311
312
|
|
|
312
313
|
function sortChildren(nodes) {
|
|
313
314
|
nodes.forEach((parent) => {
|
|
@@ -323,7 +324,7 @@ function sortNodes({
|
|
|
323
324
|
if (edges.length === 0) {
|
|
324
325
|
return nodes;
|
|
325
326
|
}
|
|
326
|
-
const g = new
|
|
327
|
+
const g = new Graph({
|
|
327
328
|
compound: false,
|
|
328
329
|
directed: true,
|
|
329
330
|
multigraph: false
|
|
@@ -340,7 +341,7 @@ function sortNodes({
|
|
|
340
341
|
g.setEdge(e.source, e.target);
|
|
341
342
|
}
|
|
342
343
|
for (const n of nodes) {
|
|
343
|
-
g.setNode(n.id);
|
|
344
|
+
g.setNode(n.id, n.id);
|
|
344
345
|
if (n.children.length > 0) {
|
|
345
346
|
n.inEdges.forEach((e) => {
|
|
346
347
|
const edge = getEdge(e);
|
|
@@ -1682,6 +1683,7 @@ class LikeC4ModelGraph {
|
|
|
1682
1683
|
}
|
|
1683
1684
|
}
|
|
1684
1685
|
|
|
1686
|
+
exports.Graph = Graph;
|
|
1685
1687
|
exports.LikeC4ModelGraph = LikeC4ModelGraph;
|
|
1686
1688
|
exports.computeDynamicView = computeDynamicView;
|
|
1687
1689
|
exports.computeElementView = computeElementView;
|
|
@@ -448,6 +448,7 @@ interface ModelViews extends AstNode {
|
|
|
448
448
|
readonly $container: LikeC4Grammar;
|
|
449
449
|
readonly $type: 'ModelViews';
|
|
450
450
|
name: 'views';
|
|
451
|
+
styles: Array<ViewRuleStyle>;
|
|
451
452
|
views: Array<LikeC4View>;
|
|
452
453
|
}
|
|
453
454
|
declare const ModelViews = "ModelViews";
|
|
@@ -650,7 +651,7 @@ interface ViewRuleAutoLayout extends AstNode {
|
|
|
650
651
|
}
|
|
651
652
|
declare const ViewRuleAutoLayout = "ViewRuleAutoLayout";
|
|
652
653
|
interface ViewRuleStyle extends AstNode {
|
|
653
|
-
readonly $container: DynamicViewBody | ElementViewBody;
|
|
654
|
+
readonly $container: DynamicViewBody | ElementViewBody | ModelViews;
|
|
654
655
|
readonly $type: 'ViewRuleStyle';
|
|
655
656
|
props: Array<NotationProperty | StyleProperty>;
|
|
656
657
|
target: ElementExpressionsIterator;
|
|
@@ -1087,11 +1088,15 @@ declare class LikeC4ModelParser {
|
|
|
1087
1088
|
private parseRelationPredicateWith;
|
|
1088
1089
|
private parseRelationExpr;
|
|
1089
1090
|
private parseViewRule;
|
|
1091
|
+
private parseViewRuleStyle;
|
|
1092
|
+
private parseRuleStyle;
|
|
1090
1093
|
private parseViewManualLaout;
|
|
1091
1094
|
private parseDynamicParallelSteps;
|
|
1092
1095
|
private parseDynamicStep;
|
|
1093
1096
|
private parseElementView;
|
|
1094
1097
|
private parseDynamicElementView;
|
|
1098
|
+
private parseDynamicViewRule;
|
|
1099
|
+
private parseDynamicViewIncludePredicate;
|
|
1095
1100
|
protected resolveFqn(node: Element | ExtendElement): c4.Fqn;
|
|
1096
1101
|
private getAstNodePath;
|
|
1097
1102
|
private getMetadata;
|