@likec4/language-server 1.1.1 → 1.2.1
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.monarch.ts +4 -4
- package/contrib/likec4.tmLanguage.json +1 -1
- package/package.json +8 -10
- package/src/Rpc.ts +108 -0
- package/src/ast.ts +443 -0
- package/src/browser/index.ts +30 -0
- package/src/elementRef.ts +26 -0
- package/src/generated/ast.ts +1632 -0
- package/src/generated/grammar.ts +10 -0
- package/src/generated/module.ts +32 -0
- package/src/index.ts +4 -0
- package/src/like-c4.langium +395 -0
- package/src/logger.ts +54 -0
- package/src/lsp/CodeLensProvider.ts +51 -0
- package/src/lsp/DocumentHighlightProvider.ts +12 -0
- package/src/lsp/DocumentLinkProvider.test.ts +66 -0
- package/src/lsp/DocumentLinkProvider.ts +53 -0
- package/src/lsp/DocumentSymbolProvider.ts +201 -0
- package/src/lsp/HoverProvider.ts +58 -0
- package/{dist/lsp/SemanticTokenProvider.js → src/lsp/SemanticTokenProvider.ts} +58 -43
- package/src/lsp/index.ts +6 -0
- package/src/model/fqn-computation.ts +47 -0
- package/src/model/fqn-index.ts +161 -0
- package/src/model/index.ts +5 -0
- package/src/model/model-builder.ts +447 -0
- package/src/model/model-locator.ts +130 -0
- package/src/model/model-parser.ts +580 -0
- package/src/model-change/ModelChanges.ts +120 -0
- package/src/model-change/changeElementStyle.ts +176 -0
- package/src/model-change/changeViewLayout.ts +41 -0
- package/src/module.ts +197 -0
- package/src/node/index.ts +20 -0
- package/src/protocol.ts +87 -0
- package/src/references/index.ts +2 -0
- package/src/references/scope-computation.ts +142 -0
- package/src/references/scope-provider.ts +166 -0
- package/src/shared/NodeKindProvider.ts +67 -0
- package/src/shared/WorkspaceManager.ts +39 -0
- package/src/shared/WorkspaceSymbolProvider.ts +3 -0
- package/src/shared/index.ts +3 -0
- package/src/test/index.ts +1 -0
- package/src/test/testServices.ts +119 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/printDocs.ts +3 -0
- package/src/utils/stringHash.ts +6 -0
- package/src/validation/dynamic-view-rule.ts +35 -0
- package/src/validation/dynamic-view-step.ts +39 -0
- package/src/validation/element.ts +52 -0
- package/{dist/validation/index.js → src/validation/index.ts} +25 -17
- package/src/validation/property-checks.ts +17 -0
- package/src/validation/relation.ts +57 -0
- package/src/validation/specification.ts +118 -0
- package/src/validation/view-predicates/custom-element-expr.ts +21 -0
- package/src/validation/view-predicates/expanded-element.ts +34 -0
- package/src/validation/view-predicates/incoming.ts +19 -0
- package/src/validation/view-predicates/index.ts +4 -0
- package/src/validation/view-predicates/outgoing.ts +19 -0
- package/src/validation/view.ts +26 -0
- package/src/view-utils/assignNavigateTo.ts +30 -0
- package/src/view-utils/index.ts +3 -0
- package/src/view-utils/resolve-extended-views.ts +57 -0
- package/src/view-utils/resolve-relative-paths.ts +84 -0
- package/dist/Rpc.d.ts +0 -10
- package/dist/Rpc.js +0 -98
- package/dist/ast.d.ts +0 -133
- package/dist/ast.js +0 -267
- package/dist/browser/index.d.ts +0 -9
- package/dist/browser/index.js +0 -16
- package/dist/elementRef.d.ts +0 -12
- package/dist/elementRef.js +0 -15
- package/dist/generated/ast.d.ts +0 -559
- package/dist/generated/ast.js +0 -868
- package/dist/generated/grammar.d.ts +0 -7
- package/dist/generated/grammar.js +0 -3
- package/dist/generated/module.d.ts +0 -14
- package/dist/generated/module.js +0 -22
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -2
- package/dist/logger.d.ts +0 -12
- package/dist/logger.js +0 -51
- package/dist/lsp/CodeLensProvider.d.ts +0 -10
- package/dist/lsp/CodeLensProvider.js +0 -37
- package/dist/lsp/DocumentHighlightProvider.d.ts +0 -10
- package/dist/lsp/DocumentHighlightProvider.js +0 -10
- package/dist/lsp/DocumentLinkProvider.d.ts +0 -11
- package/dist/lsp/DocumentLinkProvider.js +0 -41
- package/dist/lsp/DocumentLinkProvider.test.d.ts +0 -2
- package/dist/lsp/DocumentLinkProvider.test.js +0 -54
- package/dist/lsp/DocumentSymbolProvider.d.ts +0 -22
- package/dist/lsp/DocumentSymbolProvider.js +0 -184
- package/dist/lsp/HoverProvider.d.ts +0 -10
- package/dist/lsp/HoverProvider.js +0 -36
- package/dist/lsp/SemanticTokenProvider.d.ts +0 -8
- package/dist/lsp/index.d.ts +0 -7
- package/dist/lsp/index.js +0 -6
- package/dist/model/fqn-computation.d.ts +0 -4
- package/dist/model/fqn-computation.js +0 -43
- package/dist/model/fqn-index.d.ts +0 -26
- package/dist/model/fqn-index.js +0 -114
- package/dist/model/index.d.ts +0 -6
- package/dist/model/index.js +0 -5
- package/dist/model/model-builder.d.ts +0 -20
- package/dist/model/model-builder.js +0 -352
- package/dist/model/model-locator.d.ts +0 -22
- package/dist/model/model-locator.js +0 -119
- package/dist/model/model-parser.d.ts +0 -27
- package/dist/model/model-parser.js +0 -410
- package/dist/model-change/ModelChanges.d.ts +0 -15
- package/dist/model-change/ModelChanges.js +0 -100
- package/dist/model-change/changeElementStyle.d.ts +0 -15
- package/dist/model-change/changeElementStyle.js +0 -141
- package/dist/model-change/changeViewLayout.d.ts +0 -13
- package/dist/model-change/changeViewLayout.js +0 -30
- package/dist/module.d.ts +0 -59
- package/dist/module.js +0 -121
- package/dist/node/index.d.ts +0 -6
- package/dist/node/index.js +0 -13
- package/dist/protocol.d.ts +0 -58
- package/dist/protocol.js +0 -14
- package/dist/references/index.d.ts +0 -3
- package/dist/references/index.js +0 -2
- package/dist/references/scope-computation.d.ts +0 -11
- package/dist/references/scope-computation.js +0 -108
- package/dist/references/scope-provider.d.ts +0 -18
- package/dist/references/scope-provider.js +0 -136
- package/dist/shared/NodeKindProvider.d.ts +0 -16
- package/dist/shared/NodeKindProvider.js +0 -58
- package/dist/shared/WorkspaceManager.d.ts +0 -17
- package/dist/shared/WorkspaceManager.js +0 -29
- package/dist/shared/WorkspaceSymbolProvider.d.ts +0 -4
- package/dist/shared/WorkspaceSymbolProvider.js +0 -3
- package/dist/shared/index.d.ts +0 -4
- package/dist/shared/index.js +0 -3
- package/dist/test/index.d.ts +0 -2
- package/dist/test/index.js +0 -1
- package/dist/test/testServices.d.ts +0 -23
- package/dist/test/testServices.js +0 -102
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +0 -1
- package/dist/utils/printDocs.d.ts +0 -3
- package/dist/utils/printDocs.js +0 -1
- package/dist/utils/stringHash.d.ts +0 -2
- package/dist/utils/stringHash.js +0 -5
- package/dist/validation/element.d.ts +0 -6
- package/dist/validation/element.js +0 -38
- package/dist/validation/index.d.ts +0 -3
- package/dist/validation/property-checks.d.ts +0 -5
- package/dist/validation/property-checks.js +0 -11
- package/dist/validation/relation.d.ts +0 -5
- package/dist/validation/relation.js +0 -50
- package/dist/validation/specification.d.ts +0 -10
- package/dist/validation/specification.js +0 -97
- package/dist/validation/view-predicates/custom-element-expr.d.ts +0 -5
- package/dist/validation/view-predicates/custom-element-expr.js +0 -16
- package/dist/validation/view-predicates/expanded-element.d.ts +0 -5
- package/dist/validation/view-predicates/expanded-element.js +0 -28
- package/dist/validation/view-predicates/incoming.d.ts +0 -5
- package/dist/validation/view-predicates/incoming.js +0 -14
- package/dist/validation/view-predicates/index.d.ts +0 -5
- package/dist/validation/view-predicates/index.js +0 -4
- package/dist/validation/view-predicates/outgoing.d.ts +0 -5
- package/dist/validation/view-predicates/outgoing.js +0 -14
- package/dist/validation/view.d.ts +0 -5
- package/dist/validation/view.js +0 -18
- package/dist/view-utils/assignNavigateTo.d.ts +0 -3
- package/dist/view-utils/assignNavigateTo.js +0 -23
- package/dist/view-utils/index.d.ts +0 -4
- package/dist/view-utils/index.js +0 -3
- package/dist/view-utils/resolve-extended-views.d.ts +0 -7
- package/dist/view-utils/resolve-extended-views.js +0 -41
- package/dist/view-utils/resolve-relative-paths.d.ts +0 -3
- package/dist/view-utils/resolve-relative-paths.js +0 -76
- /package/{dist → src}/reset.d.ts +0 -0
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { invariant } from "@likec4/core";
|
|
2
|
-
import { GrammarUtils } from "langium";
|
|
3
|
-
import { last } from "remeda";
|
|
4
|
-
import { TextEdit } from "vscode-languageserver-protocol";
|
|
5
|
-
import { ast, toAstViewLayoutDirection } from "../ast.js";
|
|
6
|
-
const { findNodeForProperty } = GrammarUtils;
|
|
7
|
-
export function changeViewLayout(services, {
|
|
8
|
-
view,
|
|
9
|
-
viewAst,
|
|
10
|
-
layout
|
|
11
|
-
}) {
|
|
12
|
-
const viewCstNode = viewAst.$cstNode;
|
|
13
|
-
invariant(viewCstNode, "viewCstNode");
|
|
14
|
-
const newlayout = toAstViewLayoutDirection(layout);
|
|
15
|
-
const existingRule = viewAst.body.rules.findLast(ast.isViewRuleAutoLayout);
|
|
16
|
-
if (existingRule && existingRule.$cstNode) {
|
|
17
|
-
const directionCstNode = findNodeForProperty(existingRule.$cstNode, "direction");
|
|
18
|
-
if (directionCstNode) {
|
|
19
|
-
return [TextEdit.replace(directionCstNode.range, newlayout)];
|
|
20
|
-
}
|
|
21
|
-
return [TextEdit.replace(existingRule.$cstNode.range, `autoLayout ${newlayout}`)];
|
|
22
|
-
}
|
|
23
|
-
const insertPos = last(viewAst.body.rules)?.$cstNode?.range.end ?? last(viewAst.body.props)?.$cstNode?.range.end ?? viewAst.body.$cstNode?.range.start;
|
|
24
|
-
invariant(insertPos, "insertPos is not defined");
|
|
25
|
-
const indent = " ".repeat(2 + viewCstNode.range.start.character);
|
|
26
|
-
const insert = `
|
|
27
|
-
|
|
28
|
-
${indent}autoLayout ${newlayout}`;
|
|
29
|
-
return [TextEdit.insert(insertPos, insert)];
|
|
30
|
-
}
|
package/dist/module.d.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { type Module, WorkspaceCache } from 'langium';
|
|
2
|
-
import { type DefaultSharedModuleContext, type LangiumServices, type LangiumSharedServices, type PartialLangiumServices } from 'langium/lsp';
|
|
3
|
-
import { LikeC4CodeLensProvider, LikeC4DocumentHighlightProvider, LikeC4DocumentLinkProvider, LikeC4DocumentSymbolProvider, LikeC4HoverProvider, LikeC4SemanticTokenProvider } from './lsp';
|
|
4
|
-
import { FqnIndex, LikeC4ModelBuilder, LikeC4ModelLocator, LikeC4ModelParser } from './model';
|
|
5
|
-
import { LikeC4ModelChanges } from './model-change/ModelChanges';
|
|
6
|
-
import { LikeC4ScopeComputation, LikeC4ScopeProvider } from './references';
|
|
7
|
-
import { Rpc } from './Rpc';
|
|
8
|
-
import { LikeC4WorkspaceManager, NodeKindProvider, WorkspaceSymbolProvider } from './shared';
|
|
9
|
-
interface LikeC4AddedSharedServices {
|
|
10
|
-
lsp: {
|
|
11
|
-
NodeKindProvider: NodeKindProvider;
|
|
12
|
-
WorkspaceSymbolProvider: WorkspaceSymbolProvider;
|
|
13
|
-
};
|
|
14
|
-
workspace: {
|
|
15
|
-
WorkspaceManager: LikeC4WorkspaceManager;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export type LikeC4SharedServices = LangiumSharedServices & LikeC4AddedSharedServices;
|
|
19
|
-
/**
|
|
20
|
-
* Declaration of custom services - add your own service classes here.
|
|
21
|
-
*/
|
|
22
|
-
export interface LikeC4AddedServices {
|
|
23
|
-
WorkspaceCache: WorkspaceCache<string, any>;
|
|
24
|
-
Rpc: Rpc;
|
|
25
|
-
likec4: {
|
|
26
|
-
FqnIndex: FqnIndex;
|
|
27
|
-
ModelParser: LikeC4ModelParser;
|
|
28
|
-
ModelBuilder: LikeC4ModelBuilder;
|
|
29
|
-
ModelLocator: LikeC4ModelLocator;
|
|
30
|
-
ModelChanges: LikeC4ModelChanges;
|
|
31
|
-
};
|
|
32
|
-
lsp: {
|
|
33
|
-
DocumentHighlightProvider: LikeC4DocumentHighlightProvider;
|
|
34
|
-
DocumentSymbolProvider: LikeC4DocumentSymbolProvider;
|
|
35
|
-
SemanticTokenProvider: LikeC4SemanticTokenProvider;
|
|
36
|
-
HoverProvider: LikeC4HoverProvider;
|
|
37
|
-
CodeLensProvider: LikeC4CodeLensProvider;
|
|
38
|
-
DocumentLinkProvider: LikeC4DocumentLinkProvider;
|
|
39
|
-
};
|
|
40
|
-
references: {
|
|
41
|
-
ScopeComputation: LikeC4ScopeComputation;
|
|
42
|
-
ScopeProvider: LikeC4ScopeProvider;
|
|
43
|
-
};
|
|
44
|
-
shared?: LikeC4SharedServices;
|
|
45
|
-
}
|
|
46
|
-
export type LikeC4Services = LangiumServices & LikeC4AddedServices;
|
|
47
|
-
export declare const LikeC4Module: Module<LikeC4Services, PartialLangiumServices & LikeC4AddedServices>;
|
|
48
|
-
export type LanguageServicesContext = Partial<DefaultSharedModuleContext>;
|
|
49
|
-
export declare function createCustomLanguageServices<I1, I2, I3, I extends I1 & I2 & I3 & LikeC4Services>(context: LanguageServicesContext, module: Module<I, I1>, module2?: Module<I, I2>, module3?: Module<I, I3>): {
|
|
50
|
-
shared: LikeC4SharedServices;
|
|
51
|
-
likec4: I;
|
|
52
|
-
};
|
|
53
|
-
export declare function createSharedServices(context?: LanguageServicesContext): LikeC4SharedServices;
|
|
54
|
-
export declare function createLanguageServices(context?: LanguageServicesContext): {
|
|
55
|
-
shared: LikeC4SharedServices;
|
|
56
|
-
likec4: LikeC4Services;
|
|
57
|
-
};
|
|
58
|
-
export {};
|
|
59
|
-
//# sourceMappingURL=module.d.ts.map
|
package/dist/module.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { normalizeError } from "@likec4/core";
|
|
2
|
-
import { EmptyFileSystem, inject, WorkspaceCache } from "langium";
|
|
3
|
-
import {
|
|
4
|
-
createDefaultModule,
|
|
5
|
-
createDefaultSharedModule
|
|
6
|
-
} from "langium/lsp";
|
|
7
|
-
import { LikeC4GeneratedModule, LikeC4GeneratedSharedModule } from "./generated/module.js";
|
|
8
|
-
import { logger } from "./logger.js";
|
|
9
|
-
import {
|
|
10
|
-
LikeC4CodeLensProvider,
|
|
11
|
-
LikeC4DocumentHighlightProvider,
|
|
12
|
-
LikeC4DocumentLinkProvider,
|
|
13
|
-
LikeC4DocumentSymbolProvider,
|
|
14
|
-
LikeC4HoverProvider,
|
|
15
|
-
LikeC4SemanticTokenProvider
|
|
16
|
-
} from "./lsp/index.js";
|
|
17
|
-
import { FqnIndex, LikeC4ModelBuilder, LikeC4ModelLocator, LikeC4ModelParser } from "./model/index.js";
|
|
18
|
-
import { LikeC4ModelChanges } from "./model-change/ModelChanges.js";
|
|
19
|
-
import { LikeC4ScopeComputation, LikeC4ScopeProvider } from "./references/index.js";
|
|
20
|
-
import { Rpc } from "./Rpc.js";
|
|
21
|
-
import { LikeC4WorkspaceManager, NodeKindProvider, WorkspaceSymbolProvider } from "./shared/index.js";
|
|
22
|
-
import { registerValidationChecks } from "./validation/index.js";
|
|
23
|
-
const LikeC4SharedModule = {
|
|
24
|
-
lsp: {
|
|
25
|
-
NodeKindProvider: (services) => new NodeKindProvider(services),
|
|
26
|
-
WorkspaceSymbolProvider: (services) => new WorkspaceSymbolProvider(services)
|
|
27
|
-
},
|
|
28
|
-
workspace: {
|
|
29
|
-
WorkspaceManager: (services) => new LikeC4WorkspaceManager(services)
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
function bind(Type) {
|
|
33
|
-
return (services) => new Type(services);
|
|
34
|
-
}
|
|
35
|
-
export const LikeC4Module = {
|
|
36
|
-
WorkspaceCache: (services) => new WorkspaceCache(services.shared),
|
|
37
|
-
Rpc: bind(Rpc),
|
|
38
|
-
likec4: {
|
|
39
|
-
ModelChanges: bind(LikeC4ModelChanges),
|
|
40
|
-
FqnIndex: bind(FqnIndex),
|
|
41
|
-
ModelParser: bind(LikeC4ModelParser),
|
|
42
|
-
ModelBuilder: bind(LikeC4ModelBuilder),
|
|
43
|
-
ModelLocator: bind(LikeC4ModelLocator)
|
|
44
|
-
},
|
|
45
|
-
lsp: {
|
|
46
|
-
DocumentHighlightProvider: bind(LikeC4DocumentHighlightProvider),
|
|
47
|
-
DocumentSymbolProvider: bind(LikeC4DocumentSymbolProvider),
|
|
48
|
-
SemanticTokenProvider: bind(LikeC4SemanticTokenProvider),
|
|
49
|
-
HoverProvider: bind(LikeC4HoverProvider),
|
|
50
|
-
CodeLensProvider: bind(LikeC4CodeLensProvider),
|
|
51
|
-
DocumentLinkProvider: bind(LikeC4DocumentLinkProvider)
|
|
52
|
-
},
|
|
53
|
-
references: {
|
|
54
|
-
ScopeComputation: bind(LikeC4ScopeComputation),
|
|
55
|
-
ScopeProvider: bind(LikeC4ScopeProvider)
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
export function createCustomLanguageServices(context, module, module2, module3) {
|
|
59
|
-
const shared = createSharedServices(context);
|
|
60
|
-
const modules = [
|
|
61
|
-
createDefaultModule({ shared }),
|
|
62
|
-
LikeC4GeneratedModule,
|
|
63
|
-
LikeC4Module,
|
|
64
|
-
module,
|
|
65
|
-
module2,
|
|
66
|
-
module3
|
|
67
|
-
].reduce(_merge, {});
|
|
68
|
-
const likec4 = inject(modules);
|
|
69
|
-
shared.ServiceRegistry.register(likec4);
|
|
70
|
-
registerValidationChecks(likec4);
|
|
71
|
-
likec4.Rpc.init();
|
|
72
|
-
return { shared, likec4 };
|
|
73
|
-
}
|
|
74
|
-
export function createSharedServices(context = {}) {
|
|
75
|
-
const connection = context.connection;
|
|
76
|
-
if (connection) {
|
|
77
|
-
const original = logger.error.bind(logger);
|
|
78
|
-
logger.error = (arg) => {
|
|
79
|
-
if (typeof arg === "string") {
|
|
80
|
-
original(arg);
|
|
81
|
-
connection.telemetry.logEvent({ eventName: "error", error: arg });
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
const error = normalizeError(arg);
|
|
85
|
-
original(error);
|
|
86
|
-
connection.telemetry.logEvent({ eventName: "error", error: error.stack ?? error.message });
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
const moduleContext = {
|
|
90
|
-
...EmptyFileSystem,
|
|
91
|
-
...context
|
|
92
|
-
};
|
|
93
|
-
return inject(
|
|
94
|
-
createDefaultSharedModule(moduleContext),
|
|
95
|
-
LikeC4GeneratedSharedModule,
|
|
96
|
-
LikeC4SharedModule
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
export function createLanguageServices(context = {}) {
|
|
100
|
-
const shared = createSharedServices(context);
|
|
101
|
-
const likec4 = inject(createDefaultModule({ shared }), LikeC4GeneratedModule, LikeC4Module);
|
|
102
|
-
shared.ServiceRegistry.register(likec4);
|
|
103
|
-
registerValidationChecks(likec4);
|
|
104
|
-
likec4.Rpc.init();
|
|
105
|
-
return { shared, likec4 };
|
|
106
|
-
}
|
|
107
|
-
function _merge(target, source) {
|
|
108
|
-
if (source) {
|
|
109
|
-
for (const [key, value2] of Object.entries(source)) {
|
|
110
|
-
if (value2 !== void 0) {
|
|
111
|
-
const value1 = target[key];
|
|
112
|
-
if (value1 !== null && value2 !== null && typeof value1 === "object" && typeof value2 === "object") {
|
|
113
|
-
target[key] = _merge(value1, value2);
|
|
114
|
-
} else {
|
|
115
|
-
target[key] = value2;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return target;
|
|
121
|
-
}
|
package/dist/node/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare function startLanguageServer(): {
|
|
2
|
-
connection: import("vscode-languageserver/node")._Connection<import("vscode-languageserver/node")._, import("vscode-languageserver/node")._, import("vscode-languageserver/node")._, import("vscode-languageserver/node")._, import("vscode-languageserver/node")._, import("vscode-languageserver/node")._, import("vscode-languageserver/lib/common/inlineCompletion.proposed").InlineCompletionFeatureShape, import("vscode-languageserver/node")._>;
|
|
3
|
-
shared: import("../module").LikeC4SharedServices;
|
|
4
|
-
likec4: import("../module").LikeC4Services;
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { startLanguageServer as startLanguim } from "langium/lsp";
|
|
2
|
-
import { NodeFileSystem } from "langium/node";
|
|
3
|
-
import { createConnection, ProposedFeatures } from "vscode-languageserver/node";
|
|
4
|
-
import { createLanguageServices } from "../module.js";
|
|
5
|
-
export function startLanguageServer() {
|
|
6
|
-
const connection = createConnection(ProposedFeatures.all);
|
|
7
|
-
const services = createLanguageServices({ connection, ...NodeFileSystem });
|
|
8
|
-
startLanguim(services.shared);
|
|
9
|
-
return {
|
|
10
|
-
...services,
|
|
11
|
-
connection
|
|
12
|
-
};
|
|
13
|
-
}
|
package/dist/protocol.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { AutoLayoutDirection, BorderStyle, ComputedView, ElementShape, Fqn, LikeC4ComputedModel, LikeC4Model, NonEmptyArray, RelationID, ThemeColor, ViewID } from '@likec4/core';
|
|
2
|
-
import type { DocumentUri, Location } from 'vscode-languageserver-protocol';
|
|
3
|
-
import { NotificationType, RequestType, RequestType0 } from 'vscode-languageserver-protocol';
|
|
4
|
-
export declare const onDidChangeModel: NotificationType<string>;
|
|
5
|
-
export type OnDidChangeModelNotification = typeof onDidChangeModel;
|
|
6
|
-
export declare const fetchModel: RequestType0<{
|
|
7
|
-
model: LikeC4Model | null;
|
|
8
|
-
}, void>;
|
|
9
|
-
export type FetchModelRequest = typeof fetchModel;
|
|
10
|
-
export declare const fetchComputedModel: RequestType0<{
|
|
11
|
-
model: LikeC4ComputedModel | null;
|
|
12
|
-
}, void>;
|
|
13
|
-
export type FetchComputedModelRequest = typeof fetchComputedModel;
|
|
14
|
-
export declare const computeView: RequestType<{
|
|
15
|
-
viewId: ViewID;
|
|
16
|
-
}, {
|
|
17
|
-
view: ComputedView | null;
|
|
18
|
-
}, void>;
|
|
19
|
-
export type ComputeViewRequest = typeof computeView;
|
|
20
|
-
export interface BuildDocumentsParams {
|
|
21
|
-
docs: DocumentUri[];
|
|
22
|
-
}
|
|
23
|
-
export declare const buildDocuments: RequestType<BuildDocumentsParams, void, void>;
|
|
24
|
-
export type BuildDocumentsRequest = typeof buildDocuments;
|
|
25
|
-
export type LocateParams = {
|
|
26
|
-
element: Fqn;
|
|
27
|
-
property?: string;
|
|
28
|
-
} | {
|
|
29
|
-
relation: RelationID;
|
|
30
|
-
} | {
|
|
31
|
-
view: ViewID;
|
|
32
|
-
};
|
|
33
|
-
export declare const locate: RequestType<LocateParams, Location | null, void>;
|
|
34
|
-
export type LocateRequest = typeof locate;
|
|
35
|
-
export declare namespace ChangeView {
|
|
36
|
-
interface ChangeAutoLayout {
|
|
37
|
-
op: 'change-autolayout';
|
|
38
|
-
layout: AutoLayoutDirection;
|
|
39
|
-
}
|
|
40
|
-
interface ChangeElementStyle {
|
|
41
|
-
op: 'change-element-style';
|
|
42
|
-
style: {
|
|
43
|
-
border?: BorderStyle;
|
|
44
|
-
opacity?: number;
|
|
45
|
-
shape?: ElementShape;
|
|
46
|
-
color?: ThemeColor;
|
|
47
|
-
};
|
|
48
|
-
targets: NonEmptyArray<Fqn>;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
export type ChangeView = ChangeView.ChangeAutoLayout | ChangeView.ChangeElementStyle;
|
|
52
|
-
export interface ChangeViewRequestParams {
|
|
53
|
-
viewId: ViewID;
|
|
54
|
-
changes: NonEmptyArray<ChangeView>;
|
|
55
|
-
}
|
|
56
|
-
export declare const changeView: RequestType<ChangeViewRequestParams, Location | null, void>;
|
|
57
|
-
export type ChangeViewRequest = typeof changeView;
|
|
58
|
-
//# sourceMappingURL=protocol.d.ts.map
|
package/dist/protocol.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { NotificationType, RequestType, RequestType0 } from "vscode-languageserver-protocol";
|
|
2
|
-
export const onDidChangeModel = new NotificationType("likec4/onDidChangeModel");
|
|
3
|
-
export const fetchModel = new RequestType0(
|
|
4
|
-
"likec4/fetchModel"
|
|
5
|
-
);
|
|
6
|
-
export const fetchComputedModel = new RequestType0(
|
|
7
|
-
"likec4/fetchComputedModel"
|
|
8
|
-
);
|
|
9
|
-
export const computeView = new RequestType(
|
|
10
|
-
"likec4/computeView"
|
|
11
|
-
);
|
|
12
|
-
export const buildDocuments = new RequestType("likec4/build");
|
|
13
|
-
export const locate = new RequestType("likec4/locate");
|
|
14
|
-
export const changeView = new RequestType("likec4/change-view");
|
package/dist/references/index.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type AstNodeDescription, DefaultScopeComputation, MultiMap, type PrecomputedScopes } from 'langium';
|
|
2
|
-
import type { CancellationToken } from 'vscode-languageserver';
|
|
3
|
-
import { ast, type LikeC4LangiumDocument } from '../ast';
|
|
4
|
-
type ElementsContainer = ast.Model | ast.ElementBody | ast.ExtendElementBody;
|
|
5
|
-
export declare class LikeC4ScopeComputation extends DefaultScopeComputation {
|
|
6
|
-
computeExports(document: LikeC4LangiumDocument, _cancelToken?: CancellationToken): Promise<AstNodeDescription[]>;
|
|
7
|
-
computeLocalScopes(document: LikeC4LangiumDocument, _cancelToken?: CancellationToken): Promise<PrecomputedScopes>;
|
|
8
|
-
protected processContainer(container: ElementsContainer, scopes: PrecomputedScopes, document: LikeC4LangiumDocument): MultiMap<string, AstNodeDescription>;
|
|
9
|
-
}
|
|
10
|
-
export {};
|
|
11
|
-
//# sourceMappingURL=scope-computation.d.ts.map
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DefaultScopeComputation,
|
|
3
|
-
MultiMap
|
|
4
|
-
} from "langium";
|
|
5
|
-
import { isTruthy } from "remeda";
|
|
6
|
-
import { ast } from "../ast.js";
|
|
7
|
-
import { logError } from "../logger.js";
|
|
8
|
-
export class LikeC4ScopeComputation extends DefaultScopeComputation {
|
|
9
|
-
computeExports(document, _cancelToken) {
|
|
10
|
-
return new Promise((resolve) => {
|
|
11
|
-
const docExports = [];
|
|
12
|
-
const { specifications, models, views } = document.parseResult.value;
|
|
13
|
-
try {
|
|
14
|
-
for (const spec of specifications.flatMap((s) => [...s.elements, ...s.relationships])) {
|
|
15
|
-
if (spec.kind && isTruthy(spec.kind.name)) {
|
|
16
|
-
docExports.push(
|
|
17
|
-
this.descriptions.createDescription(spec.kind, spec.kind.name, document)
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
} catch (e) {
|
|
22
|
-
logError(e);
|
|
23
|
-
}
|
|
24
|
-
try {
|
|
25
|
-
for (const spec of specifications.flatMap((s) => s.tags)) {
|
|
26
|
-
if (spec.tag && isTruthy(spec.tag.name)) {
|
|
27
|
-
docExports.push(
|
|
28
|
-
this.descriptions.createDescription(spec.tag, "#" + spec.tag.name, document)
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
} catch (e) {
|
|
33
|
-
logError(e);
|
|
34
|
-
}
|
|
35
|
-
try {
|
|
36
|
-
for (const elAst of models.flatMap((m) => m.elements)) {
|
|
37
|
-
if (ast.isElement(elAst) && isTruthy(elAst.name)) {
|
|
38
|
-
docExports.push(this.descriptions.createDescription(elAst, elAst.name, document));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
} catch (e) {
|
|
42
|
-
logError(e);
|
|
43
|
-
}
|
|
44
|
-
try {
|
|
45
|
-
for (const viewAst of views.flatMap((v) => v.views)) {
|
|
46
|
-
if (isTruthy(viewAst.name)) {
|
|
47
|
-
docExports.push(this.descriptions.createDescription(viewAst, viewAst.name, document));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
} catch (e) {
|
|
51
|
-
logError(e);
|
|
52
|
-
}
|
|
53
|
-
resolve(docExports);
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
computeLocalScopes(document, _cancelToken) {
|
|
57
|
-
return new Promise((resolve) => {
|
|
58
|
-
const root = document.parseResult.value;
|
|
59
|
-
const scopes = new MultiMap();
|
|
60
|
-
for (const model of root.models) {
|
|
61
|
-
try {
|
|
62
|
-
const nested = this.processContainer(model, scopes, document);
|
|
63
|
-
scopes.addAll(root, nested.values());
|
|
64
|
-
} catch (e) {
|
|
65
|
-
logError(e);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
resolve(scopes);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
processContainer(container, scopes, document) {
|
|
72
|
-
const localScope = new MultiMap();
|
|
73
|
-
const nestedScopes = new MultiMap();
|
|
74
|
-
for (const el of container.elements) {
|
|
75
|
-
if (ast.isRelation(el)) {
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
let subcontainer;
|
|
79
|
-
if (ast.isElement(el)) {
|
|
80
|
-
if (isTruthy(el.name)) {
|
|
81
|
-
localScope.add(el.name, this.descriptions.createDescription(el, el.name, document));
|
|
82
|
-
}
|
|
83
|
-
subcontainer = el.body;
|
|
84
|
-
} else if (ast.isExtendElement(el)) {
|
|
85
|
-
subcontainer = el.body;
|
|
86
|
-
}
|
|
87
|
-
if (subcontainer && subcontainer.elements.length > 0) {
|
|
88
|
-
try {
|
|
89
|
-
const nested = this.processContainer(subcontainer, scopes, document);
|
|
90
|
-
for (const [nestedName, desc] of nested) {
|
|
91
|
-
nestedScopes.add(nestedName, desc);
|
|
92
|
-
}
|
|
93
|
-
} catch (e) {
|
|
94
|
-
logError(e);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
if (nestedScopes.size > 0) {
|
|
99
|
-
for (const [name, descriptions] of nestedScopes.entriesGroupedByKey()) {
|
|
100
|
-
if (!localScope.has(name) && descriptions.length === 1) {
|
|
101
|
-
localScope.add(name, descriptions[0]);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
scopes.addAll(container, localScope.values());
|
|
106
|
-
return localScope;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DefaultScopeProvider, type ReferenceInfo, type Scope } from 'langium';
|
|
2
|
-
import type { LikeC4Services } from '../module';
|
|
3
|
-
export declare class LikeC4ScopeProvider extends DefaultScopeProvider {
|
|
4
|
-
private fqnIndex;
|
|
5
|
-
constructor(services: LikeC4Services);
|
|
6
|
-
private directChildrenOf;
|
|
7
|
-
private uniqueDescedants;
|
|
8
|
-
private scopeElementRef;
|
|
9
|
-
private scopeExtendElement;
|
|
10
|
-
private scopeElementView;
|
|
11
|
-
getScope(context: ReferenceInfo): Scope;
|
|
12
|
-
protected computeScope(context: ReferenceInfo): Scope;
|
|
13
|
-
/**
|
|
14
|
-
* Create a global scope filtered for the given reference type.
|
|
15
|
-
*/
|
|
16
|
-
protected getGlobalScope(referenceType: string): Scope;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=scope-provider.d.ts.map
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AstUtils,
|
|
3
|
-
CstUtils,
|
|
4
|
-
DefaultScopeProvider,
|
|
5
|
-
DONE_RESULT,
|
|
6
|
-
EMPTY_STREAM,
|
|
7
|
-
GrammarUtils,
|
|
8
|
-
stream,
|
|
9
|
-
StreamImpl,
|
|
10
|
-
StreamScope
|
|
11
|
-
} from "langium";
|
|
12
|
-
import { ast } from "../ast.js";
|
|
13
|
-
import { elementRef, getFqnElementRef } from "../elementRef.js";
|
|
14
|
-
import { logError } from "../logger.js";
|
|
15
|
-
const { findNodeForProperty } = GrammarUtils;
|
|
16
|
-
const { toDocumentSegment } = CstUtils;
|
|
17
|
-
const { getDocument } = AstUtils;
|
|
18
|
-
function toAstNodeDescription(entry) {
|
|
19
|
-
const $cstNode = findNodeForProperty(entry.el.$cstNode, "name");
|
|
20
|
-
return {
|
|
21
|
-
documentUri: entry.doc.uri,
|
|
22
|
-
name: entry.name,
|
|
23
|
-
...entry.el.$cstNode && {
|
|
24
|
-
selectionSegment: toDocumentSegment(entry.el.$cstNode)
|
|
25
|
-
},
|
|
26
|
-
...$cstNode && {
|
|
27
|
-
nameSegment: toDocumentSegment($cstNode)
|
|
28
|
-
},
|
|
29
|
-
path: entry.path,
|
|
30
|
-
type: ast.Element
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export class LikeC4ScopeProvider extends DefaultScopeProvider {
|
|
34
|
-
fqnIndex;
|
|
35
|
-
constructor(services) {
|
|
36
|
-
super(services);
|
|
37
|
-
this.fqnIndex = services.likec4.FqnIndex;
|
|
38
|
-
}
|
|
39
|
-
directChildrenOf(parent) {
|
|
40
|
-
return this.fqnIndex.directChildrenOf(parent).map(toAstNodeDescription);
|
|
41
|
-
}
|
|
42
|
-
// we need lazy resolving here
|
|
43
|
-
uniqueDescedants(of) {
|
|
44
|
-
return new StreamImpl(
|
|
45
|
-
() => {
|
|
46
|
-
const element = of();
|
|
47
|
-
const fqn = element && this.fqnIndex.getFqn(element);
|
|
48
|
-
if (fqn) {
|
|
49
|
-
return this.fqnIndex.uniqueDescedants(fqn).map(toAstNodeDescription).iterator();
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
},
|
|
53
|
-
(iterator) => {
|
|
54
|
-
if (iterator) {
|
|
55
|
-
return iterator.next();
|
|
56
|
-
}
|
|
57
|
-
return DONE_RESULT;
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
scopeElementRef(ref) {
|
|
62
|
-
return this.uniqueDescedants(() => ref.el.ref);
|
|
63
|
-
}
|
|
64
|
-
scopeExtendElement({ element }) {
|
|
65
|
-
return stream([element.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(() => elementRef(element)));
|
|
66
|
-
}
|
|
67
|
-
scopeElementView({ viewOf, extends: ext }) {
|
|
68
|
-
if (viewOf) {
|
|
69
|
-
return stream([viewOf.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(() => elementRef(viewOf)));
|
|
70
|
-
}
|
|
71
|
-
if (ext) {
|
|
72
|
-
return stream([ext]).flatMap((v) => {
|
|
73
|
-
const view = v.view.ref;
|
|
74
|
-
return view ? this.scopeElementView(view) : EMPTY_STREAM;
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
return EMPTY_STREAM;
|
|
78
|
-
}
|
|
79
|
-
getScope(context) {
|
|
80
|
-
const referenceType = this.reflection.getReferenceType(context);
|
|
81
|
-
try {
|
|
82
|
-
const container = context.container;
|
|
83
|
-
if (ast.isFqnElementRef(container) && context.property === "el") {
|
|
84
|
-
const parent = container.parent;
|
|
85
|
-
if (!parent) {
|
|
86
|
-
return this.getGlobalScope(referenceType);
|
|
87
|
-
}
|
|
88
|
-
return new StreamScope(this.directChildrenOf(getFqnElementRef(parent)));
|
|
89
|
-
}
|
|
90
|
-
if (ast.isElementRef(container) && context.property === "el") {
|
|
91
|
-
const parent = container.parent;
|
|
92
|
-
if (parent) {
|
|
93
|
-
return new StreamScope(this.scopeElementRef(parent));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
return this.computeScope(context);
|
|
97
|
-
} catch (e) {
|
|
98
|
-
logError(e);
|
|
99
|
-
return this.getGlobalScope(referenceType);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
computeScope(context) {
|
|
103
|
-
const referenceType = this.reflection.getReferenceType(context);
|
|
104
|
-
const scopes = [];
|
|
105
|
-
const doc = getDocument(context.container);
|
|
106
|
-
const precomputed = doc.precomputedScopes;
|
|
107
|
-
if (precomputed) {
|
|
108
|
-
const byReferenceType = (desc) => this.reflection.isSubtype(desc.type, referenceType);
|
|
109
|
-
let container = context.container;
|
|
110
|
-
while (container) {
|
|
111
|
-
const elements = precomputed.get(container).filter(byReferenceType);
|
|
112
|
-
if (elements.length > 0) {
|
|
113
|
-
scopes.push(stream(elements));
|
|
114
|
-
}
|
|
115
|
-
if (referenceType === ast.Element) {
|
|
116
|
-
if (ast.isExtendElementBody(container)) {
|
|
117
|
-
scopes.push(this.scopeExtendElement(container.$container));
|
|
118
|
-
}
|
|
119
|
-
if (ast.isElementViewBody(container)) {
|
|
120
|
-
scopes.push(this.scopeElementView(container.$container));
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
container = container.$container;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return scopes.reduceRight((outerScope, elements) => {
|
|
127
|
-
return this.createScope(elements, outerScope);
|
|
128
|
-
}, this.getGlobalScope(referenceType));
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Create a global scope filtered for the given reference type.
|
|
132
|
-
*/
|
|
133
|
-
getGlobalScope(referenceType) {
|
|
134
|
-
return new StreamScope(this.indexManager.allElements(referenceType));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type AstNode, type AstNodeDescription } from 'langium';
|
|
2
|
-
import type { LangiumSharedServices, NodeKindProvider as LspNodeKindProvider } from 'langium/lsp';
|
|
3
|
-
import { CompletionItemKind, SymbolKind } from 'vscode-languageserver-protocol';
|
|
4
|
-
export declare class NodeKindProvider implements LspNodeKindProvider {
|
|
5
|
-
private services;
|
|
6
|
-
constructor(services: LangiumSharedServices);
|
|
7
|
-
/**
|
|
8
|
-
* Returns a `SymbolKind` as used by `WorkspaceSymbolProvider` or `DocumentSymbolProvider`.
|
|
9
|
-
*/
|
|
10
|
-
getSymbolKind(node: AstNode | AstNodeDescription): SymbolKind;
|
|
11
|
-
/**
|
|
12
|
-
* Returns a `CompletionItemKind` as used by the `CompletionProvider`.
|
|
13
|
-
*/
|
|
14
|
-
getCompletionItemKind(node: AstNode | AstNodeDescription): CompletionItemKind;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=NodeKindProvider.d.ts.map
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { CompletionItemKind, SymbolKind } from "vscode-languageserver-protocol";
|
|
2
|
-
import { ast } from "../ast.js";
|
|
3
|
-
export class NodeKindProvider {
|
|
4
|
-
constructor(services) {
|
|
5
|
-
this.services = services;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Returns a `SymbolKind` as used by `WorkspaceSymbolProvider` or `DocumentSymbolProvider`.
|
|
9
|
-
*/
|
|
10
|
-
// prettier-ignore
|
|
11
|
-
getSymbolKind(node) {
|
|
12
|
-
const hasType = (type) => "type" in node && this.services.AstReflection.isSubtype(node.type, type);
|
|
13
|
-
switch (true) {
|
|
14
|
-
case (ast.isElement(node) || hasType(ast.Element) || (ast.isExtendElement(node) || hasType(ast.ExtendElement))): {
|
|
15
|
-
return SymbolKind.Constructor;
|
|
16
|
-
}
|
|
17
|
-
case (ast.isModel(node) || ast.isModelViews(node) || ast.isSpecificationRule(node) || hasType(ast.Model) || hasType(ast.ModelViews) || hasType(ast.SpecificationRule)): {
|
|
18
|
-
return SymbolKind.Namespace;
|
|
19
|
-
}
|
|
20
|
-
case (ast.isElementView(node) || hasType(ast.ElementView)): {
|
|
21
|
-
return SymbolKind.Class;
|
|
22
|
-
}
|
|
23
|
-
case (ast.isTag(node) || hasType(ast.Tag) || (ast.isSpecificationTag(node) || hasType(ast.SpecificationTag))): {
|
|
24
|
-
return SymbolKind.EnumMember;
|
|
25
|
-
}
|
|
26
|
-
case (ast.isRelationshipKind(node) || hasType(ast.RelationshipKind) || (ast.isSpecificationRelationshipKind(node) || hasType(ast.SpecificationRelationshipKind))): {
|
|
27
|
-
return SymbolKind.Event;
|
|
28
|
-
}
|
|
29
|
-
case (ast.isElementKind(node) || hasType(ast.ElementKind) || (ast.isSpecificationElementKind(node) || hasType(ast.SpecificationElementKind))): {
|
|
30
|
-
return SymbolKind.TypeParameter;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return SymbolKind.Constant;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Returns a `CompletionItemKind` as used by the `CompletionProvider`.
|
|
37
|
-
*/
|
|
38
|
-
getCompletionItemKind(node) {
|
|
39
|
-
switch (this.getSymbolKind(node)) {
|
|
40
|
-
case SymbolKind.Constructor:
|
|
41
|
-
return CompletionItemKind.Constructor;
|
|
42
|
-
case SymbolKind.Namespace:
|
|
43
|
-
return CompletionItemKind.Module;
|
|
44
|
-
case SymbolKind.Class:
|
|
45
|
-
return CompletionItemKind.Class;
|
|
46
|
-
case SymbolKind.EnumMember:
|
|
47
|
-
return CompletionItemKind.EnumMember;
|
|
48
|
-
case SymbolKind.TypeParameter:
|
|
49
|
-
return CompletionItemKind.TypeParameter;
|
|
50
|
-
case SymbolKind.Interface:
|
|
51
|
-
return CompletionItemKind.Interface;
|
|
52
|
-
case SymbolKind.Event:
|
|
53
|
-
return CompletionItemKind.Event;
|
|
54
|
-
default:
|
|
55
|
-
return CompletionItemKind.Keyword;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|