@likec4/language-server 0.6.0 → 0.6.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 +31 -0
- package/contrib/likec4.tmLanguage.json +73 -0
- package/dist/__test__/parser-smoke/01-Specification.d.ts +3 -0
- package/dist/__test__/parser-smoke/01-Specification.js +42 -0
- package/dist/__test__/parser-smoke/02-Model.d.ts +9 -0
- package/dist/__test__/parser-smoke/02-Model.js +110 -0
- package/dist/__test__/parser-smoke/03-ModelRelation.d.ts +6 -0
- package/dist/__test__/parser-smoke/03-ModelRelation.js +81 -0
- package/dist/__test__/parser-smoke/04-Scope.d.ts +2 -0
- package/dist/__test__/parser-smoke/04-Scope.js +38 -0
- package/dist/__test__/parser-smoke/05-StrictElementRef.d.ts +3 -0
- package/dist/__test__/parser-smoke/05-StrictElementRef.js +46 -0
- package/dist/__test__/parser-smoke/06-ElementRef.d.ts +2 -0
- package/dist/__test__/parser-smoke/06-ElementRef.js +59 -0
- package/dist/__test__/parser-smoke/07-Views.d.ts +10 -0
- package/dist/__test__/parser-smoke/07-Views.js +146 -0
- package/dist/__test__/parser-smoke/08-Structurizr.d.ts +1 -0
- package/dist/__test__/parser-smoke/08-Structurizr.js +22 -0
- package/dist/__test__/parser-smoke/index.d.ts +8 -0
- package/dist/__test__/parser-smoke/index.js +8 -0
- package/dist/__test__/parser-smoke-extendsElement.spec.d.ts +1 -0
- package/dist/__test__/parser-smoke-extendsElement.spec.js +36 -0
- package/dist/__test__/parser-smoke.spec.d.ts +1 -0
- package/dist/__test__/parser-smoke.spec.js +28 -0
- package/dist/ast.d.ts +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/lsp/DocumentSymbolProvider.d.ts +1 -0
- package/dist/model/model-builder.js +12 -12
- package/dist/model/model-builder.spec.d.ts +1 -0
- package/dist/model/model-builder.spec.js +141 -0
- package/dist/protocol.d.ts +16 -12
- package/dist/protocol.js +2 -2
- package/dist/registerProtocolHandlers.js +24 -9
- package/dist/validation/element.d.ts +1 -0
- package/dist/validation/element.spec.d.ts +1 -0
- package/dist/validation/element.spec.js +65 -0
- package/dist/validation/relation.spec.d.ts +1 -0
- package/dist/validation/relation.spec.js +93 -0
- package/dist/validation/specification.spec.d.ts +1 -0
- package/dist/validation/specification.spec.js +31 -0
- package/dist/validation/view.spec.d.ts +1 -0
- package/dist/validation/view.spec.js +20 -0
- package/package.json +17 -16
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { createTestServices } from '../test';
|
|
3
|
+
describe('viewChecks', () => {
|
|
4
|
+
it('should report duplicate view names', async () => {
|
|
5
|
+
const { validate } = createTestServices();
|
|
6
|
+
const { diagnostics } = await validate(`
|
|
7
|
+
views {
|
|
8
|
+
view v1 {
|
|
9
|
+
}
|
|
10
|
+
view v1 {
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`);
|
|
14
|
+
expect(diagnostics).toHaveLength(2);
|
|
15
|
+
for (const diagnostic of diagnostics) {
|
|
16
|
+
expect(diagnostic.severity, 'diagnostic severity').toBe(1);
|
|
17
|
+
expect(diagnostic.message, 'diagnostic message').toBe("Duplicate view 'v1'");
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
});
|
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/language-server",
|
|
3
3
|
"description": "LikeC4 Language Server",
|
|
4
|
-
"version": "0.6.
|
|
4
|
+
"version": "0.6.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bugs": "https://github.com/likec4/likec4/issues",
|
|
8
8
|
"homepage": "https://like-c4.dev",
|
|
9
9
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
10
10
|
"files": [
|
|
11
|
-
"dist"
|
|
11
|
+
"dist",
|
|
12
|
+
"contrib"
|
|
12
13
|
],
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
@@ -16,6 +17,7 @@
|
|
|
16
17
|
"directory": "packages/language-server"
|
|
17
18
|
},
|
|
18
19
|
"main": "./dist/index.js",
|
|
20
|
+
"module": "./dist/index.js",
|
|
19
21
|
"types": "./dist/index.d.ts",
|
|
20
22
|
"exports": {
|
|
21
23
|
".": {
|
|
@@ -23,11 +25,6 @@
|
|
|
23
25
|
"import": "./dist/index.js",
|
|
24
26
|
"require": "./dist/index.cjs"
|
|
25
27
|
},
|
|
26
|
-
"./protocol": {
|
|
27
|
-
"types": "./dist/protocol.d.ts",
|
|
28
|
-
"import": "./dist/protocol.js",
|
|
29
|
-
"require": "./dist/protocol.cjs"
|
|
30
|
-
},
|
|
31
28
|
"./builtin": {
|
|
32
29
|
"types": "./dist/builtin.d.ts",
|
|
33
30
|
"import": "./dist/builtin.js",
|
|
@@ -38,6 +35,7 @@
|
|
|
38
35
|
"registry": "https://registry.npmjs.org",
|
|
39
36
|
"access": "public",
|
|
40
37
|
"main": "./dist/index.js",
|
|
38
|
+
"module": "./dist/index.js",
|
|
41
39
|
"types": "./dist/index.d.ts",
|
|
42
40
|
"exports": {
|
|
43
41
|
".": {
|
|
@@ -45,11 +43,6 @@
|
|
|
45
43
|
"import": "./dist/index.js",
|
|
46
44
|
"require": "./dist/index.cjs"
|
|
47
45
|
},
|
|
48
|
-
"./protocol": {
|
|
49
|
-
"types": "./dist/protocol.d.ts",
|
|
50
|
-
"import": "./dist/protocol.js",
|
|
51
|
-
"require": "./dist/protocol.cjs"
|
|
52
|
-
},
|
|
53
46
|
"./builtin": {
|
|
54
47
|
"types": "./dist/builtin.d.ts",
|
|
55
48
|
"import": "./dist/builtin.js",
|
|
@@ -73,17 +66,25 @@
|
|
|
73
66
|
"test:watch": "vitest"
|
|
74
67
|
},
|
|
75
68
|
"dependencies": {
|
|
76
|
-
"@likec4/core": "0.6.
|
|
69
|
+
"@likec4/core": "0.6.1",
|
|
70
|
+
"@likec4/language-protocol": "0.6.1",
|
|
77
71
|
"@mobily/ts-belt": "^3.13.1",
|
|
78
|
-
"langium": "^1.1.0",
|
|
79
72
|
"nanoid": "^4.0.2",
|
|
80
73
|
"object-hash": "^3.0.0",
|
|
81
74
|
"rambdax": "^9.1.0",
|
|
82
75
|
"strip-indent": "^4.0.0",
|
|
83
76
|
"tiny-invariant": "^1.3.1",
|
|
84
77
|
"type-fest": "^3.8.0",
|
|
85
|
-
"vscode-
|
|
86
|
-
|
|
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
|
+
}
|
|
87
88
|
},
|
|
88
89
|
"devDependencies": {
|
|
89
90
|
"@types/node": "^18.15.11",
|