@markdy/language-server 0.7.25 → 0.7.27
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/dist/index.js +65 -32
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
FIGURE_ONLY_ACTION_NAMES,
|
|
6
|
+
ParseError,
|
|
7
|
+
UNIVERSAL_ACTION_NAMES,
|
|
8
|
+
parse,
|
|
9
|
+
registerActorPack
|
|
10
|
+
} from "@markdy/core";
|
|
11
|
+
import { SYSTEM_ACTOR_TYPES, SYSTEM_FLOW_ACTIONS, systemsPack } from "@markdy/stdlib-systems";
|
|
5
12
|
import {
|
|
6
13
|
CompletionItemKind,
|
|
7
14
|
createConnection,
|
|
@@ -14,31 +21,26 @@ import {
|
|
|
14
21
|
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
15
22
|
var connection = createConnection(ProposedFeatures.all);
|
|
16
23
|
var documents = new TextDocuments(TextDocument);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"face",
|
|
38
|
-
"rotate_part",
|
|
39
|
-
"pose"
|
|
40
|
-
];
|
|
41
|
-
var SYSTEM_ACTIONS = ["request", "response", "emit"];
|
|
24
|
+
registerActorPack(systemsPack);
|
|
25
|
+
var UNIVERSAL_ACTIONS = [...UNIVERSAL_ACTION_NAMES];
|
|
26
|
+
var FIGURE_ACTIONS = [...FIGURE_ONLY_ACTION_NAMES];
|
|
27
|
+
var SYSTEM_ACTIONS = [...SYSTEM_FLOW_ACTIONS];
|
|
28
|
+
var SYSTEM_TYPES = new Set(SYSTEM_ACTOR_TYPES);
|
|
29
|
+
var ARCHITECTURE_KEYWORDS = /* @__PURE__ */ new Set([
|
|
30
|
+
"service",
|
|
31
|
+
"database",
|
|
32
|
+
"db",
|
|
33
|
+
"queue",
|
|
34
|
+
"cache",
|
|
35
|
+
"api",
|
|
36
|
+
"user",
|
|
37
|
+
"client",
|
|
38
|
+
"cloud",
|
|
39
|
+
"region",
|
|
40
|
+
"container",
|
|
41
|
+
"microservice",
|
|
42
|
+
"cluster"
|
|
43
|
+
]);
|
|
42
44
|
var KEYWORDS = [
|
|
43
45
|
"scene",
|
|
44
46
|
"actor",
|
|
@@ -46,9 +48,11 @@ var KEYWORDS = [
|
|
|
46
48
|
"var",
|
|
47
49
|
"def",
|
|
48
50
|
"seq",
|
|
51
|
+
"group",
|
|
49
52
|
"preset",
|
|
50
53
|
"import",
|
|
51
|
-
"camera"
|
|
54
|
+
"camera",
|
|
55
|
+
...ARCHITECTURE_KEYWORDS
|
|
52
56
|
];
|
|
53
57
|
var SEMANTIC_TOKEN_TYPES = ["keyword", "variable", "method", "class"];
|
|
54
58
|
var SEMANTIC_TOKEN_TYPE_INDEX = new Map(
|
|
@@ -67,22 +71,39 @@ var ACTION_DOCS = {
|
|
|
67
71
|
emit: "Draw async fire-and-forget flow edge. Params: `to`, `label`, `dur`, `style=fire_and_forget`.",
|
|
68
72
|
pan: "Move camera center. Params: `to=(x,y)`, `dur`, `ease`.",
|
|
69
73
|
zoom: "Change camera zoom. Params: `to`, `dur`, `ease`.",
|
|
70
|
-
shake: "Shake actor/camera. Params: `intensity`, `dur`."
|
|
74
|
+
shake: "Shake actor/camera. Params: `intensity`, `dur`.",
|
|
75
|
+
spring: "Spring to a coordinate with overshoot. Params: `to=(x,y)`, `stiffness`, `dur`.",
|
|
76
|
+
follow_path: "Move along an SVG path using CSS motion paths. Params: `path`, `dur`, `rotate`.",
|
|
77
|
+
pulse: "Scale up and settle back for emphasis. Params: `amount`, `dur`.",
|
|
78
|
+
glow: "Animate drop-shadow/box-shadow emphasis. Params: `color`, `strength`, `dur`.",
|
|
79
|
+
ripple: "Emit a transient expanding ring from the actor center. Params: `color`, `size`, `dur`.",
|
|
80
|
+
blur: "Animate CSS blur. Params: `from`, `to`, `dur`.",
|
|
81
|
+
line_reveal: "Reveal an actor with a directional clip-path wipe. Params: `from`, `dur`.",
|
|
82
|
+
mask: "Animate a circular clip-path mask. Params: `from`, `to`, `dur`.",
|
|
83
|
+
parallax: "Offset an actor by depth for layered movement. Params: `depth`, `by=(x,y)`, `dur`."
|
|
71
84
|
};
|
|
72
85
|
function extractActors(text) {
|
|
73
86
|
const actors = [];
|
|
74
87
|
const lines = text.split(/\r?\n/);
|
|
75
88
|
for (let i = 0; i < lines.length; i++) {
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
89
|
+
const raw = lines[i].trim();
|
|
90
|
+
const actor = /^actor\s+(\w+)\s*=\s*([\w.]+)\(/.exec(raw);
|
|
91
|
+
if (actor) {
|
|
92
|
+
actors.push({ name: actor[1], type: actor[2], line: i });
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const shorthand = /^(service|database|db|queue|cache|api|user|client|cloud|region|container|microservice|cluster)\s+(\w+)\b/.exec(raw);
|
|
96
|
+
if (shorthand) {
|
|
97
|
+
const type = shorthand[1] === "api" ? "service" : shorthand[1] === "user" ? "client" : shorthand[1];
|
|
98
|
+
actors.push({ name: shorthand[2], type, line: i });
|
|
99
|
+
}
|
|
79
100
|
}
|
|
80
101
|
return actors;
|
|
81
102
|
}
|
|
82
103
|
function getActionsForActorType(actorType) {
|
|
83
104
|
const out = [...UNIVERSAL_ACTIONS];
|
|
84
105
|
if (actorType === "figure") out.push(...FIGURE_ACTIONS);
|
|
85
|
-
if (actorType
|
|
106
|
+
if (SYSTEM_TYPES.has(actorType)) {
|
|
86
107
|
out.push(...SYSTEM_ACTIONS);
|
|
87
108
|
}
|
|
88
109
|
return out;
|
|
@@ -235,6 +256,18 @@ function buildDocumentSymbols(document) {
|
|
|
235
256
|
});
|
|
236
257
|
continue;
|
|
237
258
|
}
|
|
259
|
+
const shorthand = /^(service|database|db|queue|cache|api|user|client|cloud|region|container|microservice|cluster)\s+(\w+)\b/.exec(raw);
|
|
260
|
+
if (shorthand) {
|
|
261
|
+
symbols.push({
|
|
262
|
+
name: shorthand[2],
|
|
263
|
+
detail: shorthand[1],
|
|
264
|
+
kind: SymbolKind.Variable,
|
|
265
|
+
range: lineRange(document, i),
|
|
266
|
+
selectionRange: lineRange(document, i),
|
|
267
|
+
children: []
|
|
268
|
+
});
|
|
269
|
+
continue;
|
|
270
|
+
}
|
|
238
271
|
const seq = /^seq\s+(\w+)/.exec(raw);
|
|
239
272
|
if (seq) {
|
|
240
273
|
symbols.push({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markdy/language-server",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.27",
|
|
4
4
|
"description": "Language Server Protocol implementation for MarkdyScript.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"vscode-languageserver": "^9.0.1",
|
|
46
46
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
47
|
-
"@markdy/core": "0.7.
|
|
47
|
+
"@markdy/core": "0.7.27",
|
|
48
|
+
"@markdy/stdlib-systems": "0.7.27"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"tsup": "^8.5.1",
|