@likec4/language-server 0.6.3 → 0.8.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.
Files changed (69) hide show
  1. package/dist/ast.d.ts +4 -2
  2. package/dist/ast.js +13 -3
  3. package/dist/builtin.d.ts +1 -0
  4. package/dist/builtin.js +1 -0
  5. package/dist/elementRef.d.ts +2 -1
  6. package/dist/elementRef.js +1 -0
  7. package/dist/generated/ast.d.ts +8 -3
  8. package/dist/generated/ast.js +14 -1
  9. package/dist/generated/grammar.d.ts +2 -1
  10. package/dist/generated/grammar.js +43 -37
  11. package/dist/generated/module.d.ts +2 -1
  12. package/dist/generated/module.js +2 -1
  13. package/dist/index.d.ts +2 -0
  14. package/dist/index.js +2 -0
  15. package/dist/logger.d.ts +1 -0
  16. package/dist/logger.js +1 -0
  17. package/dist/lsp/DocumentSymbolProvider.d.ts +2 -1
  18. package/dist/lsp/DocumentSymbolProvider.js +29 -11
  19. package/dist/lsp/HoverProvider.d.ts +2 -1
  20. package/dist/lsp/HoverProvider.js +1 -0
  21. package/dist/lsp/SemanticTokenProvider.d.ts +1 -0
  22. package/dist/lsp/SemanticTokenProvider.js +2 -1
  23. package/dist/lsp/index.d.ts +1 -0
  24. package/dist/lsp/index.js +1 -0
  25. package/dist/model/fqn-index.d.ts +35 -11
  26. package/dist/model/fqn-index.js +72 -91
  27. package/dist/model/index.d.ts +1 -0
  28. package/dist/model/index.js +1 -0
  29. package/dist/model/model-builder.d.ts +1 -0
  30. package/dist/model/model-builder.js +12 -5
  31. package/dist/model/model-locator.d.ts +2 -1
  32. package/dist/model/model-locator.js +24 -16
  33. package/dist/module.d.ts +1 -0
  34. package/dist/module.js +1 -0
  35. package/dist/protocol.d.ts +37 -0
  36. package/dist/protocol.js +20 -0
  37. package/dist/references/fqn-computation.d.ts +4 -0
  38. package/dist/references/fqn-computation.js +41 -0
  39. package/dist/references/index.d.ts +1 -0
  40. package/dist/references/index.js +1 -0
  41. package/dist/references/scope-computation.d.ts +5 -1
  42. package/dist/references/scope-computation.js +13 -3
  43. package/dist/references/scope-provider.d.ts +4 -0
  44. package/dist/references/scope-provider.js +40 -30
  45. package/dist/registerProtocolHandlers.d.ts +1 -0
  46. package/dist/registerProtocolHandlers.js +7 -6
  47. package/dist/shared/CodeLensProvider.d.ts +2 -1
  48. package/dist/shared/CodeLensProvider.js +1 -0
  49. package/dist/shared/WorkspaceManager.d.ts +3 -2
  50. package/dist/shared/WorkspaceManager.js +3 -4
  51. package/dist/shared/index.d.ts +1 -0
  52. package/dist/shared/index.js +1 -0
  53. package/dist/test/index.d.ts +2 -0
  54. package/dist/test/index.js +2 -0
  55. package/dist/test/testServices.d.ts +16 -0
  56. package/dist/test/testServices.js +58 -0
  57. package/dist/utils.d.ts +1 -0
  58. package/dist/utils.js +1 -0
  59. package/dist/validation/element.d.ts +1 -0
  60. package/dist/validation/element.js +3 -2
  61. package/dist/validation/index.d.ts +1 -0
  62. package/dist/validation/index.js +1 -0
  63. package/dist/validation/relation.d.ts +1 -0
  64. package/dist/validation/relation.js +1 -0
  65. package/dist/validation/specification.d.ts +1 -0
  66. package/dist/validation/specification.js +1 -0
  67. package/dist/validation/view.d.ts +1 -0
  68. package/dist/validation/view.js +1 -0
  69. package/package.json +26 -31
@@ -1,22 +1,34 @@
1
- import { DONE_RESULT, DefaultScopeProvider, EMPTY_SCOPE, StreamImpl, StreamScope, getDocument, stream, EMPTY_STREAM } from 'langium';
1
+ import { DONE_RESULT, DefaultScopeProvider, EMPTY_STREAM, StreamImpl, StreamScope, getDocument, stream } from 'langium';
2
2
  import { ast } from '../ast';
3
- import { elementRef, isElementRefHead, parentStrictElementRef, strictElementRefFqn } from '../elementRef';
3
+ import { elementRef, isElementRefHead, parentStrictElementRef } from '../elementRef';
4
+ import { logger } from '../logger';
5
+ function toAstNodeDescription(entry) {
6
+ return {
7
+ documentUri: entry.doc.uri,
8
+ name: entry.name,
9
+ path: entry.path,
10
+ type: ast.Element
11
+ };
12
+ }
4
13
  export class LikeC4ScopeProvider extends DefaultScopeProvider {
5
14
  fqnIndex;
6
15
  constructor(services) {
7
16
  super(services);
8
17
  this.fqnIndex = services.likec4.FqnIndex;
9
18
  }
10
- scopeElementRef(ref) {
11
- const parentNode = ref.$container;
12
- if (!ast.isElementRef(parentNode)) {
13
- throw new Error('Expected be inside ElementRef');
14
- }
19
+ directChildrenOf(parent) {
20
+ return this.fqnIndex
21
+ .directChildrenOf(parent)
22
+ .map(toAstNodeDescription);
23
+ }
24
+ uniqueDescedants(of) {
15
25
  return new StreamImpl(() => {
16
- const parent = parentNode.el.ref;
17
- const fqn = parent && this.fqnIndex.get(parent);
26
+ const element = of();
27
+ const fqn = element && this.fqnIndex.get(element);
18
28
  if (fqn) {
19
- return this.fqnIndex.uniqueDescedants(fqn).iterator();
29
+ return this.fqnIndex.uniqueDescedants(fqn)
30
+ .map(toAstNodeDescription)
31
+ .iterator();
20
32
  }
21
33
  return null;
22
34
  }, iterator => {
@@ -26,27 +38,25 @@ export class LikeC4ScopeProvider extends DefaultScopeProvider {
26
38
  return DONE_RESULT;
27
39
  });
28
40
  }
41
+ scopeElementRef(ref) {
42
+ const parentNode = ref.$container;
43
+ if (!ast.isElementRef(parentNode)) {
44
+ throw new Error('Expected be inside ElementRef');
45
+ }
46
+ return this.uniqueDescedants(() => parentNode.el.ref);
47
+ }
48
+ scopeExtendElement(extend) {
49
+ return this.uniqueDescedants(() => elementRef(extend.element));
50
+ }
29
51
  scopeElementView({ viewOf }) {
30
52
  if (!viewOf) {
31
53
  return EMPTY_STREAM;
32
54
  }
33
- return new StreamImpl(() => {
34
- const target = elementRef(viewOf);
35
- const fqn = target && this.fqnIndex.get(target);
36
- if (fqn) {
37
- return this.fqnIndex.uniqueDescedants(fqn).iterator();
38
- }
39
- return null;
40
- }, iterator => {
41
- if (iterator) {
42
- return iterator.next();
43
- }
44
- return DONE_RESULT;
45
- });
55
+ return this.uniqueDescedants(() => elementRef(viewOf));
46
56
  }
47
57
  getScope(context) {
58
+ const referenceType = this.reflection.getReferenceType(context);
48
59
  try {
49
- const referenceType = this.reflection.getReferenceType(context);
50
60
  const node = context.container;
51
61
  // const path = this.services.workspace.AstNodeLocator.getAstNodePath(node)
52
62
  if (referenceType === ast.Element) {
@@ -55,7 +65,7 @@ export class LikeC4ScopeProvider extends DefaultScopeProvider {
55
65
  return this.getGlobalScope(referenceType);
56
66
  }
57
67
  const parent = parentStrictElementRef(node);
58
- return new StreamScope(this.fqnIndex.directChildrenOf(parent));
68
+ return new StreamScope(this.directChildrenOf(parent));
59
69
  }
60
70
  if (ast.isElementRef(node) && !isElementRefHead(node)) {
61
71
  return new StreamScope(this.scopeElementRef(node));
@@ -64,9 +74,9 @@ export class LikeC4ScopeProvider extends DefaultScopeProvider {
64
74
  return this.computeScope(node, referenceType);
65
75
  }
66
76
  catch (e) {
67
- console.error(e);
68
- // logger.error(e)
69
- return EMPTY_SCOPE;
77
+ // console.error(e)
78
+ logger.error(e);
79
+ return this.getGlobalScope(referenceType);
70
80
  }
71
81
  }
72
82
  computeScope(node, referenceType) {
@@ -87,8 +97,7 @@ export class LikeC4ScopeProvider extends DefaultScopeProvider {
87
97
  }
88
98
  if (referenceType === ast.Element) {
89
99
  if (ast.isExtendElementBody(container)) {
90
- const extendsOf = strictElementRefFqn(container.$container.element);
91
- scopes.push(this.fqnIndex.uniqueDescedants(extendsOf));
100
+ scopes.push(this.scopeExtendElement(container.$container));
92
101
  }
93
102
  if (ast.isViewRule(container)) {
94
103
  scopes.push(this.scopeElementView(container.$container));
@@ -108,3 +117,4 @@ export class LikeC4ScopeProvider extends DefaultScopeProvider {
108
117
  return new StreamScope(this.indexManager.allElements(referenceType));
109
118
  }
110
119
  }
120
+ //# sourceMappingURL=scope-provider.js.map
@@ -1,2 +1,3 @@
1
1
  import type { LikeC4Services } from './module';
2
2
  export declare function registerProtocolHandlers(services: LikeC4Services): void;
3
+ //# sourceMappingURL=registerProtocolHandlers.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { logger } from './logger';
2
- import { buildDocuments, fetchLikeC4Model, locateElement, locateRelation, locateView } from '@likec4/language-protocol';
2
+ import { Rpc } from './protocol';
3
3
  export function registerProtocolHandlers(services) {
4
4
  const connection = services.shared.lsp.Connection;
5
5
  if (!connection) {
@@ -8,7 +8,7 @@ export function registerProtocolHandlers(services) {
8
8
  const modelBuilder = services.likec4.ModelBuilder;
9
9
  const modelLocator = services.likec4.ModelLocator;
10
10
  const LangiumDocuments = services.shared.workspace.LangiumDocuments;
11
- connection.onRequest(fetchLikeC4Model, async (_cancelToken) => {
11
+ connection.onRequest(Rpc.fetchModel, async (_cancelToken) => {
12
12
  let model;
13
13
  try {
14
14
  model = modelBuilder.buildModel() ?? null;
@@ -21,7 +21,7 @@ export function registerProtocolHandlers(services) {
21
21
  model: model ?? null
22
22
  });
23
23
  });
24
- connection.onRequest(buildDocuments, async (docs, cancelToken) => {
24
+ connection.onRequest(Rpc.buildDocuments, async ({ docs }, cancelToken) => {
25
25
  const changed = [];
26
26
  for (const d of docs) {
27
27
  const uri = d;
@@ -37,7 +37,7 @@ export function registerProtocolHandlers(services) {
37
37
  ]`);
38
38
  await services.shared.workspace.DocumentBuilder.update(changed, [], cancelToken);
39
39
  });
40
- connection.onRequest(locateElement, async ({ element, property }, _cancelToken) => {
40
+ connection.onRequest(Rpc.locateElement, async ({ element, property }, _cancelToken) => {
41
41
  try {
42
42
  return Promise.resolve(modelLocator.locateElement(element, property ?? 'name'));
43
43
  }
@@ -45,7 +45,7 @@ export function registerProtocolHandlers(services) {
45
45
  return Promise.reject(e);
46
46
  }
47
47
  });
48
- connection.onRequest(locateRelation, ({ id }, _cancelToken) => {
48
+ connection.onRequest(Rpc.locateRelation, ({ id }, _cancelToken) => {
49
49
  try {
50
50
  return Promise.resolve(modelLocator.locateRelation(id));
51
51
  }
@@ -53,7 +53,7 @@ export function registerProtocolHandlers(services) {
53
53
  return Promise.reject(e);
54
54
  }
55
55
  });
56
- connection.onRequest(locateView, ({ id }, _cancelToken) => {
56
+ connection.onRequest(Rpc.locateView, ({ id }, _cancelToken) => {
57
57
  try {
58
58
  return Promise.resolve(modelLocator.locateView(id));
59
59
  }
@@ -62,3 +62,4 @@ export function registerProtocolHandlers(services) {
62
62
  }
63
63
  });
64
64
  }
65
+ //# sourceMappingURL=registerProtocolHandlers.js.map
@@ -1,8 +1,9 @@
1
1
  import type { LangiumDocument, LangiumSharedServices, MaybePromise } from 'langium';
2
2
  import type { CodeLensProvider } from 'langium/lib/lsp/code-lens-provider';
3
- import type { CancellationToken, CodeLens, CodeLensParams } from 'vscode-languageserver-protocol';
3
+ import type { CancellationToken, CodeLens, CodeLensParams } from 'vscode-languageserver';
4
4
  export declare class LikeC4CodeLensProvider implements CodeLensProvider {
5
5
  private services;
6
6
  constructor(services: LangiumSharedServices);
7
7
  provideCodeLens(doc: LangiumDocument, _params: CodeLensParams, _cancelToken?: CancellationToken): MaybePromise<CodeLens[] | undefined>;
8
8
  }
9
+ //# sourceMappingURL=CodeLensProvider.d.ts.map
@@ -33,3 +33,4 @@ export class LikeC4CodeLensProvider {
33
33
  });
34
34
  }
35
35
  }
36
+ //# sourceMappingURL=CodeLensProvider.js.map
@@ -1,6 +1,6 @@
1
1
  import type { LangiumDocument, LangiumDocumentFactory, LangiumSharedServices } from 'langium';
2
2
  import { DefaultWorkspaceManager } from 'langium';
3
- import type { WorkspaceFolder } from 'vscode-languageserver-protocol';
3
+ import type { WorkspaceFolder } from 'vscode-languageserver';
4
4
  export declare class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
5
5
  protected readonly documentFactory: LangiumDocumentFactory;
6
6
  constructor(services: LangiumSharedServices);
@@ -9,5 +9,6 @@ export declare class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
9
9
  * folders and add them to the collector. This can be used to include built-in libraries of
10
10
  * your language, which can be either loaded from provided files or constructed in memory.
11
11
  */
12
- protected loadAdditionalDocuments(folders: WorkspaceFolder[], collector: (document: LangiumDocument) => void): Promise<void>;
12
+ protected loadAdditionalDocuments(_folders: WorkspaceFolder[], _collector: (document: LangiumDocument) => void): Promise<void>;
13
13
  }
14
+ //# sourceMappingURL=WorkspaceManager.d.ts.map
@@ -1,6 +1,4 @@
1
1
  import { DefaultWorkspaceManager } from 'langium';
2
- import { URI } from 'vscode-uri';
3
- import * as builtin from '../builtin';
4
2
  export class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
5
3
  documentFactory;
6
4
  constructor(services) {
@@ -12,8 +10,9 @@ export class LikeC4WorkspaceManager extends DefaultWorkspaceManager {
12
10
  * folders and add them to the collector. This can be used to include built-in libraries of
13
11
  * your language, which can be either loaded from provided files or constructed in memory.
14
12
  */
15
- loadAdditionalDocuments(folders, collector) {
16
- collector(this.documentFactory.fromString(builtin.specification.document, URI.parse(builtin.specification.uri)));
13
+ loadAdditionalDocuments(_folders, _collector) {
14
+ // collector(this.documentFactory.fromString(builtin.specification.document, URI.parse(builtin.specification.uri)))
17
15
  return Promise.resolve();
18
16
  }
19
17
  }
18
+ //# sourceMappingURL=WorkspaceManager.js.map
@@ -1,2 +1,3 @@
1
1
  export * from './CodeLensProvider';
2
2
  export * from './WorkspaceManager';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,3 @@
1
1
  export * from './CodeLensProvider';
2
2
  export * from './WorkspaceManager';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,2 @@
1
+ export * from './testServices';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,2 @@
1
+ export * from './testServices';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,16 @@
1
+ import type { LikeC4LangiumDocument } from '../ast';
2
+ export declare function createTestServices(): {
3
+ services: import("../module").LikeC4Services;
4
+ parse: (input: string, uri?: string) => Promise<LikeC4LangiumDocument>;
5
+ validate: (input: string | LikeC4LangiumDocument) => Promise<{
6
+ document: LikeC4LangiumDocument;
7
+ diagnostics: import("vscode-languageserver-types").Diagnostic[];
8
+ errors: string[];
9
+ }>;
10
+ validateAll: () => Promise<{
11
+ diagnostics: import("vscode-languageserver-types").Diagnostic[];
12
+ errors: string[];
13
+ }>;
14
+ buildModel: () => Promise<import("@likec4/core").LikeC4Model>;
15
+ };
16
+ //# sourceMappingURL=testServices.d.ts.map
@@ -0,0 +1,58 @@
1
+ import { createLanguageServices } from '../module';
2
+ import { EmptyFileSystem } from 'langium';
3
+ import { URI } from 'vscode-uri';
4
+ export function createTestServices() {
5
+ const services = createLanguageServices(EmptyFileSystem).likec4;
6
+ const metaData = services.LanguageMetaData;
7
+ const langiumDocuments = services.shared.workspace.LangiumDocuments;
8
+ const documentBuilder = services.shared.workspace.DocumentBuilder;
9
+ const modelBuilder = services.likec4.ModelBuilder;
10
+ const initPromise = services.shared.workspace.WorkspaceManager.initializeWorkspace([]);
11
+ let documentIndex = 1;
12
+ const parse = async (input, uri) => {
13
+ await initPromise;
14
+ uri = uri ?? `${documentIndex++}${metaData.fileExtensions[0]}`;
15
+ const document = services.shared.workspace.LangiumDocumentFactory.fromString(input, URI.file(uri));
16
+ langiumDocuments.addDocument(document);
17
+ await documentBuilder.build([document], { validationChecks: 'none' });
18
+ return document;
19
+ };
20
+ const validate = async (input) => {
21
+ await initPromise;
22
+ const document = typeof input === 'string' ? await parse(input) : input;
23
+ await documentBuilder.build([document], { validationChecks: 'all' });
24
+ const diagnostics = document.diagnostics ?? [];
25
+ const errors = diagnostics.map(d => d.message);
26
+ return {
27
+ document,
28
+ diagnostics,
29
+ errors
30
+ };
31
+ };
32
+ const validateAll = async () => {
33
+ await initPromise;
34
+ const docs = langiumDocuments.all.toArray();
35
+ await documentBuilder.build(docs, { validationChecks: 'all' });
36
+ const diagnostics = docs.flatMap(doc => doc.diagnostics ?? []);
37
+ const errors = diagnostics.map(d => d.message);
38
+ return {
39
+ diagnostics,
40
+ errors
41
+ };
42
+ };
43
+ const buildModel = async () => {
44
+ await validateAll();
45
+ const model = modelBuilder.buildModel();
46
+ if (!model)
47
+ throw new Error('No model found');
48
+ return model;
49
+ };
50
+ return {
51
+ services,
52
+ parse,
53
+ validate,
54
+ validateAll,
55
+ buildModel
56
+ };
57
+ }
58
+ //# sourceMappingURL=testServices.js.map
package/dist/utils.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare function failExpectedNever(arg: never): never;
2
2
  export declare function ignoreNeverInRuntime(arg: never): void;
3
+ //# sourceMappingURL=utils.d.ts.map
package/dist/utils.js CHANGED
@@ -5,3 +5,4 @@ export function ignoreNeverInRuntime(arg) {
5
5
  console.warn(`Unexpected and ignored value: ${JSON.stringify(arg)}`);
6
6
  // throw new Error(`Unexpected value: ${arg}`);
7
7
  }
8
+ //# sourceMappingURL=utils.js.map
@@ -3,3 +3,4 @@ import type { ValidationCheck } from 'langium';
3
3
  import type { ast } from '../ast';
4
4
  import type { LikeC4Services } from '../module';
5
5
  export declare const elementChecks: (services: LikeC4Services) => ValidationCheck<ast.Element>;
6
+ //# sourceMappingURL=element.d.ts.map
@@ -9,8 +9,8 @@ export const elementChecks = (services) => {
9
9
  });
10
10
  return;
11
11
  }
12
- const withSameFqn = fqnIndex.byFqn(fqn);
13
- if (withSameFqn.length > 1) {
12
+ const withSameFqn = fqnIndex.byFqn(fqn).limit(2).count();
13
+ if (withSameFqn > 1) {
14
14
  accept('error', `Duplicate element name ${el.name !== fqn ? el.name + ' (' + fqn + ')' : el.name}`, {
15
15
  node: el,
16
16
  property: 'name'
@@ -18,3 +18,4 @@ export const elementChecks = (services) => {
18
18
  }
19
19
  };
20
20
  };
21
+ //# sourceMappingURL=element.js.map
@@ -1,2 +1,3 @@
1
1
  import type { LikeC4Services } from '../module';
2
2
  export declare function registerValidationChecks(services: LikeC4Services): void;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -20,3 +20,4 @@ export function registerValidationChecks(services) {
20
20
  Tag: tagChecks(services)
21
21
  });
22
22
  }
23
+ //# sourceMappingURL=index.js.map
@@ -2,3 +2,4 @@ import type { ValidationCheck } from 'langium';
2
2
  import type { ast } from '../ast';
3
3
  import type { LikeC4Services } from '../module';
4
4
  export declare const relationChecks: (services: LikeC4Services) => ValidationCheck<ast.Relation>;
5
+ //# sourceMappingURL=relation.d.ts.map
@@ -51,3 +51,4 @@ export const relationChecks = (services) => {
51
51
  // }
52
52
  };
53
53
  };
54
+ //# sourceMappingURL=relation.js.map
@@ -3,3 +3,4 @@ import { ast } from '../ast';
3
3
  import type { LikeC4Services } from '../module';
4
4
  export declare const elementKindChecks: (services: LikeC4Services) => ValidationCheck<ast.ElementKind>;
5
5
  export declare const tagChecks: (services: LikeC4Services) => ValidationCheck<ast.Tag>;
6
+ //# sourceMappingURL=specification.d.ts.map
@@ -31,3 +31,4 @@ export const tagChecks = (services) => {
31
31
  }
32
32
  };
33
33
  };
34
+ //# sourceMappingURL=specification.js.map
@@ -2,3 +2,4 @@ import type { ValidationCheck } from 'langium';
2
2
  import { ast } from '../ast';
3
3
  import type { LikeC4Services } from '../module';
4
4
  export declare const viewChecks: (services: LikeC4Services) => ValidationCheck<ast.ElementView>;
5
+ //# sourceMappingURL=view.d.ts.map
@@ -18,3 +18,4 @@ export const viewChecks = (services) => {
18
18
  }
19
19
  };
20
20
  };
21
+ //# sourceMappingURL=view.js.map
package/package.json CHANGED
@@ -1,21 +1,26 @@
1
1
  {
2
2
  "name": "@likec4/language-server",
3
3
  "description": "LikeC4 Language Server",
4
- "version": "0.6.3",
4
+ "version": "0.8.0",
5
5
  "license": "MIT",
6
- "type": "module",
7
6
  "bugs": "https://github.com/likec4/likec4/issues",
8
- "homepage": "https://like-c4.dev",
7
+ "homepage": "https://likec4.dev",
9
8
  "author": "Denis Davydkov <denis@davydkov.com>",
10
9
  "files": [
11
10
  "dist",
12
- "contrib"
11
+ "contrib",
12
+ "!**/__mocks__/",
13
+ "!**/__test__/",
14
+ "!**/*.spec.js",
15
+ "!**/*.spec.d.ts",
16
+ "!**/*.map"
13
17
  ],
14
18
  "repository": {
15
19
  "type": "git",
16
20
  "url": "https://github.com/likec4/likec4.git",
17
21
  "directory": "packages/language-server"
18
22
  },
23
+ "type": "module",
19
24
  "main": "./dist/index.js",
20
25
  "module": "./dist/index.js",
21
26
  "types": "./dist/index.d.ts",
@@ -23,12 +28,12 @@
23
28
  ".": {
24
29
  "types": "./dist/index.d.ts",
25
30
  "import": "./dist/index.js",
26
- "require": "./dist/index.cjs"
31
+ "require": "./dist/index.js"
27
32
  },
28
33
  "./builtin": {
29
34
  "types": "./dist/builtin.d.ts",
30
35
  "import": "./dist/builtin.js",
31
- "require": "./dist/builtin.cjs"
36
+ "require": "./dist/builtin.js"
32
37
  }
33
38
  },
34
39
  "publishConfig": {
@@ -41,58 +46,48 @@
41
46
  ".": {
42
47
  "types": "./dist/index.d.ts",
43
48
  "import": "./dist/index.js",
44
- "require": "./dist/index.cjs"
49
+ "require": "./dist/index.js"
45
50
  },
46
51
  "./builtin": {
47
52
  "types": "./dist/builtin.d.ts",
48
53
  "import": "./dist/builtin.js",
49
- "require": "./dist/builtin.cjs"
54
+ "require": "./dist/builtin.js"
50
55
  }
51
56
  }
52
57
  },
53
58
  "scripts": {
54
- "compile": "tsc --emitDeclarationOnly",
55
- "build:release": "run generate && tsc -p tsconfig.esm.json",
56
- "build:langium": "langium generate",
57
- "build:ts": "tsc",
59
+ "turbo-build": "run -T turbo run build --filter='language-server'",
60
+ "compile": "tsc --noEmit",
58
61
  "watch:langium": "langium generate --watch",
59
62
  "watch:ts": "tsc --watch",
60
63
  "generate": "langium generate",
61
- "build": "run-s 'build:langium' 'build:ts'",
62
- "dev": "run generate && run-p 'watch:*'",
64
+ "build": "tsc",
65
+ "dev": "run-p 'watch:*'",
63
66
  "lint": "run -T eslint src/ --fix",
64
67
  "clean": "run -T rimraf dist contrib",
65
68
  "test": "vitest run",
66
69
  "test:watch": "vitest"
67
70
  },
68
71
  "dependencies": {
69
- "@likec4/core": "0.6.3",
70
- "@likec4/language-protocol": "0.6.3",
72
+ "@likec4/core": "0.7.0",
71
73
  "@mobily/ts-belt": "^3.13.1",
74
+ "langium": "^1.2.0",
72
75
  "nanoid": "^4.0.2",
73
76
  "object-hash": "^3.0.0",
74
- "rambdax": "^9.1.0",
77
+ "rambdax": "^9.1.1",
75
78
  "strip-indent": "^4.0.0",
76
79
  "tiny-invariant": "^1.3.1",
77
- "type-fest": "^3.8.0",
78
- "vscode-uri": "~3.0.7"
79
- },
80
- "peerDependencies": {
81
- "langium": "^1.1.0",
82
- "vscode-languageserver-protocol": "~3.17.2"
83
- },
84
- "peerDependenciesMeta": {
85
- "vscode-languageserver-protocol": {
86
- "optional": true
87
- }
80
+ "type-fest": "^3.9.0",
81
+ "vscode-languageserver": "~8.1.0",
82
+ "vscode-languageserver-protocol": "~3.17.3"
88
83
  },
89
84
  "devDependencies": {
90
85
  "@types/node": "^18.15.11",
91
86
  "@types/object-hash": "^3.0.2",
92
- "langium-cli": "^1.1.0",
87
+ "langium-cli": "^1.2.0",
93
88
  "npm-run-all": "^4.1.5",
94
89
  "typescript": "^5.0.4",
95
- "vite": "^4.2.2",
96
- "vitest": "^0.30.1"
90
+ "vite": "^4.3.3",
91
+ "vitest": "^0.31.0"
97
92
  }
98
93
  }