@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.
Files changed (67) hide show
  1. package/package.json +19 -18
  2. package/dist/ast.d.ts +0 -72
  3. package/dist/ast.js +0 -133
  4. package/dist/builtin.d.ts +0 -4
  5. package/dist/builtin.js +0 -8
  6. package/dist/elementRef.d.ts +0 -6
  7. package/dist/elementRef.js +0 -39
  8. package/dist/generated/ast.d.ts +0 -359
  9. package/dist/generated/ast.js +0 -376
  10. package/dist/generated/grammar.d.ts +0 -6
  11. package/dist/generated/grammar.js +0 -2542
  12. package/dist/generated/module.d.ts +0 -9
  13. package/dist/generated/module.js +0 -26
  14. package/dist/index.d.ts +0 -4
  15. package/dist/index.js +0 -15
  16. package/dist/logger.d.ts +0 -8
  17. package/dist/logger.js +0 -20
  18. package/dist/lsp/DocumentSymbolProvider.d.ts +0 -20
  19. package/dist/lsp/DocumentSymbolProvider.js +0 -149
  20. package/dist/lsp/HoverProvider.d.ts +0 -8
  21. package/dist/lsp/HoverProvider.js +0 -54
  22. package/dist/lsp/SemanticTokenProvider.d.ts +0 -6
  23. package/dist/lsp/SemanticTokenProvider.js +0 -221
  24. package/dist/lsp/index.d.ts +0 -3
  25. package/dist/lsp/index.js +0 -3
  26. package/dist/model/fqn-index.d.ts +0 -17
  27. package/dist/model/fqn-index.js +0 -138
  28. package/dist/model/index.d.ts +0 -3
  29. package/dist/model/index.js +0 -3
  30. package/dist/model/model-builder.d.ts +0 -26
  31. package/dist/model/model-builder.js +0 -332
  32. package/dist/model/model-locator.d.ts +0 -16
  33. package/dist/model/model-locator.js +0 -108
  34. package/dist/module.d.ts +0 -18
  35. package/dist/module.js +0 -61
  36. package/dist/protocol.d.ts +0 -35
  37. package/dist/protocol.js +0 -19
  38. package/dist/references/index.d.ts +0 -2
  39. package/dist/references/index.js +0 -2
  40. package/dist/references/scope-computation.d.ts +0 -10
  41. package/dist/references/scope-computation.js +0 -76
  42. package/dist/references/scope-provider.d.ts +0 -15
  43. package/dist/references/scope-provider.js +0 -110
  44. package/dist/registerProtocolHandlers.d.ts +0 -2
  45. package/dist/registerProtocolHandlers.js +0 -49
  46. package/dist/shared/CodeLensProvider.d.ts +0 -8
  47. package/dist/shared/CodeLensProvider.js +0 -35
  48. package/dist/shared/WorkspaceManager.d.ts +0 -13
  49. package/dist/shared/WorkspaceManager.js +0 -19
  50. package/dist/shared/index.d.ts +0 -2
  51. package/dist/shared/index.js +0 -2
  52. package/dist/test/index.d.ts +0 -1
  53. package/dist/test/index.js +0 -1
  54. package/dist/test/testServices.d.ts +0 -15
  55. package/dist/test/testServices.js +0 -57
  56. package/dist/utils.d.ts +0 -2
  57. package/dist/utils.js +0 -7
  58. package/dist/validation/element.d.ts +0 -4
  59. package/dist/validation/element.js +0 -20
  60. package/dist/validation/index.d.ts +0 -2
  61. package/dist/validation/index.js +0 -22
  62. package/dist/validation/relation.d.ts +0 -4
  63. package/dist/validation/relation.js +0 -53
  64. package/dist/validation/specification.d.ts +0 -5
  65. package/dist/validation/specification.js +0 -33
  66. package/dist/validation/view.d.ts +0 -4
  67. 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
- };
@@ -1,4 +0,0 @@
1
- import type { ValidationCheck } from 'langium';
2
- import { ast } from '../ast';
3
- import type { LikeC4Services } from '../module';
4
- export declare const viewChecks: (services: LikeC4Services) => ValidationCheck<ast.ElementView>;
@@ -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
- };