@zenwave360/lsp-js 0.1.0-next.12.1 → 0.1.0-next.14.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/README.md +35 -5
- package/dist/browser/zenwave-lsp-worker.js +47979 -40684
- package/dist/node/zenwave-lsp-server.js +48006 -40711
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -51,6 +51,8 @@ hover, definition, references, document symbols and formatting. `capabilities.ex
|
|
|
51
51
|
- `customRequests`: `string[]`, the `zenwave/*` requests this server answers. The list is built from the
|
|
52
52
|
server's handler registration, so a client can rely on it. A request that is not listed is answered
|
|
53
53
|
with JSON-RPC `-32601`. lsp-jvm additionally exposes workspace concept and status requests.
|
|
54
|
+
- `previewModes`: `true` when `zenwave/preview` accepts its additive `mode` parameter and grouped diagram representations.
|
|
55
|
+
- `organizeModes`: `true` when `zenwave/organizeZflServices` accepts `mode` (`full`, the default, or `additive`).
|
|
54
56
|
|
|
55
57
|
## Custom requests
|
|
56
58
|
|
|
@@ -58,9 +60,9 @@ hover, definition, references, document symbols and formatting. `capabilities.ex
|
|
|
58
60
|
| --- | --- | --- |
|
|
59
61
|
| `zenwave/hierarchy` | `{ uri }` | hierarchy nodes `{ id, label, kind, language, sourceUri, sourceRange, children, relatedResources, uiHints, viewNodeIds }[]` |
|
|
60
62
|
| `zenwave/forwardReferences`, `zenwave/reverseReferences` | `{ uri, semanticId }` | navigation targets |
|
|
61
|
-
| `zenwave/organizeZflServices` | `{ uri }` | the reorganised ZFL text, or `null` |
|
|
63
|
+
| `zenwave/organizeZflServices` | `{ uri, mode?: "full" \| "additive" }` | the reorganised ZFL text, or `null` |
|
|
62
64
|
| `zenwave/eventFlowViews` | `{ textDocument: { uri } }` | `{ flowGraph, serviceGraph }`: dsl-kotlin's laid-out flow and service view models, each with its `schema` (`zfl.eventflow.view@1`, `zfl.services.view@1`) |
|
|
63
|
-
| `zenwave/preview` | `{ textDocument: { uri }, sequenceRenderMode?: "SEPARATE_VARIANTS" \| "ALT_BLOCKS" \| "AUTO" }` | `{ representations: { id, title, format: "MARKDOWN" \| "MERMAID" \| "HTML", content }[], defaultRepresentationId }` |
|
|
65
|
+
| `zenwave/preview` | `{ textDocument: { uri }, mode?: "docs" \| "diagrams", sequenceRenderMode?: "SEPARATE_VARIANTS" \| "ALT_BLOCKS" \| "AUTO" }` | `{ representations: { id, title, format: "MARKDOWN" \| "MERMAID" \| "HTML", content, group? }[], defaultRepresentationId }` |
|
|
64
66
|
| `zenwave/symbolAt` | `{ textDocument: { uri }, position: { line, character } }` | `{ uri, semanticId, range? }`, the input of the two reference requests, or `null` when nothing is declared or referenced there |
|
|
65
67
|
|
|
66
68
|
`zenwave/hierarchy` answers whether or not the document is open. An open document is answered from the
|
|
@@ -74,10 +76,38 @@ groups of the same document's `zenwave/eventFlowViews` that stand for the node's
|
|
|
74
76
|
`event:OrderCreated`, `event:OrderCreated@Orders>OrderService`, `group:Orders>OrderService`, `policy:…`); it
|
|
75
77
|
is empty when the diagram has no counterpart.
|
|
76
78
|
|
|
77
|
-
`zenwave/
|
|
78
|
-
`
|
|
79
|
+
`zenwave/organizeZflServices` defaults to `mode: "full"`, which rebuilds the systems block from the flows.
|
|
80
|
+
`mode: "additive"` adds what the flows use and removes nothing. A document the server cannot process answers
|
|
81
|
+
`null` in either mode.
|
|
82
|
+
|
|
83
|
+
`zenwave/preview` defaults to `mode: "docs"`, so it answers for ZDL (one `MARKDOWN` representation `domain`, "Domain model": the model's page with its
|
|
84
|
+
diagrams as `mermaid` fences), `.zw` (one `MARKDOWN` representation `configuration`, "Plugin configuration": the `config`
|
|
85
|
+
block and each plugin with what it is for and its resolved configuration; the document's language id is `zw`, or its
|
|
86
|
+
URI ends in `.zw`) and ZFL (a `flowchart`, then one `sequence:<outcome>:<index>` per end outcome; the first sequence is
|
|
87
|
+
the default). What a model wrote is escaped in the Markdown, so a `<script>` shows as text. `sequenceRenderMode`
|
|
79
88
|
defaults to `ALT_BLOCKS`. Null properties are omitted from every result.
|
|
80
89
|
|
|
90
|
+
For a ZDL, `mode: "diagrams"` returns only individual `MERMAID` diagrams. Every representation has a `group` of
|
|
91
|
+
`Services`, `Aggregates`, `State Machines`, `Events`, `Commands` or `Other entities`; absent kinds have no representation.
|
|
92
|
+
|
|
93
|
+
### Plugin catalogue
|
|
94
|
+
|
|
95
|
+
The `.zw` page describes each plugin (what it is for, what its options mean) from a plugin catalogue, the JSON
|
|
96
|
+
the ZenWave SDK reports for `-h json`, in the shape of the VS Code extension's `sdk-plugin-catalogue.json`
|
|
97
|
+
(`{ source, version, plugins: [...] }`; fields the server does not know are ignored). The server ships its own copy,
|
|
98
|
+
embedded in the bundle, so it works with no file read (the Web Worker too), and uses the last valid catalogue a
|
|
99
|
+
client sent. The copy is generated by `scripts/generate-plugin-catalogue.mjs` from a named SDK build (its
|
|
100
|
+
`source`/`version`, today `ZenWave SDK 2.8.0-SNAPSHOT`) and parsed the first time a `.zw` is previewed.
|
|
101
|
+
|
|
102
|
+
- At initialisation: `initializationOptions.pluginCatalogue`, the catalogue as a JSON object.
|
|
103
|
+
- At any time: the notification `zenwave/pluginCatalogue` with params `{ catalogue: <JSON object> }`. It is advertised
|
|
104
|
+
in `capabilities.experimental.customNotifications` (`["zenwave/pluginCatalogue"]`), beside `customRequests`.
|
|
105
|
+
|
|
106
|
+
The next `zenwave/preview` uses it (previews are not cached). A plugin that is not in the catalogue still shows its
|
|
107
|
+
name and resolved configuration, without a description. A catalogue that is not an object, is not JSON or has no
|
|
108
|
+
`plugins` array is ignored, the previous one stays, and the server logs a warning with `window/logMessage`;
|
|
109
|
+
it never fails initialisation.
|
|
110
|
+
|
|
81
111
|
Both visualisation requests read open documents. When a document cannot answer they fail with JSON-RPC
|
|
82
112
|
`-32803` and `data.kind`: `documentUnreadable` (a syntax error; `data.diagnostics` holds LSP diagnostics),
|
|
83
113
|
`documentNotFound` (not open) or `unsupportedDocument` (a kind of document the request does not cover).
|
|
@@ -87,7 +117,7 @@ The worker bundle carries elkjs for the flow layout. elkjs' in-process layout wo
|
|
|
87
117
|
the Web Worker's `onmessage` when it detects a worker global; `build.mjs` disables that detection when bundling,
|
|
88
118
|
and the build fails if an elkjs upgrade changes it.
|
|
89
119
|
|
|
90
|
-
Initialization options take the form `{ zenwave: { configUri?, projectManifestUri? } }`.
|
|
120
|
+
Initialization options take the form `{ zenwave: { configUri?, projectManifestUri? }, pluginCatalogue? }`.
|
|
91
121
|
|
|
92
122
|
## Building
|
|
93
123
|
|