@likec4/language-server 1.39.0 → 1.39.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/{LikeC4LanguageServices.js → LikeC4LanguageServices.mjs} +3 -3
- package/dist/{Rpc.js → Rpc.mjs} +3 -3
- package/dist/{ast.js → ast.mjs} +2 -2
- package/dist/browser-worker.mjs +2 -0
- package/dist/{browser.js → browser.mjs} +3 -3
- package/dist/bundled.mjs +2165 -2165
- package/dist/documentation/{documentation-provider.js → documentation-provider.mjs} +2 -2
- package/dist/documentation/{index.js → index.mjs} +1 -1
- package/dist/filesystem/{ChokidarWatcher.js → ChokidarWatcher.mjs} +8 -7
- package/dist/filesystem/LikeC4FileSystem.d.ts +1 -0
- package/dist/filesystem/{LikeC4FileSystem.js → LikeC4FileSystem.mjs} +6 -6
- package/dist/filesystem/{index.js → index.mjs} +1 -1
- package/dist/formatting/{LikeC4Formatter.js → LikeC4Formatter.mjs} +2 -2
- package/dist/generated/{module.js → module.mjs} +2 -2
- package/dist/{index.js → index.mjs} +9 -9
- package/dist/{likec4lib.js → likec4lib.mjs} +1 -1
- package/dist/lsp/{CodeLensProvider.js → CodeLensProvider.mjs} +3 -3
- package/dist/lsp/{CompletionProvider.js → CompletionProvider.mjs} +1 -1
- package/dist/lsp/{DocumentLinkProvider.js → DocumentLinkProvider.mjs} +2 -2
- package/dist/lsp/{DocumentSymbolProvider.js → DocumentSymbolProvider.mjs} +3 -3
- package/dist/lsp/{HoverProvider.js → HoverProvider.mjs} +1 -1
- package/dist/lsp/{SemanticTokenProvider.js → SemanticTokenProvider.mjs} +1 -1
- package/dist/lsp/index.mjs +7 -0
- package/dist/mcp/{MCPServerFactory.js → MCPServerFactory.mjs} +9 -9
- package/dist/mcp/{interfaces.js → interfaces.mjs} +1 -1
- package/dist/mcp/server/{StdioLikeC4MCPServer.js → StdioLikeC4MCPServer.mjs} +1 -1
- package/dist/mcp/server/{StreamableLikeC4MCPServer.js → StreamableLikeC4MCPServer.mjs} +1 -1
- package/dist/mcp/server/{WithMCPServer.js → WithMCPServer.mjs} +3 -3
- package/dist/mcp/tools/{_common.js → _common.mjs} +2 -2
- package/dist/mcp/tools/{find-relationships.js → find-relationships.mjs} +2 -2
- package/dist/mcp/tools/{list-projects.js → list-projects.mjs} +1 -1
- package/dist/mcp/tools/{open-view.js → open-view.mjs} +2 -2
- package/dist/mcp/tools/{read-deployment.js → read-deployment.mjs} +2 -2
- package/dist/mcp/tools/{read-element.js → read-element.mjs} +2 -2
- package/dist/mcp/tools/{read-project-summary.js → read-project-summary.mjs} +2 -2
- package/dist/mcp/tools/{read-view.js → read-view.mjs} +2 -2
- package/dist/mcp/tools/{search-element.js → search-element.mjs} +2 -2
- package/dist/mcp/{utils.js → utils.mjs} +1 -1
- package/dist/model/builder/{MergedSpecification.js → MergedSpecification.mjs} +2 -2
- package/dist/model/builder/{buildModel.js → buildModel.mjs} +4 -4
- package/dist/model/{deployments-index.js → deployments-index.mjs} +4 -4
- package/dist/model/{fqn-index.js → fqn-index.mjs} +5 -5
- package/dist/model/index.mjs +6 -0
- package/dist/model/{model-builder.js → model-builder.mjs} +5 -5
- package/dist/model/{model-locator.js → model-locator.mjs} +4 -4
- package/dist/model/{model-parser-where.js → model-parser-where.mjs} +1 -1
- package/dist/model/{model-parser.js → model-parser.mjs} +13 -13
- package/dist/model/parser/{Base.js → Base.mjs} +5 -5
- package/dist/model/parser/{DeploymentModelParser.js → DeploymentModelParser.mjs} +3 -3
- package/dist/model/parser/{DeploymentViewParser.js → DeploymentViewParser.mjs} +5 -5
- package/dist/model/parser/{FqnRefParser.js → FqnRefParser.mjs} +6 -6
- package/dist/model/parser/{GlobalsParser.js → GlobalsParser.mjs} +2 -2
- package/dist/model/parser/{ImportsParser.js → ImportsParser.mjs} +1 -1
- package/dist/model/parser/{ModelParser.js → ModelParser.mjs} +3 -3
- package/dist/model/parser/{PredicatesParser.js → PredicatesParser.mjs} +1 -1
- package/dist/model/parser/{SpecificationParser.js → SpecificationParser.mjs} +3 -3
- package/dist/model/parser/{ViewsParser.js → ViewsParser.mjs} +6 -6
- package/dist/model-change/{ModelChanges.js → ModelChanges.mjs} +3 -3
- package/dist/model-change/{changeElementStyle.js → changeElementStyle.mjs} +1 -1
- package/dist/model-change/{changeViewLayout.js → changeViewLayout.mjs} +1 -1
- package/dist/model-change/{saveManualLayout.js → saveManualLayout.mjs} +1 -1
- package/dist/{module.js → module.mjs} +16 -16
- package/dist/references/index.mjs +3 -0
- package/dist/references/{name-provider.js → name-provider.mjs} +1 -1
- package/dist/references/{scope-computation.js → scope-computation.mjs} +2 -2
- package/dist/references/{scope-provider.js → scope-provider.mjs} +4 -4
- package/dist/shared/{NodeKindProvider.js → NodeKindProvider.mjs} +1 -1
- package/dist/shared/index.mjs +2 -0
- package/dist/test/index.mjs +1 -0
- package/dist/test/{testServices.js → testServices.mjs} +2 -2
- package/dist/utils/{disposable.js → disposable.mjs} +1 -1
- package/dist/utils/{elementRef.js → elementRef.mjs} +1 -1
- package/dist/utils/{fqnRef.js → fqnRef.mjs} +1 -1
- package/dist/utils/{index.js → index.mjs} +6 -6
- package/dist/utils/{projectId.js → projectId.mjs} +1 -1
- package/dist/validation/{_shared.js → _shared.mjs} +1 -1
- package/dist/validation/{deployment-checks.js → deployment-checks.mjs} +3 -3
- package/dist/validation/{dynamic-view-step.js → dynamic-view-step.mjs} +2 -2
- package/dist/validation/{element-ref.js → element-ref.mjs} +2 -2
- package/dist/validation/{element.js → element.mjs} +2 -2
- package/dist/validation/{imports.js → imports.mjs} +2 -2
- package/dist/validation/{index.js → index.mjs} +13 -13
- package/dist/validation/{property-checks.js → property-checks.mjs} +2 -2
- package/dist/validation/{relation.js → relation.mjs} +2 -2
- package/dist/validation/{specification.js → specification.mjs} +3 -3
- package/dist/validation/view-predicates/{fqn-expr-with.js → fqn-expr-with.mjs} +4 -3
- package/dist/validation/view-predicates/{fqn-ref-expr.js → fqn-ref-expr.mjs} +3 -3
- package/dist/validation/view-predicates/{incoming.js → incoming.mjs} +2 -2
- package/dist/validation/view-predicates/index.mjs +6 -0
- package/dist/validation/view-predicates/{outgoing.js → outgoing.mjs} +2 -2
- package/dist/validation/view-predicates/{relation-expr.js → relation-expr.mjs} +2 -2
- package/dist/validation/view-predicates/{relation-with.js → relation-with.mjs} +2 -2
- package/dist/validation/{view.js → view.mjs} +3 -3
- package/dist/view-utils/index.mjs +2 -0
- package/dist/view-utils/{manual-layout.js → manual-layout.mjs} +1 -1
- package/dist/views/{configurable-layouter.js → configurable-layouter.mjs} +1 -1
- package/dist/views/index.mjs +1 -0
- package/dist/views/{likec4-views.js → likec4-views.mjs} +2 -2
- package/dist/workspace/{LangiumDocuments.js → LangiumDocuments.mjs} +2 -2
- package/dist/workspace/{ProjectsManager.js → ProjectsManager.mjs} +1 -1
- package/dist/workspace/{WorkspaceManager.js → WorkspaceManager.mjs} +2 -2
- package/dist/workspace/index.mjs +5 -0
- package/package.json +21 -19
- package/dist/browser-worker.js +0 -2
- package/dist/bundled.js +0 -40
- package/dist/lsp/index.js +0 -7
- package/dist/model/index.js +0 -6
- package/dist/references/index.js +0 -3
- package/dist/shared/index.js +0 -2
- package/dist/test/index.js +0 -1
- package/dist/validation/view-predicates/index.js +0 -6
- package/dist/view-utils/index.js +0 -2
- package/dist/views/index.js +0 -1
- package/dist/workspace/index.js +0 -5
- /package/dist/{empty.js → empty.mjs} +0 -0
- /package/dist/filesystem/{FileSystemWatcher.js → FileSystemWatcher.mjs} +0 -0
- /package/dist/formatting/{utils.js → utils.mjs} +0 -0
- /package/dist/generated/{ast.js → ast.mjs} +0 -0
- /package/dist/generated/{grammar.js → grammar.mjs} +0 -0
- /package/dist/generated-lib/{icons.js → icons.mjs} +0 -0
- /package/dist/{logger.js → logger.mjs} +0 -0
- /package/dist/lsp/{DocumentHighlightProvider.js → DocumentHighlightProvider.mjs} +0 -0
- /package/dist/lsp/{RenameProvider.js → RenameProvider.mjs} +0 -0
- /package/dist/mcp/{NoopLikeC4MCPServer.js → NoopLikeC4MCPServer.mjs} +0 -0
- /package/dist/model/builder/{MergedExtends.js → MergedExtends.mjs} +0 -0
- /package/dist/model/builder/{assignTagColors.js → assignTagColors.mjs} +0 -0
- /package/dist/model/parser/{ValueConverter.js → ValueConverter.mjs} +0 -0
- /package/dist/{protocol.js → protocol.mjs} +0 -0
- /package/dist/shared/{WorkspaceSymbolProvider.js → WorkspaceSymbolProvider.mjs} +0 -0
- /package/dist/utils/{printDocs.js → printDocs.mjs} +0 -0
- /package/dist/utils/{stringHash.js → stringHash.mjs} +0 -0
- /package/dist/validation/{DocumentValidator.js → DocumentValidator.mjs} +0 -0
- /package/dist/view-utils/{assignNavigateTo.js → assignNavigateTo.mjs} +0 -0
- /package/dist/view-utils/{resolve-relative-paths.js → resolve-relative-paths.mjs} +0 -0
- /package/dist/workspace/{AstNodeDescriptionProvider.js → AstNodeDescriptionProvider.mjs} +0 -0
- /package/dist/workspace/{IndexManager.js → IndexManager.mjs} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { invariant, nonexhaustive, nonNullable } from "@likec4/core";
|
|
2
2
|
import { isBoolean, isDefined, isNonNullish, isTruthy } from "remeda";
|
|
3
|
-
import { ast, parseAstOpacityProperty, parseAstSizeValue, parseMarkdownAsString, toColor } from "../../ast.
|
|
4
|
-
import { logWarnError } from "../../logger.
|
|
5
|
-
import { projectIdFrom } from "../../utils/index.
|
|
6
|
-
import { importsRef, instanceRef } from "../../utils/fqnRef.
|
|
7
|
-
import { createBinaryOperator, parseWhereClause } from "../model-parser-where.
|
|
8
|
-
import { removeIndent } from "./Base.
|
|
3
|
+
import { ast, parseAstOpacityProperty, parseAstSizeValue, parseMarkdownAsString, toColor } from "../../ast.mjs";
|
|
4
|
+
import { logWarnError } from "../../logger.mjs";
|
|
5
|
+
import { projectIdFrom } from "../../utils/index.mjs";
|
|
6
|
+
import { importsRef, instanceRef } from "../../utils/fqnRef.mjs";
|
|
7
|
+
import { createBinaryOperator, parseWhereClause } from "../model-parser-where.mjs";
|
|
8
|
+
import { removeIndent } from "./Base.mjs";
|
|
9
9
|
export function ExpressionV2Parser(B) {
|
|
10
10
|
return class ExpressionV2Parser extends B {
|
|
11
11
|
parseFqnRef(astNode) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { nonexhaustive } from "@likec4/core";
|
|
2
2
|
import { hasAtLeast, isTruthy } from "remeda";
|
|
3
|
-
import { ast } from "../../ast.
|
|
4
|
-
import { logger, logWarnError } from "../../logger.
|
|
3
|
+
import { ast } from "../../ast.mjs";
|
|
4
|
+
import { logger, logWarnError } from "../../logger.mjs";
|
|
5
5
|
export function GlobalsParser(B) {
|
|
6
6
|
return class GlobalsParser extends B {
|
|
7
7
|
parseGlobals() {
|
|
@@ -5,9 +5,9 @@ import { filter, first, isDefined, isEmpty, isTruthy, map, mapToObj, pipe } from
|
|
|
5
5
|
import {
|
|
6
6
|
ast,
|
|
7
7
|
toRelationshipStyleExcludeDefaults
|
|
8
|
-
} from "../../ast.
|
|
9
|
-
import { logger as mainLogger } from "../../logger.
|
|
10
|
-
import { stringHash } from "../../utils/stringHash.
|
|
8
|
+
} from "../../ast.mjs";
|
|
9
|
+
import { logger as mainLogger } from "../../logger.mjs";
|
|
10
|
+
import { stringHash } from "../../utils/stringHash.mjs";
|
|
11
11
|
const logger = mainLogger.getChild("ModelParser");
|
|
12
12
|
function* streamModel(doc) {
|
|
13
13
|
const traverseStack = LinkedList.from(doc.parseResult.value.models.flatMap((m) => m.elements));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as c4 from "@likec4/core";
|
|
2
2
|
import { nonNullable } from "@likec4/core/utils";
|
|
3
3
|
import { filter, isNonNullish, isNullish, isTruthy, mapToObj, omitBy, pipe } from "remeda";
|
|
4
|
-
import { ast, parseMarkdownAsString, toRelationshipStyleExcludeDefaults } from "../../ast.
|
|
5
|
-
import { logger, logWarnError } from "../../logger.
|
|
6
|
-
import { removeIndent } from "./Base.
|
|
4
|
+
import { ast, parseMarkdownAsString, toRelationshipStyleExcludeDefaults } from "../../ast.mjs";
|
|
5
|
+
import { logger, logWarnError } from "../../logger.mjs";
|
|
6
|
+
import { removeIndent } from "./Base.mjs";
|
|
7
7
|
export function SpecificationParser(B) {
|
|
8
8
|
return class SpecificationParser extends B {
|
|
9
9
|
parseSpecification() {
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
toAutoLayout,
|
|
8
8
|
toColor,
|
|
9
9
|
ViewOps
|
|
10
|
-
} from "../../ast.
|
|
11
|
-
import { logger, logWarnError } from "../../logger.
|
|
12
|
-
import { stringHash } from "../../utils/index.
|
|
13
|
-
import { elementRef } from "../../utils/elementRef.
|
|
14
|
-
import { parseViewManualLayout } from "../../view-utils/manual-layout.
|
|
15
|
-
import { removeIndent, toSingleLine } from "./Base.
|
|
10
|
+
} from "../../ast.mjs";
|
|
11
|
+
import { logger, logWarnError } from "../../logger.mjs";
|
|
12
|
+
import { stringHash } from "../../utils/index.mjs";
|
|
13
|
+
import { elementRef } from "../../utils/elementRef.mjs";
|
|
14
|
+
import { parseViewManualLayout } from "../../view-utils/manual-layout.mjs";
|
|
15
|
+
import { removeIndent, toSingleLine } from "./Base.mjs";
|
|
16
16
|
export function ViewsParser(B) {
|
|
17
17
|
return class ViewsParser extends B {
|
|
18
18
|
parseViews() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { invariant, nonexhaustive } from "@likec4/core";
|
|
2
2
|
import { logger } from "@likec4/log";
|
|
3
|
-
import { changeElementStyle } from "./changeElementStyle.
|
|
4
|
-
import { changeViewLayout } from "./changeViewLayout.
|
|
5
|
-
import { saveManualLayout } from "./saveManualLayout.
|
|
3
|
+
import { changeElementStyle } from "./changeElementStyle.mjs";
|
|
4
|
+
import { changeViewLayout } from "./changeViewLayout.mjs";
|
|
5
|
+
import { saveManualLayout } from "./saveManualLayout.mjs";
|
|
6
6
|
export class LikeC4ModelChanges {
|
|
7
7
|
constructor(services) {
|
|
8
8
|
this.services = services;
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import { GrammarUtils } from "langium";
|
|
7
7
|
import { entries, filter, findLast, isTruthy, last } from "remeda";
|
|
8
8
|
import { TextEdit } from "vscode-languageserver-types";
|
|
9
|
-
import { ast } from "../ast.
|
|
9
|
+
import { ast } from "../ast.mjs";
|
|
10
10
|
const { findNodeForKeyword, findNodeForProperty } = GrammarUtils;
|
|
11
11
|
const asViewStyleRule = (target, style, indent = 0) => {
|
|
12
12
|
const indentStr = indent > 0 ? " ".repeat(indent) : "";
|
|
@@ -2,7 +2,7 @@ import { invariant } from "@likec4/core";
|
|
|
2
2
|
import { GrammarUtils } from "langium";
|
|
3
3
|
import { findLast, isNumber } from "remeda";
|
|
4
4
|
import { TextEdit } from "vscode-languageserver-types";
|
|
5
|
-
import { ast, toAstViewLayoutDirection } from "../ast.
|
|
5
|
+
import { ast, toAstViewLayoutDirection } from "../ast.mjs";
|
|
6
6
|
const { findNodeForProperty, findNodeForKeyword } = GrammarUtils;
|
|
7
7
|
export function changeViewLayout(_services, {
|
|
8
8
|
view,
|
|
@@ -2,7 +2,7 @@ import { invariant } from "@likec4/core";
|
|
|
2
2
|
import indentString from "indent-string";
|
|
3
3
|
import { CstUtils, GrammarUtils } from "langium";
|
|
4
4
|
import { TextEdit } from "vscode-languageserver-types";
|
|
5
|
-
import { serializeToComment } from "../view-utils/manual-layout.
|
|
5
|
+
import { serializeToComment } from "../view-utils/manual-layout.mjs";
|
|
6
6
|
const { findNodeForProperty } = GrammarUtils;
|
|
7
7
|
export function saveManualLayout(_services, {
|
|
8
8
|
viewAst,
|
|
@@ -8,16 +8,16 @@ import {
|
|
|
8
8
|
createDefaultModule,
|
|
9
9
|
createDefaultSharedModule
|
|
10
10
|
} from "langium/lsp";
|
|
11
|
-
import { LikeC4DocumentationProvider } from "./documentation/index.
|
|
11
|
+
import { LikeC4DocumentationProvider } from "./documentation/index.mjs";
|
|
12
12
|
import {
|
|
13
13
|
NoopFileSystem
|
|
14
|
-
} from "./filesystem/index.
|
|
15
|
-
import { LikeC4Formatter } from "./formatting/LikeC4Formatter.
|
|
14
|
+
} from "./filesystem/index.mjs";
|
|
15
|
+
import { LikeC4Formatter } from "./formatting/LikeC4Formatter.mjs";
|
|
16
16
|
import {
|
|
17
17
|
LikeC4GeneratedModule,
|
|
18
18
|
LikeC4GeneratedSharedModule
|
|
19
|
-
} from "./generated/module.
|
|
20
|
-
import { DefaultLikeC4LanguageServices } from "./LikeC4LanguageServices.
|
|
19
|
+
} from "./generated/module.mjs";
|
|
20
|
+
import { DefaultLikeC4LanguageServices } from "./LikeC4LanguageServices.mjs";
|
|
21
21
|
import {
|
|
22
22
|
LikeC4CodeLensProvider,
|
|
23
23
|
LikeC4CompletionProvider,
|
|
@@ -26,11 +26,11 @@ import {
|
|
|
26
26
|
LikeC4DocumentSymbolProvider,
|
|
27
27
|
LikeC4HoverProvider,
|
|
28
28
|
LikeC4SemanticTokenProvider
|
|
29
|
-
} from "./lsp/index.
|
|
29
|
+
} from "./lsp/index.mjs";
|
|
30
30
|
import {
|
|
31
31
|
NoMCPServer
|
|
32
|
-
} from "./mcp/interfaces.
|
|
33
|
-
import { LikeC4MCPServerFactory } from "./mcp/MCPServerFactory.
|
|
32
|
+
} from "./mcp/interfaces.mjs";
|
|
33
|
+
import { LikeC4MCPServerFactory } from "./mcp/MCPServerFactory.mjs";
|
|
34
34
|
import {
|
|
35
35
|
DefaultLikeC4ModelBuilder,
|
|
36
36
|
DeploymentsIndex,
|
|
@@ -38,27 +38,27 @@ import {
|
|
|
38
38
|
LikeC4ModelLocator,
|
|
39
39
|
LikeC4ModelParser,
|
|
40
40
|
LikeC4ValueConverter
|
|
41
|
-
} from "./model/index.
|
|
42
|
-
import { LikeC4ModelChanges } from "./model-change/ModelChanges.
|
|
41
|
+
} from "./model/index.mjs";
|
|
42
|
+
import { LikeC4ModelChanges } from "./model-change/ModelChanges.mjs";
|
|
43
43
|
import {
|
|
44
44
|
LikeC4NameProvider,
|
|
45
45
|
LikeC4ScopeComputation,
|
|
46
46
|
LikeC4ScopeProvider
|
|
47
|
-
} from "./references/index.
|
|
48
|
-
import { Rpc } from "./Rpc.
|
|
47
|
+
} from "./references/index.mjs";
|
|
48
|
+
import { Rpc } from "./Rpc.mjs";
|
|
49
49
|
import {
|
|
50
50
|
NodeKindProvider,
|
|
51
51
|
WorkspaceSymbolProvider
|
|
52
|
-
} from "./shared/index.
|
|
53
|
-
import { LikeC4DocumentValidator, registerValidationChecks } from "./validation/index.
|
|
54
|
-
import { DefaultLikeC4Views } from "./views/index.
|
|
52
|
+
} from "./shared/index.mjs";
|
|
53
|
+
import { LikeC4DocumentValidator, registerValidationChecks } from "./validation/index.mjs";
|
|
54
|
+
import { DefaultLikeC4Views } from "./views/index.mjs";
|
|
55
55
|
import {
|
|
56
56
|
AstNodeDescriptionProvider,
|
|
57
57
|
IndexManager,
|
|
58
58
|
LangiumDocuments,
|
|
59
59
|
LikeC4WorkspaceManager,
|
|
60
60
|
ProjectsManager
|
|
61
|
-
} from "./workspace/index.
|
|
61
|
+
} from "./workspace/index.mjs";
|
|
62
62
|
const createLikeC4SharedModule = (context) => ({
|
|
63
63
|
lsp: {
|
|
64
64
|
NodeKindProvider: (services) => new NodeKindProvider(services),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { nonNullable } from "@likec4/core";
|
|
2
2
|
import { DefaultNameProvider, isNamed } from "langium";
|
|
3
|
-
import { ast } from "../ast.
|
|
3
|
+
import { ast } from "../ast.mjs";
|
|
4
4
|
export class LikeC4NameProvider extends DefaultNameProvider {
|
|
5
5
|
constructor(services) {
|
|
6
6
|
super();
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
MultiMap
|
|
5
5
|
} from "langium";
|
|
6
6
|
import { entries, filter, flatMap, forEachObj, groupBy, isNullish, isTruthy, pipe } from "remeda";
|
|
7
|
-
import { ast } from "../ast.
|
|
8
|
-
import { logWarnError } from "../logger.
|
|
7
|
+
import { ast } from "../ast.mjs";
|
|
8
|
+
import { logWarnError } from "../logger.mjs";
|
|
9
9
|
function uniqueDescriptions(descs) {
|
|
10
10
|
return pipe(
|
|
11
11
|
descs,
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
StreamImpl,
|
|
11
11
|
StreamScope
|
|
12
12
|
} from "langium";
|
|
13
|
-
import { ast, isFqnRefInsideGlobals, isFqnRefInsideModel } from "../ast.
|
|
14
|
-
import { logWarnError } from "../logger.
|
|
15
|
-
import { projectIdFrom } from "../utils/index.
|
|
16
|
-
import { elementRef, readStrictFqn } from "../utils/elementRef.
|
|
13
|
+
import { ast, isFqnRefInsideGlobals, isFqnRefInsideModel } from "../ast.mjs";
|
|
14
|
+
import { logWarnError } from "../logger.mjs";
|
|
15
|
+
import { projectIdFrom } from "../utils/index.mjs";
|
|
16
|
+
import { elementRef, readStrictFqn } from "../utils/elementRef.mjs";
|
|
17
17
|
const { getDocument } = AstUtils;
|
|
18
18
|
export class LikeC4ScopeProvider extends DefaultScopeProvider {
|
|
19
19
|
deploymentsIndex;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isAstNode } from "langium";
|
|
2
2
|
import { CompletionItemKind, SymbolKind } from "vscode-languageserver-types";
|
|
3
|
-
import { ast } from "../ast.
|
|
3
|
+
import { ast } from "../ast.mjs";
|
|
4
4
|
export class NodeKindProvider {
|
|
5
5
|
constructor(services) {
|
|
6
6
|
this.services = services;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./testServices.mjs";
|
|
@@ -4,8 +4,8 @@ import { entries } from "remeda";
|
|
|
4
4
|
import stripIndent from "strip-indent";
|
|
5
5
|
import { DiagnosticSeverity } from "vscode-languageserver-types";
|
|
6
6
|
import { URI, Utils } from "vscode-uri";
|
|
7
|
-
import { NoopFileSystem } from "../filesystem/index.
|
|
8
|
-
import { createLanguageServices } from "../module.
|
|
7
|
+
import { NoopFileSystem } from "../filesystem/index.mjs";
|
|
8
|
+
import { createLanguageServices } from "../module.mjs";
|
|
9
9
|
export function createTestServices(options) {
|
|
10
10
|
const workspace = options?.workspace ?? "file:///test/workspace";
|
|
11
11
|
const projectConfig = options?.projectConfig;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import prettyMs from "pretty-ms";
|
|
2
|
-
import { logger } from "../logger.
|
|
3
|
-
export * from "./disposable.
|
|
4
|
-
export * from "./elementRef.
|
|
5
|
-
export * from "./fqnRef.
|
|
6
|
-
export * from "./projectId.
|
|
7
|
-
export * from "./stringHash.
|
|
2
|
+
import { logger } from "../logger.mjs";
|
|
3
|
+
export * from "./disposable.mjs";
|
|
4
|
+
export * from "./elementRef.mjs";
|
|
5
|
+
export * from "./fqnRef.mjs";
|
|
6
|
+
export * from "./projectId.mjs";
|
|
7
|
+
export * from "./stringHash.mjs";
|
|
8
8
|
export function safeCall(fn) {
|
|
9
9
|
try {
|
|
10
10
|
return fn();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { invariant, nonNullable } from "@likec4/core";
|
|
2
2
|
import { AstUtils, isAstNode } from "langium";
|
|
3
|
-
import { ast } from "../ast.
|
|
3
|
+
import { ast } from "../ast.mjs";
|
|
4
4
|
export function projectIdFrom(value) {
|
|
5
5
|
if (ast.isImported(value)) {
|
|
6
6
|
while (value.$type === "Imported" && value.$container) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FqnRef, isSameHierarchy, nonNullable } from "@likec4/core";
|
|
2
2
|
import { AstUtils } from "langium";
|
|
3
|
-
import { ast } from "../ast.
|
|
4
|
-
import { projectIdFrom } from "../utils/index.
|
|
5
|
-
import { RESERVED_WORDS, tryOrLog } from "./_shared.
|
|
3
|
+
import { ast } from "../ast.mjs";
|
|
4
|
+
import { projectIdFrom } from "../utils/index.mjs";
|
|
5
|
+
import { RESERVED_WORDS, tryOrLog } from "./_shared.mjs";
|
|
6
6
|
const { getDocument } = AstUtils;
|
|
7
7
|
export const deploymentNodeChecks = (services) => {
|
|
8
8
|
const DeploymentsIndex = services.likec4.DeploymentsIndex;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isAncestor } from "@likec4/core";
|
|
2
|
-
import { elementRef } from "../utils/elementRef.
|
|
3
|
-
import { tryOrLog } from "./_shared.
|
|
2
|
+
import { elementRef } from "../utils/elementRef.mjs";
|
|
3
|
+
import { tryOrLog } from "./_shared.mjs";
|
|
4
4
|
export const dynamicViewStep = (services) => {
|
|
5
5
|
const fqnIndex = services.likec4.FqnIndex;
|
|
6
6
|
return tryOrLog((el, accept) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { isReferenceToDeploymentModel } from "../utils/index.
|
|
2
|
-
import { tryOrLog } from "./_shared.
|
|
1
|
+
import { isReferenceToDeploymentModel } from "../utils/index.mjs";
|
|
2
|
+
import { tryOrLog } from "./_shared.mjs";
|
|
3
3
|
export const checkElementRef = (services) => {
|
|
4
4
|
return tryOrLog((el, accept) => {
|
|
5
5
|
if (isReferenceToDeploymentModel(el.modelElement)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AstUtils } from "langium";
|
|
2
|
-
import { projectIdFrom } from "../utils/index.
|
|
3
|
-
import { RESERVED_WORDS, tryOrLog } from "./_shared.
|
|
2
|
+
import { projectIdFrom } from "../utils/index.mjs";
|
|
3
|
+
import { RESERVED_WORDS, tryOrLog } from "./_shared.mjs";
|
|
4
4
|
const { getDocument } = AstUtils;
|
|
5
5
|
export const checkElement = (services) => {
|
|
6
6
|
const fqnIndex = services.likec4.FqnIndex;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AstUtils } from "langium";
|
|
2
|
-
import { projectIdFrom } from "../utils/index.
|
|
3
|
-
import { tryOrLog } from "./_shared.
|
|
2
|
+
import { projectIdFrom } from "../utils/index.mjs";
|
|
3
|
+
import { tryOrLog } from "./_shared.mjs";
|
|
4
4
|
const { getDocument } = AstUtils;
|
|
5
5
|
export const checkImportsFromPoject = (services) => {
|
|
6
6
|
const projects = services.shared.workspace.ProjectsManager;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { DocumentState } from "langium";
|
|
2
2
|
import { isNullish } from "remeda";
|
|
3
3
|
import { DiagnosticSeverity } from "vscode-languageserver-types";
|
|
4
|
-
import { ast } from "../ast.
|
|
5
|
-
import { logger } from "../logger.
|
|
4
|
+
import { ast } from "../ast.mjs";
|
|
5
|
+
import { logger } from "../logger.mjs";
|
|
6
6
|
import {
|
|
7
7
|
deployedInstanceChecks,
|
|
8
8
|
deploymentNodeChecks,
|
|
9
9
|
deploymentRelationChecks,
|
|
10
10
|
extendDeploymentChecks
|
|
11
|
-
} from "./deployment-checks.
|
|
12
|
-
import { dynamicViewStep } from "./dynamic-view-step.
|
|
13
|
-
import { checkElement } from "./element.
|
|
14
|
-
import { checkElementRef } from "./element-ref.
|
|
15
|
-
import { checkImported, checkImportsFromPoject } from "./imports.
|
|
11
|
+
} from "./deployment-checks.mjs";
|
|
12
|
+
import { dynamicViewStep } from "./dynamic-view-step.mjs";
|
|
13
|
+
import { checkElement } from "./element.mjs";
|
|
14
|
+
import { checkElementRef } from "./element-ref.mjs";
|
|
15
|
+
import { checkImported, checkImportsFromPoject } from "./imports.mjs";
|
|
16
16
|
import {
|
|
17
17
|
colorLiteralRuleChecks,
|
|
18
18
|
iconPropertyRuleChecks,
|
|
19
19
|
notesPropertyRuleChecks,
|
|
20
20
|
opacityPropertyRuleChecks
|
|
21
|
-
} from "./property-checks.
|
|
22
|
-
import { checkRelationBody, relationChecks } from "./relation.
|
|
21
|
+
} from "./property-checks.mjs";
|
|
22
|
+
import { checkRelationBody, relationChecks } from "./relation.mjs";
|
|
23
23
|
import {
|
|
24
24
|
checkDeploymentNodeKind,
|
|
25
25
|
checkElementKind,
|
|
@@ -30,8 +30,8 @@ import {
|
|
|
30
30
|
checkRelationshipKind,
|
|
31
31
|
checkSpecificationRule,
|
|
32
32
|
checkTag
|
|
33
|
-
} from "./specification.
|
|
34
|
-
import { viewChecks } from "./view.
|
|
33
|
+
} from "./specification.mjs";
|
|
34
|
+
import { viewChecks } from "./view.mjs";
|
|
35
35
|
import {
|
|
36
36
|
checkFqnExprWith,
|
|
37
37
|
checkFqnRefExpr,
|
|
@@ -39,8 +39,8 @@ import {
|
|
|
39
39
|
checkOutgoingRelationExpr,
|
|
40
40
|
checkRelationExpr,
|
|
41
41
|
checkRelationExprWith
|
|
42
|
-
} from "./view-predicates/index.
|
|
43
|
-
export { LikeC4DocumentValidator } from "./DocumentValidator.
|
|
42
|
+
} from "./view-predicates/index.mjs";
|
|
43
|
+
export { LikeC4DocumentValidator } from "./DocumentValidator.mjs";
|
|
44
44
|
function validatableAstNodeGuards(predicates) {
|
|
45
45
|
return (n) => predicates.some((p) => p(n));
|
|
46
46
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { nonexhaustive } from "@likec4/core";
|
|
2
2
|
import { AstUtils } from "langium";
|
|
3
3
|
import { isNumber, isString } from "remeda";
|
|
4
|
-
import { ast } from "../ast.
|
|
5
|
-
import { tryOrLog } from "./_shared.
|
|
4
|
+
import { ast } from "../ast.mjs";
|
|
5
|
+
import { tryOrLog } from "./_shared.mjs";
|
|
6
6
|
export const opacityPropertyRuleChecks = (_) => {
|
|
7
7
|
return tryOrLog((node, accept) => {
|
|
8
8
|
const opacity = parseFloat(node.value);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FqnRef, isSameHierarchy } from "@likec4/core";
|
|
2
2
|
import { AstUtils } from "langium";
|
|
3
|
-
import { safeCall } from "../utils/index.
|
|
4
|
-
import { tryOrLog } from "./_shared.
|
|
3
|
+
import { safeCall } from "../utils/index.mjs";
|
|
4
|
+
import { tryOrLog } from "./_shared.mjs";
|
|
5
5
|
export const relationChecks = (services) => {
|
|
6
6
|
const modelParser = services.likec4.ModelParser;
|
|
7
7
|
return tryOrLog((el, accept) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AstUtils } from "langium";
|
|
2
|
-
import { ast } from "../ast.
|
|
3
|
-
import { projectIdFrom } from "../utils/index.
|
|
4
|
-
import { RESERVED_WORDS, tryOrLog } from "./_shared.
|
|
2
|
+
import { ast } from "../ast.mjs";
|
|
3
|
+
import { projectIdFrom } from "../utils/index.mjs";
|
|
4
|
+
import { RESERVED_WORDS, tryOrLog } from "./_shared.mjs";
|
|
5
5
|
export const checkSpecificationRule = (_) => {
|
|
6
6
|
return tryOrLog((node, accept) => {
|
|
7
7
|
if (node.$containerIndex && node.$containerIndex > 0) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { FqnExpr
|
|
1
|
+
import { FqnExpr } from "@likec4/core/types";
|
|
2
|
+
import { nonexhaustive } from "@likec4/core/utils";
|
|
2
3
|
import { AstUtils } from "langium";
|
|
3
|
-
import { getViewRulePredicateContainer } from "../../ast.
|
|
4
|
-
import { tryOrLog } from "../_shared.
|
|
4
|
+
import { getViewRulePredicateContainer } from "../../ast.mjs";
|
|
5
|
+
import { tryOrLog } from "../_shared.mjs";
|
|
5
6
|
export const checkFqnExprWith = (services) => {
|
|
6
7
|
const modelParser = services.likec4.ModelParser;
|
|
7
8
|
return tryOrLog((el, accept) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { FqnExpr, FqnRef } from "@likec4/core";
|
|
1
|
+
import { FqnExpr, FqnRef } from "@likec4/core/types";
|
|
2
2
|
import { AstUtils } from "langium";
|
|
3
3
|
import { isTruthy } from "remeda";
|
|
4
|
-
import { ast, getViewRulePredicateContainer, isFqnRefInsideDeployment } from "../../ast.
|
|
5
|
-
import { tryOrLog } from "../_shared.
|
|
4
|
+
import { ast, getViewRulePredicateContainer, isFqnRefInsideDeployment } from "../../ast.mjs";
|
|
5
|
+
import { tryOrLog } from "../_shared.mjs";
|
|
6
6
|
export const checkFqnRefExpr = (services) => {
|
|
7
7
|
const modelParser = services.likec4.ModelParser;
|
|
8
8
|
return tryOrLog((node, accept) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AstUtils } from "langium";
|
|
2
2
|
import { isNullish } from "remeda";
|
|
3
|
-
import { ast } from "../../ast.
|
|
4
|
-
import { tryOrLog } from "../_shared.
|
|
3
|
+
import { ast } from "../../ast.mjs";
|
|
4
|
+
import { tryOrLog } from "../_shared.mjs";
|
|
5
5
|
export const checkIncomingRelationExpr = (_services) => {
|
|
6
6
|
return tryOrLog((el, accept) => {
|
|
7
7
|
if (el.to.$type === "WildcardExpression" && !ast.isInOutRelationExpr(el.$container)) {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { checkFqnExprWith } from "./fqn-expr-with.mjs";
|
|
2
|
+
export { checkFqnRefExpr } from "./fqn-ref-expr.mjs";
|
|
3
|
+
export { checkIncomingRelationExpr } from "./incoming.mjs";
|
|
4
|
+
export { checkOutgoingRelationExpr } from "./outgoing.mjs";
|
|
5
|
+
export { checkRelationExpr } from "./relation-expr.mjs";
|
|
6
|
+
export { checkRelationExprWith } from "./relation-with.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AstUtils } from "langium";
|
|
2
2
|
import { isNullish } from "remeda";
|
|
3
|
-
import { ast, getViewRulePredicateContainer } from "../../ast.
|
|
4
|
-
import { tryOrLog } from "../_shared.
|
|
3
|
+
import { ast, getViewRulePredicateContainer } from "../../ast.mjs";
|
|
4
|
+
import { tryOrLog } from "../_shared.mjs";
|
|
5
5
|
export const checkOutgoingRelationExpr = (_services) => {
|
|
6
6
|
return tryOrLog((el, accept) => {
|
|
7
7
|
const viewRulePredicate = getViewRulePredicateContainer(el);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FqnExpr, RelationExpr } from "@likec4/core";
|
|
2
2
|
import { AstUtils } from "langium";
|
|
3
|
-
import { ast } from "../../ast.
|
|
4
|
-
import { tryOrLog } from "../_shared.
|
|
3
|
+
import { ast } from "../../ast.mjs";
|
|
4
|
+
import { tryOrLog } from "../_shared.mjs";
|
|
5
5
|
export const checkRelationExpr = (services) => {
|
|
6
6
|
const ModelParser = services.likec4.ModelParser;
|
|
7
7
|
return tryOrLog((node, accept) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getViewRulePredicateContainer } from "../../ast.
|
|
2
|
-
import { tryOrLog } from "../_shared.
|
|
1
|
+
import { getViewRulePredicateContainer } from "../../ast.mjs";
|
|
2
|
+
import { tryOrLog } from "../_shared.mjs";
|
|
3
3
|
export const checkRelationExprWith = (_services) => {
|
|
4
4
|
return tryOrLog((el, accept) => {
|
|
5
5
|
const container = getViewRulePredicateContainer(el);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ast } from "../ast.
|
|
2
|
-
import { projectIdFrom } from "../utils/index.
|
|
3
|
-
import { RESERVED_WORDS, tryOrLog } from "./_shared.
|
|
1
|
+
import { ast } from "../ast.mjs";
|
|
2
|
+
import { projectIdFrom } from "../utils/index.mjs";
|
|
3
|
+
import { RESERVED_WORDS, tryOrLog } from "./_shared.mjs";
|
|
4
4
|
export const viewChecks = (services) => {
|
|
5
5
|
const index = services.shared.workspace.IndexManager;
|
|
6
6
|
return tryOrLog((node, accept) => {
|
|
@@ -3,7 +3,7 @@ import { decode, encode } from "@msgpack/msgpack";
|
|
|
3
3
|
import { fromBase64, toBase64 } from "@smithy/util-base64";
|
|
4
4
|
import { AstUtils, CstUtils } from "langium";
|
|
5
5
|
import { mapValues } from "remeda";
|
|
6
|
-
import { logger, logWarnError } from "../logger.
|
|
6
|
+
import { logger, logWarnError } from "../logger.mjs";
|
|
7
7
|
const { getDocument } = AstUtils;
|
|
8
8
|
function pack({
|
|
9
9
|
nodes,
|
|
@@ -2,7 +2,7 @@ import { GraphvizWasmAdapter, QueueGraphvizLayoter } from "@likec4/layouts";
|
|
|
2
2
|
import { GraphvizBinaryAdapter } from "@likec4/layouts/graphviz/binary";
|
|
3
3
|
import { isEmpty } from "remeda";
|
|
4
4
|
import which from "which";
|
|
5
|
-
import { logger } from "../logger.
|
|
5
|
+
import { logger } from "../logger.mjs";
|
|
6
6
|
function graphvizBinPath() {
|
|
7
7
|
try {
|
|
8
8
|
return which.sync("dot");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DefaultLikeC4Views } from "./likec4-views.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { loggable } from "@likec4/log";
|
|
2
2
|
import { values } from "remeda";
|
|
3
|
-
import { logError, logger as rootLogger, logWarnError } from "../logger.
|
|
4
|
-
import { performanceMark } from "../utils/index.
|
|
3
|
+
import { logError, logger as rootLogger, logWarnError } from "../logger.mjs";
|
|
4
|
+
import { performanceMark } from "../utils/index.mjs";
|
|
5
5
|
const viewsLogger = rootLogger.getChild("views");
|
|
6
6
|
export class DefaultLikeC4Views {
|
|
7
7
|
constructor(services) {
|