@likec4/language-server 0.6.0 → 0.6.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/package.json +19 -18
- package/dist/ast.d.ts +0 -72
- package/dist/ast.js +0 -133
- package/dist/builtin.d.ts +0 -4
- package/dist/builtin.js +0 -8
- package/dist/elementRef.d.ts +0 -6
- package/dist/elementRef.js +0 -39
- package/dist/generated/ast.d.ts +0 -359
- package/dist/generated/ast.js +0 -376
- package/dist/generated/grammar.d.ts +0 -6
- package/dist/generated/grammar.js +0 -2542
- package/dist/generated/module.d.ts +0 -9
- package/dist/generated/module.js +0 -26
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -15
- package/dist/logger.d.ts +0 -8
- package/dist/logger.js +0 -20
- package/dist/lsp/DocumentSymbolProvider.d.ts +0 -20
- package/dist/lsp/DocumentSymbolProvider.js +0 -149
- package/dist/lsp/HoverProvider.d.ts +0 -8
- package/dist/lsp/HoverProvider.js +0 -54
- package/dist/lsp/SemanticTokenProvider.d.ts +0 -6
- package/dist/lsp/SemanticTokenProvider.js +0 -221
- package/dist/lsp/index.d.ts +0 -3
- package/dist/lsp/index.js +0 -3
- package/dist/model/fqn-index.d.ts +0 -17
- package/dist/model/fqn-index.js +0 -138
- package/dist/model/index.d.ts +0 -3
- package/dist/model/index.js +0 -3
- package/dist/model/model-builder.d.ts +0 -26
- package/dist/model/model-builder.js +0 -332
- package/dist/model/model-locator.d.ts +0 -16
- package/dist/model/model-locator.js +0 -108
- package/dist/module.d.ts +0 -18
- package/dist/module.js +0 -61
- package/dist/protocol.d.ts +0 -35
- package/dist/protocol.js +0 -19
- package/dist/references/index.d.ts +0 -2
- package/dist/references/index.js +0 -2
- package/dist/references/scope-computation.d.ts +0 -10
- package/dist/references/scope-computation.js +0 -76
- package/dist/references/scope-provider.d.ts +0 -15
- package/dist/references/scope-provider.js +0 -110
- package/dist/registerProtocolHandlers.d.ts +0 -2
- package/dist/registerProtocolHandlers.js +0 -49
- package/dist/shared/CodeLensProvider.d.ts +0 -8
- package/dist/shared/CodeLensProvider.js +0 -35
- package/dist/shared/WorkspaceManager.d.ts +0 -13
- package/dist/shared/WorkspaceManager.js +0 -19
- package/dist/shared/index.d.ts +0 -2
- package/dist/shared/index.js +0 -2
- package/dist/test/index.d.ts +0 -1
- package/dist/test/index.js +0 -1
- package/dist/test/testServices.d.ts +0 -15
- package/dist/test/testServices.js +0 -57
- package/dist/utils.d.ts +0 -2
- package/dist/utils.js +0 -7
- package/dist/validation/element.d.ts +0 -4
- package/dist/validation/element.js +0 -20
- package/dist/validation/index.d.ts +0 -2
- package/dist/validation/index.js +0 -22
- package/dist/validation/relation.d.ts +0 -4
- package/dist/validation/relation.js +0 -53
- package/dist/validation/specification.d.ts +0 -5
- package/dist/validation/specification.js +0 -33
- package/dist/validation/view.d.ts +0 -4
- package/dist/validation/view.js +0 -20
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { resolveRelationPoints } from '../ast';
|
|
2
|
-
import { isSameHierarchy } from '@likec4/core/utils';
|
|
3
|
-
export const relationChecks = (services) => {
|
|
4
|
-
const fqnIndex = services.likec4.FqnIndex;
|
|
5
|
-
return (el, accept) => {
|
|
6
|
-
try {
|
|
7
|
-
const coupling = resolveRelationPoints(el);
|
|
8
|
-
const target = fqnIndex.get(coupling.target);
|
|
9
|
-
if (!target) {
|
|
10
|
-
return accept('error', 'Invalid target', {
|
|
11
|
-
node: el,
|
|
12
|
-
property: 'target'
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
const source = fqnIndex.get(coupling.source);
|
|
16
|
-
if (!source) {
|
|
17
|
-
return accept('error', 'Invalid source', {
|
|
18
|
-
node: el
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
if (isSameHierarchy(source, target)) {
|
|
22
|
-
return accept('error', 'Invalid relation (same hierarchy)', {
|
|
23
|
-
node: el
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
if (e instanceof Error) {
|
|
29
|
-
return accept('error', e.message, {
|
|
30
|
-
node: el
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
accept('error', 'Invalid relation', {
|
|
34
|
-
node: el
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
// const fqn = fqnIndex.get(el)
|
|
38
|
-
// if (!fqn) {
|
|
39
|
-
// accept('error', 'Not indexed', {
|
|
40
|
-
// node: el,
|
|
41
|
-
// property: 'name',
|
|
42
|
-
// })
|
|
43
|
-
// return
|
|
44
|
-
// }
|
|
45
|
-
// const withSameFqn = fqnIndex.byFqn(fqn)
|
|
46
|
-
// if (withSameFqn.length > 1) {
|
|
47
|
-
// accept('error', `Duplicate element name ${el.name !== fqn ? el.name +' (' + fqn + ')' : el.name}`, {
|
|
48
|
-
// node: el,
|
|
49
|
-
// property: 'name',
|
|
50
|
-
// })
|
|
51
|
-
// }
|
|
52
|
-
};
|
|
53
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ValidationCheck } from 'langium';
|
|
2
|
-
import { ast } from '../ast';
|
|
3
|
-
import type { LikeC4Services } from '../module';
|
|
4
|
-
export declare const elementKindChecks: (services: LikeC4Services) => ValidationCheck<ast.ElementKind>;
|
|
5
|
-
export declare const tagChecks: (services: LikeC4Services) => ValidationCheck<ast.Tag>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { ast } from '../ast';
|
|
2
|
-
export const elementKindChecks = (services) => {
|
|
3
|
-
const index = services.shared.workspace.IndexManager;
|
|
4
|
-
return (node, accept) => {
|
|
5
|
-
const sameKinds = index
|
|
6
|
-
.allElements(ast.ElementKind)
|
|
7
|
-
.filter(n => n.name === node.name)
|
|
8
|
-
.limit(2)
|
|
9
|
-
.count();
|
|
10
|
-
if (sameKinds > 1) {
|
|
11
|
-
accept('error', `Duplicate element kind '${node.name}'`, {
|
|
12
|
-
node: node,
|
|
13
|
-
property: 'name'
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export const tagChecks = (services) => {
|
|
19
|
-
const index = services.shared.workspace.IndexManager;
|
|
20
|
-
return (node, accept) => {
|
|
21
|
-
const sameKinds = index
|
|
22
|
-
.allElements(ast.Tag)
|
|
23
|
-
.filter(n => n.name === node.name)
|
|
24
|
-
.limit(2)
|
|
25
|
-
.count();
|
|
26
|
-
if (sameKinds > 1) {
|
|
27
|
-
accept('error', `Duplicate tag '${node.name}'`, {
|
|
28
|
-
node: node,
|
|
29
|
-
property: 'name'
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
};
|
package/dist/validation/view.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ast } from '../ast';
|
|
2
|
-
export const viewChecks = (services) => {
|
|
3
|
-
const index = services.shared.workspace.IndexManager;
|
|
4
|
-
return (el, accept) => {
|
|
5
|
-
if (!el.name) {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
const anotherViews = index
|
|
9
|
-
.allElements(ast.View)
|
|
10
|
-
.filter(n => n.name === el.name)
|
|
11
|
-
.limit(2)
|
|
12
|
-
.count();
|
|
13
|
-
if (anotherViews > 1) {
|
|
14
|
-
accept('error', `Duplicate view '${el.name}'`, {
|
|
15
|
-
node: el,
|
|
16
|
-
property: 'name'
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
};
|