@likec4/language-server 1.9.0 → 1.10.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/contrib/likec4.tmLanguage.json +1 -1
- package/dist/browser.cjs +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.mts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.mjs +1 -1
- 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 +1 -1
- package/dist/model-graph/index.cjs +1 -1
- package/dist/model-graph/index.mjs +1 -1
- package/dist/node.cjs +1 -1
- package/dist/node.d.cts +1 -1
- package/dist/node.d.mts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/node.mjs +1 -1
- package/dist/shared/{language-server.86lmJ8ZN.d.cts → language-server.CjFzaJwI.d.cts} +42 -13
- package/dist/shared/{language-server.RjhrBZS0.d.ts → language-server.CtKHXJDD.d.ts} +42 -13
- package/dist/shared/{language-server.CFTY6j4e.d.mts → language-server.D-84I33F.d.mts} +42 -13
- package/dist/shared/{language-server.Q-wtPShM.mjs → language-server.DBJJUUgF.mjs} +485 -108
- package/dist/shared/{language-server.CCB4ESN5.mjs → language-server.DtBRb9os.mjs} +166 -116
- package/dist/shared/{language-server.D0bOlrCi.cjs → language-server.DwyCJvXm.cjs} +164 -114
- package/dist/shared/{language-server.B1TZgyoH.cjs → language-server.JWkqVjGv.cjs} +481 -104
- package/package.json +6 -5
- package/src/ast.ts +8 -6
- package/src/formatting/LikeC4Formatter.ts +388 -0
- package/src/formatting/utils.ts +26 -0
- package/src/generated/ast.ts +104 -10
- package/src/generated/grammar.ts +1 -1
- package/src/like-c4.langium +34 -7
- package/src/lsp/DocumentLinkProvider.ts +27 -15
- package/src/lsp/SemanticTokenProvider.ts +1 -1
- package/src/lsp/index.ts +1 -1
- package/src/model/fqn-index.ts +0 -1
- package/src/model/model-builder.ts +43 -32
- package/src/model/model-parser.ts +43 -21
- package/src/model-graph/compute-view/compute.ts +104 -78
- package/src/model-graph/compute-view/predicates.ts +3 -5
- package/src/model-graph/dynamic-view/compute.ts +96 -60
- package/src/model-graph/utils/buildElementNotations.ts +1 -1
- package/src/module.ts +6 -9
- package/src/test/testServices.ts +27 -7
- package/src/validation/index.ts +2 -1
- package/src/validation/property-checks.ts +13 -1
- package/src/validation/specification.ts +3 -3
- package/src/view-utils/resolve-relative-paths.ts +14 -17
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"name": "keyword.control.likec4",
|
|
15
|
-
"match": "\\b(BottomTop|LeftRight|RightLeft|TopBottom|amber|and|autoLayout|blue|border|browser|color|crow|cylinder|dashed|description|diamond|dot|dotted|dynamic|element|element\\.kind|element\\.tag|exclude|extend|extends|gray|green|head|icon|icons|include|indigo|is|kind|likec4lib|line|link|metadata|mobile|model|muted|navigateTo|none|normal|not|notation|odiamond|odot|of|onormal|opacity|open|or|person|primary|queue|rectangle|red|relationship|secondary|shape|sky|slate|solid|specification|storage|style|tag|tail|technology|title|vee|view|views|where|with)\\b"
|
|
15
|
+
"match": "\\b(BottomTop|LeftRight|RightLeft|TopBottom|amber|and|autoLayout|blue|border|browser|color|crow|cylinder|dashed|description|diamond|dot|dotted|dynamic|element|element\\.kind|element\\.tag|exclude|extend|extends|gray|green|head|icon|icons|include|indigo|is|kind|likec4lib|line|link|metadata|mobile|model|muted|navigateTo|none|normal|not|notation|notes|odiamond|odot|of|onormal|opacity|open|or|par|parallel|person|primary|queue|rectangle|red|relationship|secondary|shape|sky|slate|solid|specification|storage|style|tag|tail|technology|title|vee|view|views|where|with)\\b"
|
|
16
16
|
},
|
|
17
17
|
{
|
|
18
18
|
"name": "string.quoted.double.likec4",
|
package/dist/browser.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const lsp = require('langium/lsp');
|
|
4
4
|
const browser = require('vscode-languageserver/browser');
|
|
5
|
-
const module$1 = require('./shared/language-server.
|
|
5
|
+
const module$1 = require('./shared/language-server.JWkqVjGv.cjs');
|
|
6
6
|
|
|
7
7
|
function startLanguageServer() {
|
|
8
8
|
const messageReader = new browser.BrowserMessageReader(self);
|
package/dist/browser.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.
|
|
1
|
+
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.CjFzaJwI.cjs';
|
|
2
2
|
import * as vscode_languageserver_browser from 'vscode-languageserver/browser';
|
|
3
3
|
import { BrowserMessageReader, BrowserMessageWriter } from 'vscode-languageserver/browser';
|
|
4
4
|
import '@likec4/core';
|
package/dist/browser.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.
|
|
1
|
+
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.D-84I33F.mjs';
|
|
2
2
|
import * as vscode_languageserver_browser from 'vscode-languageserver/browser';
|
|
3
3
|
import { BrowserMessageReader, BrowserMessageWriter } from 'vscode-languageserver/browser';
|
|
4
4
|
import '@likec4/core';
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.
|
|
1
|
+
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.CtKHXJDD.js';
|
|
2
2
|
import * as vscode_languageserver_browser from 'vscode-languageserver/browser';
|
|
3
3
|
import { BrowserMessageReader, BrowserMessageWriter } from 'vscode-languageserver/browser';
|
|
4
4
|
import '@likec4/core';
|
package/dist/browser.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { startLanguageServer as startLanguageServer$1 } from 'langium/lsp';
|
|
2
2
|
import { BrowserMessageReader, BrowserMessageWriter, createConnection } from 'vscode-languageserver/browser';
|
|
3
|
-
import { a as createLanguageServices } from './shared/language-server.
|
|
3
|
+
import { a as createLanguageServices } from './shared/language-server.DBJJUUgF.mjs';
|
|
4
4
|
|
|
5
5
|
function startLanguageServer() {
|
|
6
6
|
const messageReader = new BrowserMessageReader(self);
|
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LogLevels } from '@likec4/log';
|
|
2
|
-
import { L as LikeC4LangiumDocument, a as LikeC4Services } from './shared/language-server.
|
|
3
|
-
export { e as FqnIndex, F as FqnIndexEntry, I as IsValidFn, k as LanguageServicesContext, j as LikeC4AddedServices, f as LikeC4ModelBuilder, g as LikeC4ModelLocator, h as LikeC4ModelParser, d as LikeC4Module, i as LikeC4SharedServices, M as ModelParsedListener, c as createCustomLanguageServices, b as createLanguageServices, l as createSharedServices } from './shared/language-server.
|
|
2
|
+
import { L as LikeC4LangiumDocument, a as LikeC4Services } from './shared/language-server.CjFzaJwI.cjs';
|
|
3
|
+
export { e as FqnIndex, F as FqnIndexEntry, I as IsValidFn, k as LanguageServicesContext, j as LikeC4AddedServices, f as LikeC4ModelBuilder, g as LikeC4ModelLocator, h as LikeC4ModelParser, d as LikeC4Module, i as LikeC4SharedServices, M as ModelParsedListener, c as createCustomLanguageServices, b as createLanguageServices, l as createSharedServices } from './shared/language-server.CjFzaJwI.cjs';
|
|
4
4
|
import '@likec4/core';
|
|
5
5
|
import 'langium';
|
|
6
6
|
import 'type-fest';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LogLevels } from '@likec4/log';
|
|
2
|
-
import { L as LikeC4LangiumDocument, a as LikeC4Services } from './shared/language-server.
|
|
3
|
-
export { e as FqnIndex, F as FqnIndexEntry, I as IsValidFn, k as LanguageServicesContext, j as LikeC4AddedServices, f as LikeC4ModelBuilder, g as LikeC4ModelLocator, h as LikeC4ModelParser, d as LikeC4Module, i as LikeC4SharedServices, M as ModelParsedListener, c as createCustomLanguageServices, b as createLanguageServices, l as createSharedServices } from './shared/language-server.
|
|
2
|
+
import { L as LikeC4LangiumDocument, a as LikeC4Services } from './shared/language-server.D-84I33F.mjs';
|
|
3
|
+
export { e as FqnIndex, F as FqnIndexEntry, I as IsValidFn, k as LanguageServicesContext, j as LikeC4AddedServices, f as LikeC4ModelBuilder, g as LikeC4ModelLocator, h as LikeC4ModelParser, d as LikeC4Module, i as LikeC4SharedServices, M as ModelParsedListener, c as createCustomLanguageServices, b as createLanguageServices, l as createSharedServices } from './shared/language-server.D-84I33F.mjs';
|
|
4
4
|
import '@likec4/core';
|
|
5
5
|
import 'langium';
|
|
6
6
|
import 'type-fest';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LogLevels } from '@likec4/log';
|
|
2
|
-
import { L as LikeC4LangiumDocument, a as LikeC4Services } from './shared/language-server.
|
|
3
|
-
export { e as FqnIndex, F as FqnIndexEntry, I as IsValidFn, k as LanguageServicesContext, j as LikeC4AddedServices, f as LikeC4ModelBuilder, g as LikeC4ModelLocator, h as LikeC4ModelParser, d as LikeC4Module, i as LikeC4SharedServices, M as ModelParsedListener, c as createCustomLanguageServices, b as createLanguageServices, l as createSharedServices } from './shared/language-server.
|
|
2
|
+
import { L as LikeC4LangiumDocument, a as LikeC4Services } from './shared/language-server.CtKHXJDD.js';
|
|
3
|
+
export { e as FqnIndex, F as FqnIndexEntry, I as IsValidFn, k as LanguageServicesContext, j as LikeC4AddedServices, f as LikeC4ModelBuilder, g as LikeC4ModelLocator, h as LikeC4ModelParser, d as LikeC4Module, i as LikeC4SharedServices, M as ModelParsedListener, c as createCustomLanguageServices, b as createLanguageServices, l as createSharedServices } from './shared/language-server.CtKHXJDD.js';
|
|
4
4
|
import '@likec4/core';
|
|
5
5
|
import 'langium';
|
|
6
6
|
import 'type-fest';
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { L as LikeC4Module, c as createCustomLanguageServices, a as createLanguageServices, s as setLogLevel } from './shared/language-server.
|
|
1
|
+
export { L as LikeC4Module, c as createCustomLanguageServices, a as createLanguageServices, s as setLogLevel } from './shared/language-server.DBJJUUgF.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { L as LikeC4ModelGraph, b as computeDynamicView, c as computeElementView, a as computeView } from '../shared/language-server.
|
|
1
|
+
export { L as LikeC4ModelGraph, b as computeDynamicView, c as computeElementView, a as computeView } from '../shared/language-server.DtBRb9os.mjs';
|
package/dist/node.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const lsp = require('langium/lsp');
|
|
4
4
|
const node$1 = require('langium/node');
|
|
5
5
|
const node = require('vscode-languageserver/node');
|
|
6
|
-
const module$1 = require('./shared/language-server.
|
|
6
|
+
const module$1 = require('./shared/language-server.JWkqVjGv.cjs');
|
|
7
7
|
|
|
8
8
|
function startLanguageServer() {
|
|
9
9
|
const connection = node.createConnection(node.ProposedFeatures.all);
|
package/dist/node.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.
|
|
1
|
+
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.CjFzaJwI.cjs';
|
|
2
2
|
import * as vscode_languageserver_lib_common_inlineCompletion_proposed from 'vscode-languageserver/lib/common/inlineCompletion.proposed';
|
|
3
3
|
import * as vscode_languageserver_node from 'vscode-languageserver/node';
|
|
4
4
|
import '@likec4/core';
|
package/dist/node.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.
|
|
1
|
+
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.D-84I33F.mjs';
|
|
2
2
|
import * as vscode_languageserver_lib_common_inlineCompletion_proposed from 'vscode-languageserver/lib/common/inlineCompletion.proposed';
|
|
3
3
|
import * as vscode_languageserver_node from 'vscode-languageserver/node';
|
|
4
4
|
import '@likec4/core';
|
package/dist/node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.
|
|
1
|
+
import { i as LikeC4SharedServices, a as LikeC4Services } from './shared/language-server.CtKHXJDD.js';
|
|
2
2
|
import * as vscode_languageserver_lib_common_inlineCompletion_proposed from 'vscode-languageserver/lib/common/inlineCompletion.proposed';
|
|
3
3
|
import * as vscode_languageserver_node from 'vscode-languageserver/node';
|
|
4
4
|
import '@likec4/core';
|
package/dist/node.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { startLanguageServer as startLanguageServer$1 } from 'langium/lsp';
|
|
2
2
|
import { NodeFileSystem } from 'langium/node';
|
|
3
3
|
import { createConnection, ProposedFeatures } from 'vscode-languageserver/node';
|
|
4
|
-
import { a as createLanguageServices } from './shared/language-server.
|
|
4
|
+
import { a as createLanguageServices } from './shared/language-server.DBJJUUgF.mjs';
|
|
5
5
|
|
|
6
6
|
function startLanguageServer() {
|
|
7
7
|
const connection = createConnection(ProposedFeatures.all);
|
|
@@ -3,7 +3,7 @@ import { Fqn, ViewID } from '@likec4/core';
|
|
|
3
3
|
import { AstNode, Reference, LangiumDocument, MultiMap, AstNodeDescription, DiagnosticInfo, ReferenceDescription, MaybePromise, DefaultScopeComputation, PrecomputedScopes, DefaultScopeProvider, ReferenceInfo, Scope, Disposable, DefaultWorkspaceManager, WorkspaceCache, Module, LangiumDocuments, Stream, Cancellation, URI as URI$1 } from 'langium';
|
|
4
4
|
import { SetRequired, ValueOf, ConditionalPick } from 'type-fest';
|
|
5
5
|
import { Diagnostic, DocumentSymbol, SymbolKind, Hover, Location, Range, TextEdit, CompletionItemKind } from 'vscode-languageserver-types';
|
|
6
|
-
import { CodeLensProvider, DefaultCompletionProvider, DefaultDocumentHighlightProvider, DocumentLinkProvider, DocumentSymbolProvider, NodeKindProvider as NodeKindProvider$1, AstNodeHoverProvider,
|
|
6
|
+
import { CodeLensProvider, DefaultCompletionProvider, DefaultDocumentHighlightProvider, DocumentLinkProvider, DocumentSymbolProvider, NodeKindProvider as NodeKindProvider$1, AstNodeHoverProvider, AbstractSemanticTokenProvider, SemanticTokenAcceptor, LangiumSharedServices, DefaultWorkspaceSymbolProvider, LangiumServices, PartialLangiumServices, DefaultSharedModuleContext } from 'langium/lsp';
|
|
7
7
|
import { CodeLensParams, CancellationToken, CodeLens, DocumentHighlight, DocumentLinkParams, DocumentLink, WorkspaceFolder } from 'vscode-languageserver';
|
|
8
8
|
import { ChangeViewRequestParams } from '../protocol.cjs';
|
|
9
9
|
import { URI } from 'vscode-uri';
|
|
@@ -48,12 +48,12 @@ type RelationPredicate = RelationPredicateOrWhere | RelationPredicateWith;
|
|
|
48
48
|
declare const RelationPredicate = "RelationPredicate";
|
|
49
49
|
type RelationPredicateOrWhere = RelationExpression | RelationPredicateWhere;
|
|
50
50
|
declare const RelationPredicateOrWhere = "RelationPredicateOrWhere";
|
|
51
|
-
type RelationProperty = LinkProperty | MetadataProperty | RelationStringProperty | RelationStyleProperty;
|
|
51
|
+
type RelationProperty = LinkProperty | MetadataProperty | RelationNavigateToProperty | RelationStringProperty | RelationStyleProperty;
|
|
52
52
|
declare const RelationProperty = "RelationProperty";
|
|
53
53
|
declare function isRelationProperty(item: unknown): item is RelationProperty;
|
|
54
54
|
type RelationshipStyleProperty = ArrowProperty | ColorProperty | LineProperty;
|
|
55
55
|
declare const RelationshipStyleProperty = "RelationshipStyleProperty";
|
|
56
|
-
type StringProperty = ElementStringProperty | MetadataAttribute | NotationProperty | RelationStringProperty | SpecificationElementStringProperty | SpecificationRelationshipStringProperty | ViewStringProperty;
|
|
56
|
+
type StringProperty = ElementStringProperty | MetadataAttribute | NotationProperty | NotesProperty | RelationStringProperty | SpecificationElementStringProperty | SpecificationRelationshipStringProperty | ViewStringProperty;
|
|
57
57
|
declare const StringProperty = "StringProperty";
|
|
58
58
|
type StyleProperty = BorderProperty | ColorProperty | IconProperty | OpacityProperty | ShapeProperty;
|
|
59
59
|
declare const StyleProperty = "StyleProperty";
|
|
@@ -120,7 +120,7 @@ declare const CustomElementProperties = "CustomElementProperties";
|
|
|
120
120
|
interface CustomRelationProperties extends AstNode {
|
|
121
121
|
readonly $container: DynamicViewStep | RelationPredicateWith;
|
|
122
122
|
readonly $type: 'CustomRelationProperties';
|
|
123
|
-
props: Array<NotationProperty | RelationStringProperty | RelationshipStyleProperty>;
|
|
123
|
+
props: Array<NotationProperty | NotesProperty | RelationNavigateToProperty | RelationStringProperty | RelationshipStyleProperty>;
|
|
124
124
|
}
|
|
125
125
|
declare const CustomRelationProperties = "CustomRelationProperties";
|
|
126
126
|
interface DirectedRelationExpression extends AstNode {
|
|
@@ -142,7 +142,7 @@ interface DynamicViewBody extends AstNode {
|
|
|
142
142
|
readonly $type: 'DynamicViewBody';
|
|
143
143
|
props: Array<ViewProperty>;
|
|
144
144
|
rules: Array<DynamicViewRule>;
|
|
145
|
-
steps: Array<DynamicViewStep>;
|
|
145
|
+
steps: Array<DynamicViewParallelSteps | DynamicViewStep>;
|
|
146
146
|
tags?: Tags;
|
|
147
147
|
}
|
|
148
148
|
declare const DynamicViewBody = "DynamicViewBody";
|
|
@@ -153,6 +153,13 @@ interface DynamicViewIncludePredicate extends AstNode {
|
|
|
153
153
|
predicates: DynamicViewPredicateIterator;
|
|
154
154
|
}
|
|
155
155
|
declare const DynamicViewIncludePredicate = "DynamicViewIncludePredicate";
|
|
156
|
+
interface DynamicViewParallelSteps extends AstNode {
|
|
157
|
+
readonly $container: DynamicViewBody;
|
|
158
|
+
readonly $type: 'DynamicViewParallelSteps';
|
|
159
|
+
steps: Array<DynamicViewStep>;
|
|
160
|
+
}
|
|
161
|
+
declare const DynamicViewParallelSteps = "DynamicViewParallelSteps";
|
|
162
|
+
declare function isDynamicViewParallelSteps(item: unknown): item is DynamicViewParallelSteps;
|
|
156
163
|
interface DynamicViewPredicateIterator extends AstNode {
|
|
157
164
|
readonly $container: DynamicViewIncludePredicate | DynamicViewPredicateIterator;
|
|
158
165
|
readonly $type: 'DynamicViewPredicateIterator';
|
|
@@ -161,8 +168,14 @@ interface DynamicViewPredicateIterator extends AstNode {
|
|
|
161
168
|
}
|
|
162
169
|
declare const DynamicViewPredicateIterator = "DynamicViewPredicateIterator";
|
|
163
170
|
declare function isDynamicViewPredicateIterator(item: unknown): item is DynamicViewPredicateIterator;
|
|
171
|
+
interface DynamicViewRef extends AstNode {
|
|
172
|
+
readonly $container: RelationNavigateToProperty;
|
|
173
|
+
readonly $type: 'DynamicViewRef';
|
|
174
|
+
view: Reference<DynamicView>;
|
|
175
|
+
}
|
|
176
|
+
declare const DynamicViewRef = "DynamicViewRef";
|
|
164
177
|
interface DynamicViewStep extends AstNode {
|
|
165
|
-
readonly $container: DynamicViewBody;
|
|
178
|
+
readonly $container: DynamicViewBody | DynamicViewParallelSteps;
|
|
166
179
|
readonly $type: 'DynamicViewStep';
|
|
167
180
|
custom?: CustomRelationProperties;
|
|
168
181
|
isBackward: boolean;
|
|
@@ -423,6 +436,13 @@ interface NotationProperty extends AstNode {
|
|
|
423
436
|
value: string;
|
|
424
437
|
}
|
|
425
438
|
declare const NotationProperty = "NotationProperty";
|
|
439
|
+
interface NotesProperty extends AstNode {
|
|
440
|
+
readonly $container: CustomRelationProperties;
|
|
441
|
+
readonly $type: 'NotesProperty';
|
|
442
|
+
key: 'notes';
|
|
443
|
+
value: string;
|
|
444
|
+
}
|
|
445
|
+
declare const NotesProperty = "NotesProperty";
|
|
426
446
|
interface OpacityProperty extends AstNode {
|
|
427
447
|
readonly $container: CustomElementProperties | ElementStyleProperty | ViewRuleStyle;
|
|
428
448
|
readonly $type: 'OpacityProperty';
|
|
@@ -466,6 +486,13 @@ interface RelationBody extends AstNode {
|
|
|
466
486
|
}
|
|
467
487
|
declare const RelationBody = "RelationBody";
|
|
468
488
|
declare function isRelationBody(item: unknown): item is RelationBody;
|
|
489
|
+
interface RelationNavigateToProperty extends AstNode {
|
|
490
|
+
readonly $container: CustomRelationProperties | RelationBody;
|
|
491
|
+
readonly $type: 'RelationNavigateToProperty';
|
|
492
|
+
key: 'navigateTo';
|
|
493
|
+
value: DynamicViewRef;
|
|
494
|
+
}
|
|
495
|
+
declare const RelationNavigateToProperty = "RelationNavigateToProperty";
|
|
469
496
|
interface RelationPredicateWhere extends AstNode {
|
|
470
497
|
readonly $container: Predicates | RelationPredicateWith;
|
|
471
498
|
readonly $type: 'RelationPredicateWhere';
|
|
@@ -673,7 +700,9 @@ type LikeC4AstType = {
|
|
|
673
700
|
DynamicView: DynamicView;
|
|
674
701
|
DynamicViewBody: DynamicViewBody;
|
|
675
702
|
DynamicViewIncludePredicate: DynamicViewIncludePredicate;
|
|
703
|
+
DynamicViewParallelSteps: DynamicViewParallelSteps;
|
|
676
704
|
DynamicViewPredicateIterator: DynamicViewPredicateIterator;
|
|
705
|
+
DynamicViewRef: DynamicViewRef;
|
|
677
706
|
DynamicViewRule: DynamicViewRule;
|
|
678
707
|
DynamicViewStep: DynamicViewStep;
|
|
679
708
|
Element: Element;
|
|
@@ -717,6 +746,7 @@ type LikeC4AstType = {
|
|
|
717
746
|
ModelViews: ModelViews;
|
|
718
747
|
NavigateToProperty: NavigateToProperty;
|
|
719
748
|
NotationProperty: NotationProperty;
|
|
749
|
+
NotesProperty: NotesProperty;
|
|
720
750
|
OpacityProperty: OpacityProperty;
|
|
721
751
|
OutgoingRelationExpression: OutgoingRelationExpression;
|
|
722
752
|
Predicate: Predicate;
|
|
@@ -724,6 +754,7 @@ type LikeC4AstType = {
|
|
|
724
754
|
Relation: Relation;
|
|
725
755
|
RelationBody: RelationBody;
|
|
726
756
|
RelationExpression: RelationExpression;
|
|
757
|
+
RelationNavigateToProperty: RelationNavigateToProperty;
|
|
727
758
|
RelationPredicate: RelationPredicate;
|
|
728
759
|
RelationPredicateOrWhere: RelationPredicateOrWhere;
|
|
729
760
|
RelationPredicateWhere: RelationPredicateWhere;
|
|
@@ -836,6 +867,7 @@ interface ParsedAstRelation {
|
|
|
836
867
|
head?: c4.RelationshipArrowType;
|
|
837
868
|
tail?: c4.RelationshipArrowType;
|
|
838
869
|
links?: c4.NonEmptyArray<ParsedLink>;
|
|
870
|
+
navigateTo?: c4.ViewID;
|
|
839
871
|
metadata?: {
|
|
840
872
|
[key: string]: string;
|
|
841
873
|
};
|
|
@@ -861,7 +893,7 @@ interface ParsedAstDynamicView {
|
|
|
861
893
|
description: string | null;
|
|
862
894
|
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
863
895
|
links: c4.NonEmptyArray<ParsedLink> | null;
|
|
864
|
-
steps: c4.
|
|
896
|
+
steps: c4.DynamicViewStepOrParallel[];
|
|
865
897
|
rules: Array<c4.DynamicViewRule>;
|
|
866
898
|
manualLayout?: c4.ViewManualLayout;
|
|
867
899
|
}
|
|
@@ -891,7 +923,7 @@ interface ParsedLikeC4LangiumDocument extends Omit<LangiumDocument<LikeC4Grammar
|
|
|
891
923
|
}
|
|
892
924
|
type Guard<N extends AstNode> = (n: AstNode) => n is N;
|
|
893
925
|
type Guarded<G> = G extends Guard<infer N> ? N : never;
|
|
894
|
-
declare const isValidatableAstNode: (n: AstNode) => n is Guarded<typeof
|
|
926
|
+
declare const isValidatableAstNode: (n: AstNode) => n is Guarded<typeof isLikeC4View | typeof isRelation | 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>;
|
|
895
927
|
type ValidatableAstNode = Guarded<typeof isValidatableAstNode>;
|
|
896
928
|
declare function checksFromDiagnostics(doc: LikeC4LangiumDocument): {
|
|
897
929
|
isValid: (n: ValidatableAstNode) => boolean;
|
|
@@ -923,6 +955,7 @@ declare class LikeC4DocumentLinkProvider implements DocumentLinkProvider {
|
|
|
923
955
|
constructor(services: LikeC4Services);
|
|
924
956
|
getDocumentLinks(doc: LangiumDocument, _params: DocumentLinkParams): MaybePromise<DocumentLink[]>;
|
|
925
957
|
resolveLink(doc: LangiumDocument, link: string): string;
|
|
958
|
+
relativeLink(doc: LangiumDocument, link: string): string | null;
|
|
926
959
|
}
|
|
927
960
|
|
|
928
961
|
declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
|
|
@@ -950,10 +983,6 @@ declare class LikeC4HoverProvider extends AstNodeHoverProvider {
|
|
|
950
983
|
protected getAstNodeHoverContent(node: AstNode): MaybePromise<Hover | undefined>;
|
|
951
984
|
}
|
|
952
985
|
|
|
953
|
-
declare class LikeC4RenameProvider extends DefaultRenameProvider {
|
|
954
|
-
constructor(services: LikeC4Services);
|
|
955
|
-
}
|
|
956
|
-
|
|
957
986
|
declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider {
|
|
958
987
|
protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void | undefined | 'prune';
|
|
959
988
|
private highlightAstElement;
|
|
@@ -1061,7 +1090,6 @@ interface LikeC4AddedServices {
|
|
|
1061
1090
|
ModelChanges: LikeC4ModelChanges;
|
|
1062
1091
|
};
|
|
1063
1092
|
lsp: {
|
|
1064
|
-
RenameProvider: LikeC4RenameProvider;
|
|
1065
1093
|
CompletionProvider: LikeC4CompletionProvider;
|
|
1066
1094
|
DocumentHighlightProvider: LikeC4DocumentHighlightProvider;
|
|
1067
1095
|
DocumentSymbolProvider: LikeC4DocumentSymbolProvider;
|
|
@@ -1181,6 +1209,7 @@ declare class LikeC4ModelParser {
|
|
|
1181
1209
|
private parseRelationExpr;
|
|
1182
1210
|
private parseViewRule;
|
|
1183
1211
|
private parseViewManualLaout;
|
|
1212
|
+
private parseDynamicParallelSteps;
|
|
1184
1213
|
private parseDynamicStep;
|
|
1185
1214
|
private parseElementView;
|
|
1186
1215
|
private parseDynamicElementView;
|
|
@@ -3,7 +3,7 @@ import { Fqn, ViewID } from '@likec4/core';
|
|
|
3
3
|
import { AstNode, Reference, LangiumDocument, MultiMap, AstNodeDescription, DiagnosticInfo, ReferenceDescription, MaybePromise, DefaultScopeComputation, PrecomputedScopes, DefaultScopeProvider, ReferenceInfo, Scope, Disposable, DefaultWorkspaceManager, WorkspaceCache, Module, LangiumDocuments, Stream, Cancellation, URI as URI$1 } from 'langium';
|
|
4
4
|
import { SetRequired, ValueOf, ConditionalPick } from 'type-fest';
|
|
5
5
|
import { Diagnostic, DocumentSymbol, SymbolKind, Hover, Location, Range, TextEdit, CompletionItemKind } from 'vscode-languageserver-types';
|
|
6
|
-
import { CodeLensProvider, DefaultCompletionProvider, DefaultDocumentHighlightProvider, DocumentLinkProvider, DocumentSymbolProvider, NodeKindProvider as NodeKindProvider$1, AstNodeHoverProvider,
|
|
6
|
+
import { CodeLensProvider, DefaultCompletionProvider, DefaultDocumentHighlightProvider, DocumentLinkProvider, DocumentSymbolProvider, NodeKindProvider as NodeKindProvider$1, AstNodeHoverProvider, AbstractSemanticTokenProvider, SemanticTokenAcceptor, LangiumSharedServices, DefaultWorkspaceSymbolProvider, LangiumServices, PartialLangiumServices, DefaultSharedModuleContext } from 'langium/lsp';
|
|
7
7
|
import { CodeLensParams, CancellationToken, CodeLens, DocumentHighlight, DocumentLinkParams, DocumentLink, WorkspaceFolder } from 'vscode-languageserver';
|
|
8
8
|
import { ChangeViewRequestParams } from '../protocol.js';
|
|
9
9
|
import { URI } from 'vscode-uri';
|
|
@@ -48,12 +48,12 @@ type RelationPredicate = RelationPredicateOrWhere | RelationPredicateWith;
|
|
|
48
48
|
declare const RelationPredicate = "RelationPredicate";
|
|
49
49
|
type RelationPredicateOrWhere = RelationExpression | RelationPredicateWhere;
|
|
50
50
|
declare const RelationPredicateOrWhere = "RelationPredicateOrWhere";
|
|
51
|
-
type RelationProperty = LinkProperty | MetadataProperty | RelationStringProperty | RelationStyleProperty;
|
|
51
|
+
type RelationProperty = LinkProperty | MetadataProperty | RelationNavigateToProperty | RelationStringProperty | RelationStyleProperty;
|
|
52
52
|
declare const RelationProperty = "RelationProperty";
|
|
53
53
|
declare function isRelationProperty(item: unknown): item is RelationProperty;
|
|
54
54
|
type RelationshipStyleProperty = ArrowProperty | ColorProperty | LineProperty;
|
|
55
55
|
declare const RelationshipStyleProperty = "RelationshipStyleProperty";
|
|
56
|
-
type StringProperty = ElementStringProperty | MetadataAttribute | NotationProperty | RelationStringProperty | SpecificationElementStringProperty | SpecificationRelationshipStringProperty | ViewStringProperty;
|
|
56
|
+
type StringProperty = ElementStringProperty | MetadataAttribute | NotationProperty | NotesProperty | RelationStringProperty | SpecificationElementStringProperty | SpecificationRelationshipStringProperty | ViewStringProperty;
|
|
57
57
|
declare const StringProperty = "StringProperty";
|
|
58
58
|
type StyleProperty = BorderProperty | ColorProperty | IconProperty | OpacityProperty | ShapeProperty;
|
|
59
59
|
declare const StyleProperty = "StyleProperty";
|
|
@@ -120,7 +120,7 @@ declare const CustomElementProperties = "CustomElementProperties";
|
|
|
120
120
|
interface CustomRelationProperties extends AstNode {
|
|
121
121
|
readonly $container: DynamicViewStep | RelationPredicateWith;
|
|
122
122
|
readonly $type: 'CustomRelationProperties';
|
|
123
|
-
props: Array<NotationProperty | RelationStringProperty | RelationshipStyleProperty>;
|
|
123
|
+
props: Array<NotationProperty | NotesProperty | RelationNavigateToProperty | RelationStringProperty | RelationshipStyleProperty>;
|
|
124
124
|
}
|
|
125
125
|
declare const CustomRelationProperties = "CustomRelationProperties";
|
|
126
126
|
interface DirectedRelationExpression extends AstNode {
|
|
@@ -142,7 +142,7 @@ interface DynamicViewBody extends AstNode {
|
|
|
142
142
|
readonly $type: 'DynamicViewBody';
|
|
143
143
|
props: Array<ViewProperty>;
|
|
144
144
|
rules: Array<DynamicViewRule>;
|
|
145
|
-
steps: Array<DynamicViewStep>;
|
|
145
|
+
steps: Array<DynamicViewParallelSteps | DynamicViewStep>;
|
|
146
146
|
tags?: Tags;
|
|
147
147
|
}
|
|
148
148
|
declare const DynamicViewBody = "DynamicViewBody";
|
|
@@ -153,6 +153,13 @@ interface DynamicViewIncludePredicate extends AstNode {
|
|
|
153
153
|
predicates: DynamicViewPredicateIterator;
|
|
154
154
|
}
|
|
155
155
|
declare const DynamicViewIncludePredicate = "DynamicViewIncludePredicate";
|
|
156
|
+
interface DynamicViewParallelSteps extends AstNode {
|
|
157
|
+
readonly $container: DynamicViewBody;
|
|
158
|
+
readonly $type: 'DynamicViewParallelSteps';
|
|
159
|
+
steps: Array<DynamicViewStep>;
|
|
160
|
+
}
|
|
161
|
+
declare const DynamicViewParallelSteps = "DynamicViewParallelSteps";
|
|
162
|
+
declare function isDynamicViewParallelSteps(item: unknown): item is DynamicViewParallelSteps;
|
|
156
163
|
interface DynamicViewPredicateIterator extends AstNode {
|
|
157
164
|
readonly $container: DynamicViewIncludePredicate | DynamicViewPredicateIterator;
|
|
158
165
|
readonly $type: 'DynamicViewPredicateIterator';
|
|
@@ -161,8 +168,14 @@ interface DynamicViewPredicateIterator extends AstNode {
|
|
|
161
168
|
}
|
|
162
169
|
declare const DynamicViewPredicateIterator = "DynamicViewPredicateIterator";
|
|
163
170
|
declare function isDynamicViewPredicateIterator(item: unknown): item is DynamicViewPredicateIterator;
|
|
171
|
+
interface DynamicViewRef extends AstNode {
|
|
172
|
+
readonly $container: RelationNavigateToProperty;
|
|
173
|
+
readonly $type: 'DynamicViewRef';
|
|
174
|
+
view: Reference<DynamicView>;
|
|
175
|
+
}
|
|
176
|
+
declare const DynamicViewRef = "DynamicViewRef";
|
|
164
177
|
interface DynamicViewStep extends AstNode {
|
|
165
|
-
readonly $container: DynamicViewBody;
|
|
178
|
+
readonly $container: DynamicViewBody | DynamicViewParallelSteps;
|
|
166
179
|
readonly $type: 'DynamicViewStep';
|
|
167
180
|
custom?: CustomRelationProperties;
|
|
168
181
|
isBackward: boolean;
|
|
@@ -423,6 +436,13 @@ interface NotationProperty extends AstNode {
|
|
|
423
436
|
value: string;
|
|
424
437
|
}
|
|
425
438
|
declare const NotationProperty = "NotationProperty";
|
|
439
|
+
interface NotesProperty extends AstNode {
|
|
440
|
+
readonly $container: CustomRelationProperties;
|
|
441
|
+
readonly $type: 'NotesProperty';
|
|
442
|
+
key: 'notes';
|
|
443
|
+
value: string;
|
|
444
|
+
}
|
|
445
|
+
declare const NotesProperty = "NotesProperty";
|
|
426
446
|
interface OpacityProperty extends AstNode {
|
|
427
447
|
readonly $container: CustomElementProperties | ElementStyleProperty | ViewRuleStyle;
|
|
428
448
|
readonly $type: 'OpacityProperty';
|
|
@@ -466,6 +486,13 @@ interface RelationBody extends AstNode {
|
|
|
466
486
|
}
|
|
467
487
|
declare const RelationBody = "RelationBody";
|
|
468
488
|
declare function isRelationBody(item: unknown): item is RelationBody;
|
|
489
|
+
interface RelationNavigateToProperty extends AstNode {
|
|
490
|
+
readonly $container: CustomRelationProperties | RelationBody;
|
|
491
|
+
readonly $type: 'RelationNavigateToProperty';
|
|
492
|
+
key: 'navigateTo';
|
|
493
|
+
value: DynamicViewRef;
|
|
494
|
+
}
|
|
495
|
+
declare const RelationNavigateToProperty = "RelationNavigateToProperty";
|
|
469
496
|
interface RelationPredicateWhere extends AstNode {
|
|
470
497
|
readonly $container: Predicates | RelationPredicateWith;
|
|
471
498
|
readonly $type: 'RelationPredicateWhere';
|
|
@@ -673,7 +700,9 @@ type LikeC4AstType = {
|
|
|
673
700
|
DynamicView: DynamicView;
|
|
674
701
|
DynamicViewBody: DynamicViewBody;
|
|
675
702
|
DynamicViewIncludePredicate: DynamicViewIncludePredicate;
|
|
703
|
+
DynamicViewParallelSteps: DynamicViewParallelSteps;
|
|
676
704
|
DynamicViewPredicateIterator: DynamicViewPredicateIterator;
|
|
705
|
+
DynamicViewRef: DynamicViewRef;
|
|
677
706
|
DynamicViewRule: DynamicViewRule;
|
|
678
707
|
DynamicViewStep: DynamicViewStep;
|
|
679
708
|
Element: Element;
|
|
@@ -717,6 +746,7 @@ type LikeC4AstType = {
|
|
|
717
746
|
ModelViews: ModelViews;
|
|
718
747
|
NavigateToProperty: NavigateToProperty;
|
|
719
748
|
NotationProperty: NotationProperty;
|
|
749
|
+
NotesProperty: NotesProperty;
|
|
720
750
|
OpacityProperty: OpacityProperty;
|
|
721
751
|
OutgoingRelationExpression: OutgoingRelationExpression;
|
|
722
752
|
Predicate: Predicate;
|
|
@@ -724,6 +754,7 @@ type LikeC4AstType = {
|
|
|
724
754
|
Relation: Relation;
|
|
725
755
|
RelationBody: RelationBody;
|
|
726
756
|
RelationExpression: RelationExpression;
|
|
757
|
+
RelationNavigateToProperty: RelationNavigateToProperty;
|
|
727
758
|
RelationPredicate: RelationPredicate;
|
|
728
759
|
RelationPredicateOrWhere: RelationPredicateOrWhere;
|
|
729
760
|
RelationPredicateWhere: RelationPredicateWhere;
|
|
@@ -836,6 +867,7 @@ interface ParsedAstRelation {
|
|
|
836
867
|
head?: c4.RelationshipArrowType;
|
|
837
868
|
tail?: c4.RelationshipArrowType;
|
|
838
869
|
links?: c4.NonEmptyArray<ParsedLink>;
|
|
870
|
+
navigateTo?: c4.ViewID;
|
|
839
871
|
metadata?: {
|
|
840
872
|
[key: string]: string;
|
|
841
873
|
};
|
|
@@ -861,7 +893,7 @@ interface ParsedAstDynamicView {
|
|
|
861
893
|
description: string | null;
|
|
862
894
|
tags: c4.NonEmptyArray<c4.Tag> | null;
|
|
863
895
|
links: c4.NonEmptyArray<ParsedLink> | null;
|
|
864
|
-
steps: c4.
|
|
896
|
+
steps: c4.DynamicViewStepOrParallel[];
|
|
865
897
|
rules: Array<c4.DynamicViewRule>;
|
|
866
898
|
manualLayout?: c4.ViewManualLayout;
|
|
867
899
|
}
|
|
@@ -891,7 +923,7 @@ interface ParsedLikeC4LangiumDocument extends Omit<LangiumDocument<LikeC4Grammar
|
|
|
891
923
|
}
|
|
892
924
|
type Guard<N extends AstNode> = (n: AstNode) => n is N;
|
|
893
925
|
type Guarded<G> = G extends Guard<infer N> ? N : never;
|
|
894
|
-
declare const isValidatableAstNode: (n: AstNode) => n is Guarded<typeof
|
|
926
|
+
declare const isValidatableAstNode: (n: AstNode) => n is Guarded<typeof isLikeC4View | typeof isRelation | 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>;
|
|
895
927
|
type ValidatableAstNode = Guarded<typeof isValidatableAstNode>;
|
|
896
928
|
declare function checksFromDiagnostics(doc: LikeC4LangiumDocument): {
|
|
897
929
|
isValid: (n: ValidatableAstNode) => boolean;
|
|
@@ -923,6 +955,7 @@ declare class LikeC4DocumentLinkProvider implements DocumentLinkProvider {
|
|
|
923
955
|
constructor(services: LikeC4Services);
|
|
924
956
|
getDocumentLinks(doc: LangiumDocument, _params: DocumentLinkParams): MaybePromise<DocumentLink[]>;
|
|
925
957
|
resolveLink(doc: LangiumDocument, link: string): string;
|
|
958
|
+
relativeLink(doc: LangiumDocument, link: string): string | null;
|
|
926
959
|
}
|
|
927
960
|
|
|
928
961
|
declare class LikeC4DocumentSymbolProvider implements DocumentSymbolProvider {
|
|
@@ -950,10 +983,6 @@ declare class LikeC4HoverProvider extends AstNodeHoverProvider {
|
|
|
950
983
|
protected getAstNodeHoverContent(node: AstNode): MaybePromise<Hover | undefined>;
|
|
951
984
|
}
|
|
952
985
|
|
|
953
|
-
declare class LikeC4RenameProvider extends DefaultRenameProvider {
|
|
954
|
-
constructor(services: LikeC4Services);
|
|
955
|
-
}
|
|
956
|
-
|
|
957
986
|
declare class LikeC4SemanticTokenProvider extends AbstractSemanticTokenProvider {
|
|
958
987
|
protected highlightElement(node: AstNode, acceptor: SemanticTokenAcceptor): void | undefined | 'prune';
|
|
959
988
|
private highlightAstElement;
|
|
@@ -1061,7 +1090,6 @@ interface LikeC4AddedServices {
|
|
|
1061
1090
|
ModelChanges: LikeC4ModelChanges;
|
|
1062
1091
|
};
|
|
1063
1092
|
lsp: {
|
|
1064
|
-
RenameProvider: LikeC4RenameProvider;
|
|
1065
1093
|
CompletionProvider: LikeC4CompletionProvider;
|
|
1066
1094
|
DocumentHighlightProvider: LikeC4DocumentHighlightProvider;
|
|
1067
1095
|
DocumentSymbolProvider: LikeC4DocumentSymbolProvider;
|
|
@@ -1181,6 +1209,7 @@ declare class LikeC4ModelParser {
|
|
|
1181
1209
|
private parseRelationExpr;
|
|
1182
1210
|
private parseViewRule;
|
|
1183
1211
|
private parseViewManualLaout;
|
|
1212
|
+
private parseDynamicParallelSteps;
|
|
1184
1213
|
private parseDynamicStep;
|
|
1185
1214
|
private parseElementView;
|
|
1186
1215
|
private parseDynamicElementView;
|