@likec4/language-server 1.19.0 → 1.19.2
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/Rpc.js +6 -0
- package/dist/browser.d.ts +1 -0
- package/dist/documentation/documentation-provider.d.ts +8 -0
- package/dist/documentation/documentation-provider.js +46 -0
- package/dist/documentation/index.d.ts +1 -0
- package/dist/documentation/index.js +1 -0
- package/dist/generated/ast.d.ts +22 -9
- package/dist/generated/ast.js +23 -2
- package/dist/generated/grammar.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -2
- package/dist/like-c4.langium +4 -1
- package/dist/lsp/DocumentSymbolProvider.d.ts +11 -2
- package/dist/lsp/DocumentSymbolProvider.js +78 -6
- package/dist/model/fqn-computation.js +2 -2
- package/dist/model/model-builder.js +3 -3
- package/dist/model/model-parser.d.ts +5 -0
- package/dist/model/parser/DeploymentModelParser.d.ts +1 -0
- package/dist/model/parser/DeploymentViewParser.d.ts +2 -1
- package/dist/model/parser/DeploymentViewParser.js +3 -0
- package/dist/model/parser/FqnRefParser.d.ts +1 -0
- package/dist/model/parser/FqnRefParser.js +13 -0
- package/dist/model/parser/GlobalsParser.d.ts +1 -0
- package/dist/model/parser/ViewsParser.d.ts +1 -0
- package/dist/module.d.ts +9 -1
- package/dist/module.js +47 -8
- package/dist/protocol.d.ts +19 -1
- package/dist/protocol.js +1 -0
- package/dist/references/scope-computation.d.ts +2 -2
- package/dist/references/scope-computation.js +9 -9
- package/dist/validation/dynamic-view-rule.js +3 -2
- package/dist/validation/dynamic-view-step.js +23 -27
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/property-checks.js +3 -2
- package/dist/validation/specification.js +14 -14
- package/dist/validation/view-predicates/element-with.js +3 -2
- package/dist/validation/view-predicates/expanded-element.js +3 -2
- package/dist/validation/view-predicates/incoming.js +3 -2
- package/dist/validation/view-predicates/outgoing.js +3 -2
- package/dist/validation/view-predicates/relation-with.js +3 -2
- package/dist/validation/view.js +3 -3
- package/dist/views/configurable-layouter.d.ts +7 -0
- package/dist/views/configurable-layouter.js +55 -0
- package/dist/views/index.d.ts +1 -0
- package/dist/views/index.js +1 -0
- package/dist/views/likec4-views.d.ts +26 -0
- package/dist/views/likec4-views.js +113 -0
- package/package.json +14 -11
- package/src/Rpc.ts +13 -7
- package/src/browser.ts +1 -0
- package/src/documentation/documentation-provider.ts +52 -0
- package/src/documentation/index.ts +1 -0
- package/src/generated/ast.ts +47 -11
- package/src/generated/grammar.ts +1 -1
- package/src/index.ts +4 -2
- package/src/like-c4.langium +4 -1
- package/src/lsp/DocumentSymbolProvider.ts +110 -28
- package/src/model/fqn-computation.ts +8 -8
- package/src/model/model-builder.ts +52 -52
- package/src/model/parser/DeploymentViewParser.ts +10 -7
- package/src/model/parser/FqnRefParser.ts +14 -0
- package/src/module.ts +56 -9
- package/src/protocol.ts +29 -4
- package/src/references/scope-computation.ts +35 -35
- package/src/validation/dynamic-view-rule.ts +5 -4
- package/src/validation/dynamic-view-step.ts +23 -26
- package/src/validation/property-checks.ts +11 -10
- package/src/validation/specification.ts +38 -38
- package/src/validation/view-predicates/element-with.ts +6 -5
- package/src/validation/view-predicates/expanded-element.ts +6 -5
- package/src/validation/view-predicates/incoming.ts +6 -5
- package/src/validation/view-predicates/outgoing.ts +6 -5
- package/src/validation/view-predicates/relation-with.ts +6 -5
- package/src/validation/view.ts +5 -5
- package/src/views/configurable-layouter.ts +65 -0
- package/src/views/index.ts +1 -0
- package/src/views/likec4-views.ts +139 -0
package/src/Rpc.ts
CHANGED
|
@@ -12,8 +12,9 @@ import {
|
|
|
12
12
|
computeView,
|
|
13
13
|
fetchComputedModel,
|
|
14
14
|
fetchModel,
|
|
15
|
+
layoutView,
|
|
15
16
|
locate,
|
|
16
|
-
onDidChangeModel
|
|
17
|
+
onDidChangeModel,
|
|
17
18
|
} from './protocol'
|
|
18
19
|
|
|
19
20
|
export class Rpc implements Disposable {
|
|
@@ -25,6 +26,7 @@ export class Rpc implements Disposable {
|
|
|
25
26
|
const modelBuilder = this.services.likec4.ModelBuilder
|
|
26
27
|
const modelLocator = this.services.likec4.ModelLocator
|
|
27
28
|
const modelEditor = this.services.likec4.ModelChanges
|
|
29
|
+
const views = this.services.likec4.Views
|
|
28
30
|
const connection = this.services.shared.lsp.Connection
|
|
29
31
|
if (!connection) {
|
|
30
32
|
logger.info(`[ServerRpc] no connection, not initializing`)
|
|
@@ -44,8 +46,8 @@ export class Rpc implements Disposable {
|
|
|
44
46
|
{
|
|
45
47
|
timing: 'trailing',
|
|
46
48
|
waitMs: 300,
|
|
47
|
-
maxWaitMs: 1000
|
|
48
|
-
}
|
|
49
|
+
maxWaitMs: 1000,
|
|
50
|
+
},
|
|
49
51
|
)
|
|
50
52
|
|
|
51
53
|
let isFirstBuild = true
|
|
@@ -70,6 +72,10 @@ export class Rpc implements Disposable {
|
|
|
70
72
|
const view = await modelBuilder.computeView(viewId, cancelToken)
|
|
71
73
|
return { view }
|
|
72
74
|
}),
|
|
75
|
+
connection.onRequest(layoutView, async ({ viewId }, cancelToken) => {
|
|
76
|
+
const result = await views.layoutView(viewId, cancelToken)
|
|
77
|
+
return { result }
|
|
78
|
+
}),
|
|
73
79
|
connection.onRequest(buildDocuments, async ({ docs }, cancelToken) => {
|
|
74
80
|
const changed = docs.map(d => URI.parse(d))
|
|
75
81
|
const notChanged = (uri: URI) => changed.every(c => !UriUtils.equals(c, uri))
|
|
@@ -80,7 +86,7 @@ export class Rpc implements Disposable {
|
|
|
80
86
|
logger.debug(
|
|
81
87
|
`[ServerRpc] received request to build:
|
|
82
88
|
changed (total ${changed.length}):${docs.map(d => '\n - ' + d).join('')}
|
|
83
|
-
deleted (total ${deleted.length}):${deleted.map(d => '\n - ' + d.toString()).join('\n')}
|
|
89
|
+
deleted (total ${deleted.length}):${deleted.map(d => '\n - ' + d.toString()).join('\n')}`,
|
|
84
90
|
)
|
|
85
91
|
|
|
86
92
|
if (!isFirstBuild && (changed.length + deleted.length) > 0) {
|
|
@@ -91,13 +97,13 @@ export class Rpc implements Disposable {
|
|
|
91
97
|
try {
|
|
92
98
|
await connection.sendDiagnostics({
|
|
93
99
|
uri,
|
|
94
|
-
diagnostics: []
|
|
100
|
+
diagnostics: [],
|
|
95
101
|
})
|
|
96
102
|
} catch (e) {
|
|
97
103
|
// Ignore
|
|
98
104
|
logger.warn(`error clearing diagnostics for ${uri}: ${e}`)
|
|
99
105
|
}
|
|
100
|
-
})
|
|
106
|
+
}),
|
|
101
107
|
)
|
|
102
108
|
await interruptAndCheck(cancelToken)
|
|
103
109
|
}
|
|
@@ -121,7 +127,7 @@ export class Rpc implements Disposable {
|
|
|
121
127
|
}),
|
|
122
128
|
connection.onRequest(changeView, async (request, _cancelToken) => {
|
|
123
129
|
return await modelEditor.applyChange(request)
|
|
124
|
-
})
|
|
130
|
+
}),
|
|
125
131
|
)
|
|
126
132
|
}
|
|
127
133
|
|
package/src/browser.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type { DocumentParser, LikeC4ModelBuilder, LikeC4ModelLocator, LikeC4Mode
|
|
|
7
7
|
|
|
8
8
|
export { createCustomLanguageServices, createLanguageServices, LikeC4Module } from './module'
|
|
9
9
|
export type { LikeC4Services, LikeC4SharedServices } from './module'
|
|
10
|
+
export type { LikeC4Views } from './views'
|
|
10
11
|
|
|
11
12
|
// This is an example copied as is from here:
|
|
12
13
|
// https://github.com/microsoft/vscode-extension-samples/blob/main/lsp-web-extension-sample/server/src/browserServerMain.ts
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type AstNode, type DocumentationProvider, AstUtils } from 'langium'
|
|
2
|
+
import { ast } from '../ast'
|
|
3
|
+
import { logWarnError } from '../logger'
|
|
4
|
+
import type { LikeC4ModelLocator, LikeC4ModelParser } from '../model'
|
|
5
|
+
import type { LikeC4Services } from '../module'
|
|
6
|
+
|
|
7
|
+
export class LikeC4DocumentationProvider implements DocumentationProvider {
|
|
8
|
+
private parser: LikeC4ModelParser
|
|
9
|
+
private locator: LikeC4ModelLocator
|
|
10
|
+
|
|
11
|
+
constructor(services: LikeC4Services) {
|
|
12
|
+
this.parser = services.likec4.ModelParser
|
|
13
|
+
this.locator = services.likec4.ModelLocator
|
|
14
|
+
}
|
|
15
|
+
getDocumentation(node: AstNode): string | undefined {
|
|
16
|
+
try {
|
|
17
|
+
if (ast.isDeploymentNode(node)) {
|
|
18
|
+
const doc = AstUtils.getDocument(node)
|
|
19
|
+
const el = this.parser.forDocument(doc).parseDeploymentNode(node)
|
|
20
|
+
const lines = [el.id as string]
|
|
21
|
+
if (el.title !== node.name) {
|
|
22
|
+
lines.push(' ', `**${el.title}**`)
|
|
23
|
+
}
|
|
24
|
+
return lines.join(' \n')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (ast.isDeployedInstance(node)) {
|
|
28
|
+
const doc = AstUtils.getDocument(node)
|
|
29
|
+
const instance = this.parser.forDocument(doc).parseDeployedInstance(node)
|
|
30
|
+
const el = this.locator.getParsedElement(instance.element)
|
|
31
|
+
const lines = [instance.id, `_instance of_ ${instance.element}`]
|
|
32
|
+
if (el) {
|
|
33
|
+
lines.push(' ', `**${el.title}**`)
|
|
34
|
+
}
|
|
35
|
+
return lines.join(' \n')
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (ast.isElement(node)) {
|
|
39
|
+
const doc = AstUtils.getDocument(node)
|
|
40
|
+
const el = this.parser.forDocument(doc).parseElement(node)
|
|
41
|
+
if (!el) {
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
const lines = [el.id, ' ', `**${el.title}**`]
|
|
45
|
+
return lines.join(' \n')
|
|
46
|
+
}
|
|
47
|
+
} catch (e) {
|
|
48
|
+
logWarnError(e)
|
|
49
|
+
}
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LikeC4DocumentationProvider } from './documentation-provider'
|
package/src/generated/ast.ts
CHANGED
|
@@ -230,7 +230,7 @@ export function isElementShape(item: unknown): item is ElementShape {
|
|
|
230
230
|
return item === 'rectangle' || item === 'person' || item === 'browser' || item === 'mobile' || item === 'cylinder' || item === 'storage' || item === 'queue';
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
export type ExpressionV2 = FqnExpr |
|
|
233
|
+
export type ExpressionV2 = FqnExpr | RelationPredicateOrWhereV2;
|
|
234
234
|
|
|
235
235
|
export const ExpressionV2 = 'ExpressionV2';
|
|
236
236
|
|
|
@@ -336,6 +336,14 @@ export function isRelationPredicateOrWhere(item: unknown): item is RelationPredi
|
|
|
336
336
|
return reflection.isInstance(item, RelationPredicateOrWhere);
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
+
export type RelationPredicateOrWhereV2 = RelationExpr | RelationPredicateWhereV2;
|
|
340
|
+
|
|
341
|
+
export const RelationPredicateOrWhereV2 = 'RelationPredicateOrWhereV2';
|
|
342
|
+
|
|
343
|
+
export function isRelationPredicateOrWhereV2(item: unknown): item is RelationPredicateOrWhereV2 {
|
|
344
|
+
return reflection.isInstance(item, RelationPredicateOrWhereV2);
|
|
345
|
+
}
|
|
346
|
+
|
|
339
347
|
export type RelationProperty = LinkProperty | MetadataProperty | RelationNavigateToProperty | RelationStringProperty | RelationStyleProperty;
|
|
340
348
|
|
|
341
349
|
export const RelationProperty = 'RelationProperty';
|
|
@@ -723,7 +731,7 @@ export function isDeploymentViewRuleStyle(item: unknown): item is DeploymentView
|
|
|
723
731
|
}
|
|
724
732
|
|
|
725
733
|
export interface DirectedRelationExpr extends AstNode {
|
|
726
|
-
readonly $container: DeploymentViewRulePredicateExpression;
|
|
734
|
+
readonly $container: DeploymentViewRulePredicateExpression | RelationPredicateWhereV2;
|
|
727
735
|
readonly $type: 'DirectedRelationExpr';
|
|
728
736
|
source: OutgoingRelationExpr;
|
|
729
737
|
target: FqnExpr;
|
|
@@ -1260,7 +1268,7 @@ export function isIncludePredicate(item: unknown): item is IncludePredicate {
|
|
|
1260
1268
|
}
|
|
1261
1269
|
|
|
1262
1270
|
export interface IncomingRelationExpr extends AstNode {
|
|
1263
|
-
readonly $container: DeploymentViewRulePredicateExpression | InOutRelationExpr;
|
|
1271
|
+
readonly $container: DeploymentViewRulePredicateExpression | InOutRelationExpr | RelationPredicateWhereV2;
|
|
1264
1272
|
readonly $type: 'IncomingRelationExpr';
|
|
1265
1273
|
to: FqnExpr;
|
|
1266
1274
|
}
|
|
@@ -1284,7 +1292,7 @@ export function isIncomingRelationExpression(item: unknown): item is IncomingRel
|
|
|
1284
1292
|
}
|
|
1285
1293
|
|
|
1286
1294
|
export interface InOutRelationExpr extends AstNode {
|
|
1287
|
-
readonly $container: DeploymentViewRulePredicateExpression;
|
|
1295
|
+
readonly $container: DeploymentViewRulePredicateExpression | RelationPredicateWhereV2;
|
|
1288
1296
|
readonly $type: 'InOutRelationExpr';
|
|
1289
1297
|
inout: IncomingRelationExpr;
|
|
1290
1298
|
}
|
|
@@ -1492,7 +1500,7 @@ export function isOpacityProperty(item: unknown): item is OpacityProperty {
|
|
|
1492
1500
|
}
|
|
1493
1501
|
|
|
1494
1502
|
export interface OutgoingRelationExpr extends AstNode {
|
|
1495
|
-
readonly $container: DeploymentViewRulePredicateExpression | DirectedRelationExpr;
|
|
1503
|
+
readonly $container: DeploymentViewRulePredicateExpression | DirectedRelationExpr | RelationPredicateWhereV2;
|
|
1496
1504
|
readonly $type: 'OutgoingRelationExpr';
|
|
1497
1505
|
from: FqnExpr;
|
|
1498
1506
|
isBidirectional: boolean;
|
|
@@ -1589,6 +1597,19 @@ export function isRelationPredicateWhere(item: unknown): item is RelationPredica
|
|
|
1589
1597
|
return reflection.isInstance(item, RelationPredicateWhere);
|
|
1590
1598
|
}
|
|
1591
1599
|
|
|
1600
|
+
export interface RelationPredicateWhereV2 extends AstNode {
|
|
1601
|
+
readonly $container: DeploymentViewRulePredicateExpression;
|
|
1602
|
+
readonly $type: 'RelationPredicateWhereV2';
|
|
1603
|
+
subject: RelationExpr;
|
|
1604
|
+
where?: WhereRelationExpression;
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
export const RelationPredicateWhereV2 = 'RelationPredicateWhereV2';
|
|
1608
|
+
|
|
1609
|
+
export function isRelationPredicateWhereV2(item: unknown): item is RelationPredicateWhereV2 {
|
|
1610
|
+
return reflection.isInstance(item, RelationPredicateWhereV2);
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1592
1613
|
export interface RelationPredicateWith extends AstNode {
|
|
1593
1614
|
readonly $container: Predicates;
|
|
1594
1615
|
readonly $type: 'RelationPredicateWith';
|
|
@@ -1876,7 +1897,7 @@ export function isViewStringProperty(item: unknown): item is ViewStringProperty
|
|
|
1876
1897
|
}
|
|
1877
1898
|
|
|
1878
1899
|
export interface WhereBinaryExpression extends AstNode {
|
|
1879
|
-
readonly $container: ElementPredicateWhere | RelationPredicateWhere | WhereBinaryExpression | WhereElementNegation | WhereRelationNegation;
|
|
1900
|
+
readonly $container: ElementPredicateWhere | RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereElementNegation | WhereRelationNegation;
|
|
1880
1901
|
readonly $type: 'WhereBinaryExpression';
|
|
1881
1902
|
left: WhereElementExpression | WhereRelationExpression;
|
|
1882
1903
|
operator: 'and' | 'or';
|
|
@@ -1930,7 +1951,7 @@ export function isWhereElementTag(item: unknown): item is WhereElementTag {
|
|
|
1930
1951
|
}
|
|
1931
1952
|
|
|
1932
1953
|
export interface WhereRelationKind extends AstNode {
|
|
1933
|
-
readonly $container: RelationPredicateWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1954
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1934
1955
|
readonly $type: 'WhereRelationKind';
|
|
1935
1956
|
not: boolean;
|
|
1936
1957
|
operator: 'is' | string;
|
|
@@ -1944,7 +1965,7 @@ export function isWhereRelationKind(item: unknown): item is WhereRelationKind {
|
|
|
1944
1965
|
}
|
|
1945
1966
|
|
|
1946
1967
|
export interface WhereRelationNegation extends AstNode {
|
|
1947
|
-
readonly $container: RelationPredicateWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1968
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1948
1969
|
readonly $type: 'WhereRelationNegation';
|
|
1949
1970
|
value: WhereRelationExpression;
|
|
1950
1971
|
}
|
|
@@ -1956,7 +1977,7 @@ export function isWhereRelationNegation(item: unknown): item is WhereRelationNeg
|
|
|
1956
1977
|
}
|
|
1957
1978
|
|
|
1958
1979
|
export interface WhereRelationTag extends AstNode {
|
|
1959
|
-
readonly $container: RelationPredicateWhere | WhereBinaryExpression | WhereRelationNegation;
|
|
1980
|
+
readonly $container: RelationPredicateWhere | RelationPredicateWhereV2 | WhereBinaryExpression | WhereRelationNegation;
|
|
1960
1981
|
readonly $type: 'WhereRelationTag';
|
|
1961
1982
|
not: boolean;
|
|
1962
1983
|
operator: 'is' | string;
|
|
@@ -2083,7 +2104,9 @@ export type LikeC4AstType = {
|
|
|
2083
2104
|
RelationNavigateToProperty: RelationNavigateToProperty
|
|
2084
2105
|
RelationPredicate: RelationPredicate
|
|
2085
2106
|
RelationPredicateOrWhere: RelationPredicateOrWhere
|
|
2107
|
+
RelationPredicateOrWhereV2: RelationPredicateOrWhereV2
|
|
2086
2108
|
RelationPredicateWhere: RelationPredicateWhere
|
|
2109
|
+
RelationPredicateWhereV2: RelationPredicateWhereV2
|
|
2087
2110
|
RelationPredicateWith: RelationPredicateWith
|
|
2088
2111
|
RelationProperty: RelationProperty
|
|
2089
2112
|
RelationStringProperty: RelationStringProperty
|
|
@@ -2134,7 +2157,7 @@ export type LikeC4AstType = {
|
|
|
2134
2157
|
export class LikeC4AstReflection extends AbstractAstReflection {
|
|
2135
2158
|
|
|
2136
2159
|
getAllTypes(): string[] {
|
|
2137
|
-
return [ArrowProperty, BorderProperty, ColorProperty, CustomColor, CustomElementProperties, CustomRelationProperties, DeployedInstance, DeployedInstanceBody, DeploymentElement, DeploymentNode, DeploymentNodeBody, DeploymentNodeKind, DeploymentRelation, DeploymentRelationBody, DeploymentView, DeploymentViewBody, DeploymentViewRule, DeploymentViewRulePredicate, DeploymentViewRulePredicateExpression, DeploymentViewRuleStyle, DirectedRelationExpr, DirectedRelationExpression, DynamicView, DynamicViewBody, DynamicViewGlobalPredicateRef, DynamicViewIncludePredicate, DynamicViewParallelSteps, DynamicViewPredicateIterator, DynamicViewRef, DynamicViewRule, DynamicViewStep, Element, ElementBody, ElementDescedantsExpression, ElementExpression, ElementExpressionsIterator, ElementKind, ElementKindExpression, ElementPredicate, ElementPredicateOrWhere, ElementPredicateWhere, ElementPredicateWith, ElementProperty, ElementRef, ElementStringProperty, ElementStyleProperty, ElementTagExpression, ElementView, ElementViewBody, ElementViewRef, ExcludePredicate, ExpandElementExpression, ExpressionV2, ExtendElement, ExtendElementBody, FqnElementRef, FqnExpr, FqnExpressions, FqnRef, FqnRefExpr, FqnReferenceable, GlobalDynamicPredicateGroup, GlobalPredicateGroup, GlobalStyle, GlobalStyleGroup, GlobalStyleId, Globals, IconProperty, InOutRelationExpr, InOutRelationExpression, IncludePredicate, IncomingRelationExpr, IncomingRelationExpression, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, MetadataAttribute, MetadataBody, MetadataProperty, Model, ModelDeployments, ModelViews, NavigateToProperty, NotationProperty, NotesProperty, OpacityProperty, OutgoingRelationExpr, OutgoingRelationExpression, Predicate, Predicates, Referenceable, Relation, RelationBody, RelationExpr, RelationExpression, RelationNavigateToProperty, RelationPredicate, RelationPredicateOrWhere, RelationPredicateWhere, RelationPredicateWith, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, SpecificationColor, SpecificationDeploymentNodeKind, SpecificationElementKind, SpecificationElementStringProperty, SpecificationRelationshipKind, SpecificationRelationshipStringProperty, SpecificationRule, SpecificationTag, StringProperty, StyleProperty, Tag, Tags, ViewProperty, ViewRef, ViewRule, ViewRuleAutoLayout, ViewRuleGlobalPredicateRef, ViewRuleGlobalStyle, ViewRuleGroup, ViewRulePredicate, ViewRuleStyle, ViewRuleStyleOrGlobalRef, ViewStringProperty, WhereBinaryExpression, WhereElement, WhereElementExpression, WhereElementKind, WhereElementNegation, WhereElementTag, WhereExpression, WhereKindEqual, WhereRelation, WhereRelationExpression, WhereRelationKind, WhereRelationNegation, WhereRelationTag, WhereTagEqual, WildcardExpression];
|
|
2160
|
+
return [ArrowProperty, BorderProperty, ColorProperty, CustomColor, CustomElementProperties, CustomRelationProperties, DeployedInstance, DeployedInstanceBody, DeploymentElement, DeploymentNode, DeploymentNodeBody, DeploymentNodeKind, DeploymentRelation, DeploymentRelationBody, DeploymentView, DeploymentViewBody, DeploymentViewRule, DeploymentViewRulePredicate, DeploymentViewRulePredicateExpression, DeploymentViewRuleStyle, DirectedRelationExpr, DirectedRelationExpression, DynamicView, DynamicViewBody, DynamicViewGlobalPredicateRef, DynamicViewIncludePredicate, DynamicViewParallelSteps, DynamicViewPredicateIterator, DynamicViewRef, DynamicViewRule, DynamicViewStep, Element, ElementBody, ElementDescedantsExpression, ElementExpression, ElementExpressionsIterator, ElementKind, ElementKindExpression, ElementPredicate, ElementPredicateOrWhere, ElementPredicateWhere, ElementPredicateWith, ElementProperty, ElementRef, ElementStringProperty, ElementStyleProperty, ElementTagExpression, ElementView, ElementViewBody, ElementViewRef, ExcludePredicate, ExpandElementExpression, ExpressionV2, ExtendElement, ExtendElementBody, FqnElementRef, FqnExpr, FqnExpressions, FqnRef, FqnRefExpr, FqnReferenceable, GlobalDynamicPredicateGroup, GlobalPredicateGroup, GlobalStyle, GlobalStyleGroup, GlobalStyleId, Globals, IconProperty, InOutRelationExpr, InOutRelationExpression, IncludePredicate, IncomingRelationExpr, IncomingRelationExpression, LibIcon, LikeC4Grammar, LikeC4Lib, LikeC4View, LineProperty, LinkProperty, MetadataAttribute, MetadataBody, MetadataProperty, Model, ModelDeployments, ModelViews, NavigateToProperty, NotationProperty, NotesProperty, OpacityProperty, OutgoingRelationExpr, OutgoingRelationExpression, Predicate, Predicates, Referenceable, Relation, RelationBody, RelationExpr, RelationExpression, RelationNavigateToProperty, RelationPredicate, RelationPredicateOrWhere, RelationPredicateOrWhereV2, RelationPredicateWhere, RelationPredicateWhereV2, RelationPredicateWith, RelationProperty, RelationStringProperty, RelationStyleProperty, RelationshipKind, RelationshipStyleProperty, ShapeProperty, SpecificationColor, SpecificationDeploymentNodeKind, SpecificationElementKind, SpecificationElementStringProperty, SpecificationRelationshipKind, SpecificationRelationshipStringProperty, SpecificationRule, SpecificationTag, StringProperty, StyleProperty, Tag, Tags, ViewProperty, ViewRef, ViewRule, ViewRuleAutoLayout, ViewRuleGlobalPredicateRef, ViewRuleGlobalStyle, ViewRuleGroup, ViewRulePredicate, ViewRuleStyle, ViewRuleStyleOrGlobalRef, ViewStringProperty, WhereBinaryExpression, WhereElement, WhereElementExpression, WhereElementKind, WhereElementNegation, WhereElementTag, WhereExpression, WhereKindEqual, WhereRelation, WhereRelationExpression, WhereRelationKind, WhereRelationNegation, WhereRelationTag, WhereTagEqual, WildcardExpression];
|
|
2138
2161
|
}
|
|
2139
2162
|
|
|
2140
2163
|
protected override computeIsSubtype(subtype: string, supertype: string): boolean {
|
|
@@ -2217,7 +2240,7 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
2217
2240
|
return this.isSubtype(FqnReferenceable, supertype);
|
|
2218
2241
|
}
|
|
2219
2242
|
case FqnExpr:
|
|
2220
|
-
case
|
|
2243
|
+
case RelationPredicateOrWhereV2: {
|
|
2221
2244
|
return this.isSubtype(ExpressionV2, supertype);
|
|
2222
2245
|
}
|
|
2223
2246
|
case FqnRefExpr: {
|
|
@@ -2242,6 +2265,10 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
2242
2265
|
case MetadataProperty: {
|
|
2243
2266
|
return this.isSubtype(ElementProperty, supertype) || this.isSubtype(RelationProperty, supertype);
|
|
2244
2267
|
}
|
|
2268
|
+
case RelationExpr:
|
|
2269
|
+
case RelationPredicateWhereV2: {
|
|
2270
|
+
return this.isSubtype(RelationPredicateOrWhereV2, supertype);
|
|
2271
|
+
}
|
|
2245
2272
|
case RelationExpression:
|
|
2246
2273
|
case RelationPredicateWhere: {
|
|
2247
2274
|
return this.isSubtype(RelationPredicateOrWhere, supertype);
|
|
@@ -3149,6 +3176,15 @@ export class LikeC4AstReflection extends AbstractAstReflection {
|
|
|
3149
3176
|
]
|
|
3150
3177
|
};
|
|
3151
3178
|
}
|
|
3179
|
+
case RelationPredicateWhereV2: {
|
|
3180
|
+
return {
|
|
3181
|
+
name: RelationPredicateWhereV2,
|
|
3182
|
+
properties: [
|
|
3183
|
+
{ name: 'subject' },
|
|
3184
|
+
{ name: 'where' }
|
|
3185
|
+
]
|
|
3186
|
+
};
|
|
3187
|
+
}
|
|
3152
3188
|
case RelationPredicateWith: {
|
|
3153
3189
|
return {
|
|
3154
3190
|
name: RelationPredicateWith,
|