@markdy/language-server 0.7.26 → 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.
Files changed (2) hide show
  1. package/dist/index.js +56 -8
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -5,9 +5,10 @@ import {
5
5
  FIGURE_ONLY_ACTION_NAMES,
6
6
  ParseError,
7
7
  UNIVERSAL_ACTION_NAMES,
8
- parse
8
+ parse,
9
+ registerActorPack
9
10
  } from "@markdy/core";
10
- import { SYSTEM_FLOW_ACTIONS } from "@markdy/stdlib-systems";
11
+ import { SYSTEM_ACTOR_TYPES, SYSTEM_FLOW_ACTIONS, systemsPack } from "@markdy/stdlib-systems";
11
12
  import {
12
13
  CompletionItemKind,
13
14
  createConnection,
@@ -20,9 +21,26 @@ import {
20
21
  import { TextDocument } from "vscode-languageserver-textdocument";
21
22
  var connection = createConnection(ProposedFeatures.all);
22
23
  var documents = new TextDocuments(TextDocument);
24
+ registerActorPack(systemsPack);
23
25
  var UNIVERSAL_ACTIONS = [...UNIVERSAL_ACTION_NAMES];
24
26
  var FIGURE_ACTIONS = [...FIGURE_ONLY_ACTION_NAMES];
25
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
+ ]);
26
44
  var KEYWORDS = [
27
45
  "scene",
28
46
  "actor",
@@ -33,7 +51,8 @@ var KEYWORDS = [
33
51
  "group",
34
52
  "preset",
35
53
  "import",
36
- "camera"
54
+ "camera",
55
+ ...ARCHITECTURE_KEYWORDS
37
56
  ];
38
57
  var SEMANTIC_TOKEN_TYPES = ["keyword", "variable", "method", "class"];
39
58
  var SEMANTIC_TOKEN_TYPE_INDEX = new Map(
@@ -52,22 +71,39 @@ var ACTION_DOCS = {
52
71
  emit: "Draw async fire-and-forget flow edge. Params: `to`, `label`, `dur`, `style=fire_and_forget`.",
53
72
  pan: "Move camera center. Params: `to=(x,y)`, `dur`, `ease`.",
54
73
  zoom: "Change camera zoom. Params: `to`, `dur`, `ease`.",
55
- 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`."
56
84
  };
57
85
  function extractActors(text) {
58
86
  const actors = [];
59
87
  const lines = text.split(/\r?\n/);
60
88
  for (let i = 0; i < lines.length; i++) {
61
- const m = /^actor\s+(\w+)\s*=\s*([\w.]+)\(/.exec(lines[i].trim());
62
- if (!m) continue;
63
- actors.push({ name: m[1], type: m[2], line: i });
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
+ }
64
100
  }
65
101
  return actors;
66
102
  }
67
103
  function getActionsForActorType(actorType) {
68
104
  const out = [...UNIVERSAL_ACTIONS];
69
105
  if (actorType === "figure") out.push(...FIGURE_ACTIONS);
70
- if (actorType === "service" || actorType === "db" || actorType === "queue" || actorType === "client") {
106
+ if (SYSTEM_TYPES.has(actorType)) {
71
107
  out.push(...SYSTEM_ACTIONS);
72
108
  }
73
109
  return out;
@@ -220,6 +256,18 @@ function buildDocumentSymbols(document) {
220
256
  });
221
257
  continue;
222
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
+ }
223
271
  const seq = /^seq\s+(\w+)/.exec(raw);
224
272
  if (seq) {
225
273
  symbols.push({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markdy/language-server",
3
- "version": "0.7.26",
3
+ "version": "0.7.27",
4
4
  "description": "Language Server Protocol implementation for MarkdyScript.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -44,8 +44,8 @@
44
44
  "dependencies": {
45
45
  "vscode-languageserver": "^9.0.1",
46
46
  "vscode-languageserver-textdocument": "^1.0.12",
47
- "@markdy/stdlib-systems": "0.7.26",
48
- "@markdy/core": "0.7.26"
47
+ "@markdy/core": "0.7.27",
48
+ "@markdy/stdlib-systems": "0.7.27"
49
49
  },
50
50
  "devDependencies": {
51
51
  "tsup": "^8.5.1",