doc-detective 4.29.0 → 4.30.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.
- package/bin/doc-detective-lsp.js +6 -0
- package/dist/cli.js +58 -35
- package/dist/cli.js.map +1 -1
- package/dist/common/src/schemas/schemas.json +56 -56
- package/dist/common/src/validate.d.ts +16 -1
- package/dist/common/src/validate.d.ts.map +1 -1
- package/dist/common/src/validate.js +113 -13
- package/dist/common/src/validate.js.map +1 -1
- package/dist/core/config.d.ts +66 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +121 -68
- package/dist/core/config.js.map +1 -1
- package/dist/core/detectTests.d.ts.map +1 -1
- package/dist/core/detectTests.js +105 -23
- package/dist/core/detectTests.js.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +53 -14
- package/dist/core/index.js.map +1 -1
- package/dist/core/openapi.d.ts.map +1 -1
- package/dist/core/openapi.js +22 -5
- package/dist/core/openapi.js.map +1 -1
- package/dist/core/resolveTests.d.ts.map +1 -1
- package/dist/core/resolveTests.js +33 -2
- package/dist/core/resolveTests.js.map +1 -1
- package/dist/core/tests/findStrategies.d.ts.map +1 -1
- package/dist/core/tests/findStrategies.js +83 -10
- package/dist/core/tests/findStrategies.js.map +1 -1
- package/dist/core/tests/saveScreenshot.d.ts.map +1 -1
- package/dist/core/tests/saveScreenshot.js +101 -59
- package/dist/core/tests/saveScreenshot.js.map +1 -1
- package/dist/core/utils.d.ts.map +1 -1
- package/dist/core/utils.js +13 -4
- package/dist/core/utils.js.map +1 -1
- package/dist/index.cjs +356 -196
- package/dist/lsp/command.d.ts +12 -0
- package/dist/lsp/command.d.ts.map +1 -0
- package/dist/lsp/command.js +24 -0
- package/dist/lsp/command.js.map +1 -0
- package/dist/lsp/completion.d.ts +27 -0
- package/dist/lsp/completion.d.ts.map +1 -0
- package/dist/lsp/completion.js +114 -0
- package/dist/lsp/completion.js.map +1 -0
- package/dist/lsp/diagnostics.d.ts +21 -0
- package/dist/lsp/diagnostics.d.ts.map +1 -0
- package/dist/lsp/diagnostics.js +137 -0
- package/dist/lsp/diagnostics.js.map +1 -0
- package/dist/lsp/gate.d.ts +30 -0
- package/dist/lsp/gate.d.ts.map +1 -0
- package/dist/lsp/gate.js +80 -0
- package/dist/lsp/gate.js.map +1 -0
- package/dist/lsp/hover.d.ts +9 -0
- package/dist/lsp/hover.d.ts.map +1 -0
- package/dist/lsp/hover.js +56 -0
- package/dist/lsp/hover.js.map +1 -0
- package/dist/lsp/inline.d.ts +25 -0
- package/dist/lsp/inline.d.ts.map +1 -0
- package/dist/lsp/inline.js +208 -0
- package/dist/lsp/inline.js.map +1 -0
- package/dist/lsp/json/positions.d.ts +51 -0
- package/dist/lsp/json/positions.d.ts.map +1 -0
- package/dist/lsp/json/positions.js +101 -0
- package/dist/lsp/json/positions.js.map +1 -0
- package/dist/lsp/messages.d.ts +27 -0
- package/dist/lsp/messages.d.ts.map +1 -0
- package/dist/lsp/messages.js +33 -0
- package/dist/lsp/messages.js.map +1 -0
- package/dist/lsp/model.d.ts +27 -0
- package/dist/lsp/model.d.ts.map +1 -0
- package/dist/lsp/model.js +49 -0
- package/dist/lsp/model.js.map +1 -0
- package/dist/lsp/registry.d.ts +61 -0
- package/dist/lsp/registry.d.ts.map +1 -0
- package/dist/lsp/registry.js +124 -0
- package/dist/lsp/registry.js.map +1 -0
- package/dist/lsp/server.d.ts +40 -0
- package/dist/lsp/server.d.ts.map +1 -0
- package/dist/lsp/server.js +64 -0
- package/dist/lsp/server.js.map +1 -0
- package/dist/lsp/yaml/positions.d.ts +32 -0
- package/dist/lsp/yaml/positions.d.ts.map +1 -0
- package/dist/lsp/yaml/positions.js +92 -0
- package/dist/lsp/yaml/positions.js.map +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +30 -5
- package/dist/utils.js.map +1 -1
- package/package.json +6 -2
- package/scripts/postinstall.js +144 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommandModule } from "yargs";
|
|
2
|
+
export interface LspArgv {
|
|
3
|
+
stdio: boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* `doc-detective lsp` — start the Doc Detective language server. Registered
|
|
7
|
+
* lazily in `src/cli.ts`: the handler imports the server (and its
|
|
8
|
+
* `vscode-languageserver` dependency graph) only when this subcommand runs, so
|
|
9
|
+
* ordinary `runTests` invocations never pay that import cost.
|
|
10
|
+
*/
|
|
11
|
+
export declare const lspCommand: CommandModule<{}, LspArgv>;
|
|
12
|
+
//# sourceMappingURL=command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/lsp/command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,WAAW,OAAO;IACtB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,EAAE,EAAE,OAAO,CAmBjD,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `doc-detective lsp` — start the Doc Detective language server. Registered
|
|
3
|
+
* lazily in `src/cli.ts`: the handler imports the server (and its
|
|
4
|
+
* `vscode-languageserver` dependency graph) only when this subcommand runs, so
|
|
5
|
+
* ordinary `runTests` invocations never pay that import cost.
|
|
6
|
+
*/
|
|
7
|
+
export const lspCommand = {
|
|
8
|
+
command: "lsp",
|
|
9
|
+
describe: "Start the Doc Detective language server (LSP) over stdio for editors and AI agents.",
|
|
10
|
+
builder: (yargs) => yargs.option("stdio", {
|
|
11
|
+
type: "boolean",
|
|
12
|
+
default: true,
|
|
13
|
+
describe: "Communicate over stdio (the only supported transport). Present for explicitness and editor configs.",
|
|
14
|
+
}),
|
|
15
|
+
/* c8 ignore start - thin lazy-load + real stdio server start; the server's
|
|
16
|
+
pure wiring is unit-tested via registerHandlers and end-to-end via the
|
|
17
|
+
spawned protocol test. */
|
|
18
|
+
handler: async () => {
|
|
19
|
+
const { startServer } = await import("./server.js");
|
|
20
|
+
startServer();
|
|
21
|
+
},
|
|
22
|
+
/* c8 ignore stop */
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/lsp/command.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAA+B;IACpD,OAAO,EAAE,KAAK;IACd,QAAQ,EACN,qFAAqF;IACvF,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE;QACpB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,QAAQ,EACN,qGAAqG;KACxG,CAA6C;IAChD;;gCAE4B;IAC5B,OAAO,EAAE,KAAK,IAAI,EAAE;QAClB,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;QACpD,WAAW,EAAE,CAAC;IAChB,CAAC;IACD,oBAAoB;CACrB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { CompletionItem, MarkupKind } from "vscode-languageserver";
|
|
2
|
+
import type { Position } from "vscode-languageserver";
|
|
3
|
+
import type { TextDocument } from "vscode-languageserver-textdocument";
|
|
4
|
+
type JsonPath = Array<string | number>;
|
|
5
|
+
/**
|
|
6
|
+
* Cursor is at a step-object key position: `…/steps/<index>/<partialKey>`.
|
|
7
|
+
* Offers action-key completions.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isStepKeyContext(path: JsonPath): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Cursor is at a key position inside an action object:
|
|
12
|
+
* `…/steps/<index>/<actionKey>/<partialKey>`. Returns the action key, or null.
|
|
13
|
+
*/
|
|
14
|
+
export declare function actionFieldContext(path: JsonPath): string | null;
|
|
15
|
+
/** A Markdown documentation payload, or undefined when there's no text. */
|
|
16
|
+
export declare function markdownDoc(text: string | undefined): {
|
|
17
|
+
kind: MarkupKind;
|
|
18
|
+
value: string;
|
|
19
|
+
} | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Compute completions at a position. Phase 2: action-key completion inside a
|
|
22
|
+
* `steps` element, and field-name completion inside a known action's object.
|
|
23
|
+
* Spec documents only, JSON only, key positions only.
|
|
24
|
+
*/
|
|
25
|
+
export declare function computeCompletions(doc: TextDocument, position: Position): CompletionItem[];
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../src/lsp/completion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAGd,UAAU,EAEX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAKvE,KAAK,QAAQ,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAQxD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAYhE;AAcD,2EAA2E;AAC3E,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAEjD;AAsDD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,QAAQ,GACjB,cAAc,EAAE,CAyBlB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { CompletionItemKind, InsertTextFormat, MarkupKind, TextEdit, } from "vscode-languageserver";
|
|
2
|
+
import { getLocation } from "jsonc-parser";
|
|
3
|
+
import { classifyDocument, isJsonUri } from "./gate.js";
|
|
4
|
+
import { getRegistry } from "./registry.js";
|
|
5
|
+
/**
|
|
6
|
+
* Cursor is at a step-object key position: `…/steps/<index>/<partialKey>`.
|
|
7
|
+
* Offers action-key completions.
|
|
8
|
+
*/
|
|
9
|
+
export function isStepKeyContext(path) {
|
|
10
|
+
const n = path.length;
|
|
11
|
+
return (n >= 3 &&
|
|
12
|
+
typeof path[n - 1] === "string" &&
|
|
13
|
+
typeof path[n - 2] === "number" &&
|
|
14
|
+
path[n - 3] === "steps");
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Cursor is at a key position inside an action object:
|
|
18
|
+
* `…/steps/<index>/<actionKey>/<partialKey>`. Returns the action key, or null.
|
|
19
|
+
*/
|
|
20
|
+
export function actionFieldContext(path) {
|
|
21
|
+
const n = path.length;
|
|
22
|
+
if (n >= 4 &&
|
|
23
|
+
typeof path[n - 1] === "string" &&
|
|
24
|
+
typeof path[n - 2] === "string" &&
|
|
25
|
+
typeof path[n - 3] === "number" &&
|
|
26
|
+
path[n - 4] === "steps") {
|
|
27
|
+
return path[n - 2];
|
|
28
|
+
}
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The value placeholder inserted after an action key. Quotes the tab-stop only
|
|
33
|
+
* for string scalars — a numeric (`wait`) or boolean (`stopRecord`) action gets
|
|
34
|
+
* a bare placeholder so the starter isn't schema-invalid; object-only actions
|
|
35
|
+
* get a brace body.
|
|
36
|
+
*/
|
|
37
|
+
function valueSnippet(primitiveKind) {
|
|
38
|
+
if (primitiveKind === "string")
|
|
39
|
+
return '"$1"';
|
|
40
|
+
if (primitiveKind === "number" || primitiveKind === "boolean")
|
|
41
|
+
return "$1";
|
|
42
|
+
return "{\n\t$1\n}";
|
|
43
|
+
}
|
|
44
|
+
/** A Markdown documentation payload, or undefined when there's no text. */
|
|
45
|
+
export function markdownDoc(text) {
|
|
46
|
+
return text ? { kind: MarkupKind.Markdown, value: text } : undefined;
|
|
47
|
+
}
|
|
48
|
+
/** Build a snippet TextEdit that replaces the partial key node, if present. */
|
|
49
|
+
function keyTextEdit(doc, previousNode, insertText) {
|
|
50
|
+
// When the cursor is on a partial key, jsonc reports the enclosing node whose
|
|
51
|
+
// span covers the key (and any `:value` already typed). We're gated on
|
|
52
|
+
// isAtPropertyKey, so replacing that whole span with the snippet avoids
|
|
53
|
+
// doubled quotes and leftover `:` fragments.
|
|
54
|
+
if (previousNode) {
|
|
55
|
+
const start = doc.positionAt(previousNode.offset);
|
|
56
|
+
const end = doc.positionAt(previousNode.offset + previousNode.length);
|
|
57
|
+
return { textEdit: TextEdit.replace({ start, end }, insertText) };
|
|
58
|
+
}
|
|
59
|
+
// Truly empty object (`{}`): no key token to replace — insert at the cursor.
|
|
60
|
+
return { insertText };
|
|
61
|
+
}
|
|
62
|
+
function actionItem(action, doc, previousNode) {
|
|
63
|
+
const insert = `"${action.key}": ${valueSnippet(action.primitiveKind)}`;
|
|
64
|
+
const edit = keyTextEdit(doc, previousNode, insert);
|
|
65
|
+
return {
|
|
66
|
+
label: action.key,
|
|
67
|
+
kind: CompletionItemKind.Property,
|
|
68
|
+
detail: action.title,
|
|
69
|
+
documentation: markdownDoc(action.description),
|
|
70
|
+
insertTextFormat: InsertTextFormat.Snippet,
|
|
71
|
+
...edit,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function fieldItem(field, doc, previousNode) {
|
|
75
|
+
const insert = `"${field.name}": ${valueSnippet(field.primitiveKind)}`;
|
|
76
|
+
const edit = keyTextEdit(doc, previousNode, insert);
|
|
77
|
+
return {
|
|
78
|
+
label: field.name,
|
|
79
|
+
kind: CompletionItemKind.Field,
|
|
80
|
+
documentation: markdownDoc(field.description),
|
|
81
|
+
insertTextFormat: InsertTextFormat.Snippet,
|
|
82
|
+
...edit,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Compute completions at a position. Phase 2: action-key completion inside a
|
|
87
|
+
* `steps` element, and field-name completion inside a known action's object.
|
|
88
|
+
* Spec documents only, JSON only, key positions only.
|
|
89
|
+
*/
|
|
90
|
+
export function computeCompletions(doc, position) {
|
|
91
|
+
const text = doc.getText();
|
|
92
|
+
if (classifyDocument({ uri: doc.uri, text }) !== "spec")
|
|
93
|
+
return [];
|
|
94
|
+
if (!isJsonUri(doc.uri))
|
|
95
|
+
return [];
|
|
96
|
+
const offset = doc.offsetAt(position);
|
|
97
|
+
const location = getLocation(text, offset);
|
|
98
|
+
if (!location.isAtPropertyKey)
|
|
99
|
+
return [];
|
|
100
|
+
const registry = getRegistry();
|
|
101
|
+
const previousNode = location.previousNode;
|
|
102
|
+
if (isStepKeyContext(location.path)) {
|
|
103
|
+
return registry.actions.map((a) => actionItem(a, doc, previousNode));
|
|
104
|
+
}
|
|
105
|
+
const actionKey = actionFieldContext(location.path);
|
|
106
|
+
if (actionKey) {
|
|
107
|
+
const action = registry.byKey.get(actionKey);
|
|
108
|
+
if (action) {
|
|
109
|
+
return action.fields.map((f) => fieldItem(f, doc, previousNode));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../../src/lsp/completion.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,gBAAgB,EAChB,UAAU,EACV,QAAQ,GACT,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,WAAW,EAAa,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,WAAW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d,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7C,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Diagnostic } from "vscode-languageserver";
|
|
2
|
+
import type { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
import { DIAGNOSTIC_SOURCE, ACTION_KEYED_MESSAGE, V2_DEPRECATION_MESSAGE, schemaMessage } from "./messages.js";
|
|
4
|
+
export { DIAGNOSTIC_SOURCE, ACTION_KEYED_MESSAGE, V2_DEPRECATION_MESSAGE, schemaMessage, };
|
|
5
|
+
/**
|
|
6
|
+
* Should this schema error be dropped because an action-keyed step already
|
|
7
|
+
* explains it? Two cases: (1) the error sits at/under the offending step, or
|
|
8
|
+
* (2) it's a vague container `anyOf`/`oneOf` failure on an *ancestor* of that
|
|
9
|
+
* step — the propagation of the same problem up to the test/spec level, which
|
|
10
|
+
* says only "must match a schema in anyOf" and is useless next to the precise
|
|
11
|
+
* action-keyed diagnostic.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isSuppressedByActionKeyed(instancePath: string, keyword: string | undefined, suppressedPointers: string[]): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Compute all diagnostics for a document. Pure over (uri, text): no filesystem,
|
|
16
|
+
* no network. Handles JSON and YAML specs/configs. Returns `[]` for anything the
|
|
17
|
+
* detection gate doesn't recognize and for empty/unparseable buffers (beyond
|
|
18
|
+
* the syntax errors themselves).
|
|
19
|
+
*/
|
|
20
|
+
export declare function computeDiagnostics(doc: TextDocument): Diagnostic[];
|
|
21
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/lsp/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAGX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAMvE,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,EACd,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,GACd,CAAC;AA4BF;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,kBAAkB,EAAE,MAAM,EAAE,GAC3B,OAAO,CAWT;AAGD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,UAAU,EAAE,CAwFlE"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { DiagnosticSeverity, } from "vscode-languageserver";
|
|
2
|
+
import { validate } from "../common/src/validate.js";
|
|
3
|
+
import { classifyDocument } from "./gate.js";
|
|
4
|
+
import { buildModel } from "./model.js";
|
|
5
|
+
import { fileTypeForUri, computeInlineDiagnostics } from "./inline.js";
|
|
6
|
+
import { DIAGNOSTIC_SOURCE, ACTION_KEYED_MESSAGE, V2_DEPRECATION_MESSAGE, schemaMessage, } from "./messages.js";
|
|
7
|
+
// Re-exported so existing importers (and tests) keep a single entry point.
|
|
8
|
+
export { DIAGNOSTIC_SOURCE, ACTION_KEYED_MESSAGE, V2_DEPRECATION_MESSAGE, schemaMessage, };
|
|
9
|
+
const SCHEMA_FOR_CLASS = {
|
|
10
|
+
spec: "spec_v3",
|
|
11
|
+
config: "config_v3",
|
|
12
|
+
};
|
|
13
|
+
function offsetRangeToLspRange(doc, range) {
|
|
14
|
+
return {
|
|
15
|
+
start: doc.positionAt(range.start),
|
|
16
|
+
end: doc.positionAt(range.end),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Is `instancePath` inside (or equal to) the step at `pointer`? Used to drop
|
|
21
|
+
* the raw `anyOf` schema errors for a step we've already explained with the
|
|
22
|
+
* friendly action-keyed diagnostic.
|
|
23
|
+
*/
|
|
24
|
+
function isUnderPointer(instancePath, pointer) {
|
|
25
|
+
return instancePath === pointer || instancePath.startsWith(pointer + "/");
|
|
26
|
+
}
|
|
27
|
+
/** Is `pointer` inside (or equal to) `instancePath`? (The inverse relation.) */
|
|
28
|
+
function pointerIsUnder(pointer, instancePath) {
|
|
29
|
+
return pointer === instancePath || pointer.startsWith(instancePath + "/");
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Should this schema error be dropped because an action-keyed step already
|
|
33
|
+
* explains it? Two cases: (1) the error sits at/under the offending step, or
|
|
34
|
+
* (2) it's a vague container `anyOf`/`oneOf` failure on an *ancestor* of that
|
|
35
|
+
* step — the propagation of the same problem up to the test/spec level, which
|
|
36
|
+
* says only "must match a schema in anyOf" and is useless next to the precise
|
|
37
|
+
* action-keyed diagnostic.
|
|
38
|
+
*/
|
|
39
|
+
export function isSuppressedByActionKeyed(instancePath, keyword, suppressedPointers) {
|
|
40
|
+
return suppressedPointers.some((pointer) => {
|
|
41
|
+
if (isUnderPointer(instancePath, pointer))
|
|
42
|
+
return true;
|
|
43
|
+
if ((keyword === "anyOf" || keyword === "oneOf") &&
|
|
44
|
+
pointerIsUnder(pointer, instancePath)) {
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Compute all diagnostics for a document. Pure over (uri, text): no filesystem,
|
|
52
|
+
* no network. Handles JSON and YAML specs/configs. Returns `[]` for anything the
|
|
53
|
+
* detection gate doesn't recognize and for empty/unparseable buffers (beyond
|
|
54
|
+
* the syntax errors themselves).
|
|
55
|
+
*/
|
|
56
|
+
export function computeDiagnostics(doc) {
|
|
57
|
+
const text = doc.getText();
|
|
58
|
+
// Markup files (markdown/asciidoc/html/dita) carry tests inline, not as a
|
|
59
|
+
// whole-file spec — route them to the inline pipeline. Naturally silent on
|
|
60
|
+
// files without any Doc Detective statements.
|
|
61
|
+
const markupFileType = fileTypeForUri(doc.uri);
|
|
62
|
+
if (markupFileType)
|
|
63
|
+
return computeInlineDiagnostics(doc, markupFileType);
|
|
64
|
+
const cls = classifyDocument({ uri: doc.uri, text });
|
|
65
|
+
if (!cls)
|
|
66
|
+
return [];
|
|
67
|
+
const model = buildModel(doc.uri, text);
|
|
68
|
+
/* c8 ignore next - classify only returns non-null for .json/.yaml/.yml, which buildModel handles */
|
|
69
|
+
if (!model)
|
|
70
|
+
return [];
|
|
71
|
+
// Surface syntax errors ourselves: because the plugin maps specs to a
|
|
72
|
+
// dedicated language id, the editor's built-in JSON/YAML service may not run.
|
|
73
|
+
const diagnostics = model.syntaxErrors.map((e) => ({
|
|
74
|
+
severity: DiagnosticSeverity.Error,
|
|
75
|
+
range: offsetRangeToLspRange(doc, e.range),
|
|
76
|
+
message: e.message,
|
|
77
|
+
source: DIAGNOSTIC_SOURCE,
|
|
78
|
+
}));
|
|
79
|
+
// A syntactically broken buffer can't be meaningfully schema-checked — the
|
|
80
|
+
// partial value produces misleading "must be object" noise. Show the syntax
|
|
81
|
+
// errors; schema diagnostics reappear once the document parses cleanly.
|
|
82
|
+
if (diagnostics.length > 0)
|
|
83
|
+
return diagnostics;
|
|
84
|
+
const value = model.value;
|
|
85
|
+
if (!value || typeof value !== "object")
|
|
86
|
+
return diagnostics;
|
|
87
|
+
const actionKeyed = model.actionKeyedSteps();
|
|
88
|
+
const result = validate({
|
|
89
|
+
schemaKey: SCHEMA_FOR_CLASS[cls],
|
|
90
|
+
object: value,
|
|
91
|
+
addDefaults: false,
|
|
92
|
+
structuredErrors: true,
|
|
93
|
+
});
|
|
94
|
+
// `structuredErrors: true` guarantees `errorObjects` is populated (empty when
|
|
95
|
+
// valid), so it is never undefined here.
|
|
96
|
+
const errorObjects = result.errorObjects;
|
|
97
|
+
// Decide each action-keyed step's fate *per step*, by whether AJV flagged an
|
|
98
|
+
// error at/under that specific step's pointer:
|
|
99
|
+
// - own errors → the step is genuinely invalid v3 → flagship error, and its
|
|
100
|
+
// raw anyOf noise is suppressed in favor of that one message.
|
|
101
|
+
// - no errors → a valid legacy v2 step (it transforms to v3) → a
|
|
102
|
+
// non-blocking deprecation nudge, and we do NOT suppress
|
|
103
|
+
// unrelated errors on its behalf.
|
|
104
|
+
// This keeps a valid v2 step from being mislabeled just because some *other*
|
|
105
|
+
// part of the document failed to validate.
|
|
106
|
+
const invalidPointers = actionKeyed
|
|
107
|
+
.map((step) => step.pointer)
|
|
108
|
+
.filter((pointer) => errorObjects.some((error) => isUnderPointer(error.instancePath, pointer)));
|
|
109
|
+
for (const error of errorObjects) {
|
|
110
|
+
const instancePath = error.instancePath;
|
|
111
|
+
if (isSuppressedByActionKeyed(instancePath, error.keyword, invalidPointers)) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
const offsetRange = model.rangeForPath(instancePath);
|
|
115
|
+
/* c8 ignore next - rangeForPath always resolves to at least the root for a parsed tree */
|
|
116
|
+
if (!offsetRange)
|
|
117
|
+
continue;
|
|
118
|
+
diagnostics.push({
|
|
119
|
+
severity: DiagnosticSeverity.Error,
|
|
120
|
+
range: offsetRangeToLspRange(doc, offsetRange),
|
|
121
|
+
message: schemaMessage(error),
|
|
122
|
+
source: DIAGNOSTIC_SOURCE,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
for (const step of actionKeyed) {
|
|
126
|
+
const invalid = invalidPointers.includes(step.pointer);
|
|
127
|
+
diagnostics.push({
|
|
128
|
+
severity: invalid ? DiagnosticSeverity.Error : DiagnosticSeverity.Warning,
|
|
129
|
+
range: offsetRangeToLspRange(doc, step.keyRange),
|
|
130
|
+
message: invalid ? ACTION_KEYED_MESSAGE : V2_DEPRECATION_MESSAGE,
|
|
131
|
+
source: DIAGNOSTIC_SOURCE,
|
|
132
|
+
code: invalid ? "action-keyed-step" : "legacy-v2-step",
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
return diagnostics;
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/lsp/diagnostics.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,GAEnB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAY,MAAM,WAAW,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,2EAA2E;AAC3E,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,aAAa,GACd,CAAC;AAEF,MAAM,gBAAgB,GAA4C;IAChE,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,WAAW;CACpB,CAAC;AAEF,SAAS,qBAAqB,CAAC,GAAiB,EAAE,KAAkB;IAClE,OAAO;QACL,KAAK,EAAE,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC;QAClC,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC;KAC/B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAS,cAAc,CAAC,YAAoB,EAAE,OAAe;IAC3D,OAAO,YAAY,KAAK,OAAO,IAAI,YAAY,CAAC,UA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+
/**
|
|
2
|
+
* What kind of Doc Detective document a buffer is, or `null` when the buffer is
|
|
3
|
+
* not a Doc Detective document at all. The server stays completely silent
|
|
4
|
+
* (no diagnostics, no completion) for `null` — the detection gate is biased
|
|
5
|
+
* toward silence, because false noise on an unrelated `package.json` is far
|
|
6
|
+
* worse than a real spec that a user has to opt into with `$schema`.
|
|
7
|
+
*/
|
|
8
|
+
export type DocClass = "spec" | "config" | null;
|
|
9
|
+
export interface ClassifyInput {
|
|
10
|
+
/** Document URI (e.g. `file:///abs/path/foo.spec.json`). */
|
|
11
|
+
uri: string;
|
|
12
|
+
/** Full document text. */
|
|
13
|
+
text: string;
|
|
14
|
+
}
|
|
15
|
+
/** Extract a lowercase basename from a URI or path, sans query/fragment. */
|
|
16
|
+
export declare function basenameFromUri(uri: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Classify a document by filename first, then by an explicit `$schema` opt-in,
|
|
19
|
+
* then by a shape sniff — in that order of confidence. Pure: no filesystem, no
|
|
20
|
+
* network, tolerant of syntactically broken buffers (an editor sends those
|
|
21
|
+
* constantly), so it never throws.
|
|
22
|
+
*/
|
|
23
|
+
export declare function classifyDocument({ uri, text }: ClassifyInput): DocClass;
|
|
24
|
+
/** Convenience predicate: is this a document the server should touch at all? */
|
|
25
|
+
export declare function shouldHandleDocument(input: ClassifyInput): boolean;
|
|
26
|
+
/** Is this URI a JSON document (by extension)? */
|
|
27
|
+
export declare function isJsonUri(uri: string): boolean;
|
|
28
|
+
/** Is this URI a YAML document (by extension)? */
|
|
29
|
+
export declare function isYamlUri(uri: string): boolean;
|
|
30
|
+
//# sourceMappingURL=gate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/lsp/gate.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,IAAI,CAAC;AAEhD,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,GAAG,EAAE,MAAM,CAAC;IACZ,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKnD;AAKD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,aAAa,GAAG,QAAQ,CA6CvE;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAElE;AAED,kDAAkD;AAClD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED,kDAAkD;AAClD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAG9C"}
|
package/dist/lsp/gate.js
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { parse as parseJsonc } from "jsonc-parser";
|
|
2
|
+
import YAML from "yaml";
|
|
3
|
+
/** Extract a lowercase basename from a URI or path, sans query/fragment. */
|
|
4
|
+
export function basenameFromUri(uri) {
|
|
5
|
+
// Strip scheme/query/fragment, then take the last path segment.
|
|
6
|
+
const withoutQuery = uri.split(/[?#]/)[0];
|
|
7
|
+
const segments = withoutQuery.split(/[\\/]/);
|
|
8
|
+
return (segments[segments.length - 1] || "").toLowerCase();
|
|
9
|
+
}
|
|
10
|
+
const SPEC_NAME = /\.spec\.(json|ya?ml)$/;
|
|
11
|
+
const CONFIG_NAME = /^\.doc-detective\.(json|ya?ml)$/;
|
|
12
|
+
/**
|
|
13
|
+
* Classify a document by filename first, then by an explicit `$schema` opt-in,
|
|
14
|
+
* then by a shape sniff — in that order of confidence. Pure: no filesystem, no
|
|
15
|
+
* network, tolerant of syntactically broken buffers (an editor sends those
|
|
16
|
+
* constantly), so it never throws.
|
|
17
|
+
*/
|
|
18
|
+
export function classifyDocument({ uri, text }) {
|
|
19
|
+
const name = basenameFromUri(uri);
|
|
20
|
+
// 1. Filename convention — highest confidence.
|
|
21
|
+
if (SPEC_NAME.test(name))
|
|
22
|
+
return "spec";
|
|
23
|
+
if (CONFIG_NAME.test(name))
|
|
24
|
+
return "config";
|
|
25
|
+
// For anything else we only engage on an explicit signal in the content.
|
|
26
|
+
// Parse leniently by extension: YAML files through the YAML parser, everything
|
|
27
|
+
// else through jsonc (tolerant of trailing commas / comments). Both are
|
|
28
|
+
// wrapped so a malformed buffer classifies as `null` rather than throwing.
|
|
29
|
+
const isYaml = name.endsWith(".yaml") || name.endsWith(".yml");
|
|
30
|
+
let parsed;
|
|
31
|
+
try {
|
|
32
|
+
if (isYaml) {
|
|
33
|
+
parsed = YAML.parse(text);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// jsonc.parse returns a *partial* value for malformed input (`{"tests":[],`
|
|
37
|
+
// yields `{tests:[]}`), which would wrongly classify garbage as a spec.
|
|
38
|
+
// Collect its errors and refuse to classify when any remain.
|
|
39
|
+
const errors = [];
|
|
40
|
+
parsed = parseJsonc(text, errors, { allowTrailingComma: true });
|
|
41
|
+
if (errors.length > 0)
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
// 2. Explicit `$schema` opt-in — the documented escape hatch for
|
|
52
|
+
// non-conventionally-named files.
|
|
53
|
+
if (typeof parsed.$schema === "string") {
|
|
54
|
+
if (parsed.$schema.includes("spec_v3"))
|
|
55
|
+
return "spec";
|
|
56
|
+
if (parsed.$schema.includes("config_v3"))
|
|
57
|
+
return "config";
|
|
58
|
+
}
|
|
59
|
+
// 3. Shape sniff — only the spec shape is distinctive enough to trust
|
|
60
|
+
// without a name or `$schema`. A top-level `tests` array is the
|
|
61
|
+
// spec_v3 signature. Config is deliberately NOT sniffed: too many
|
|
62
|
+
// unrelated JSON files would match a permissive config shape.
|
|
63
|
+
if (Array.isArray(parsed.tests))
|
|
64
|
+
return "spec";
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
/** Convenience predicate: is this a document the server should touch at all? */
|
|
68
|
+
export function shouldHandleDocument(input) {
|
|
69
|
+
return classifyDocument(input) !== null;
|
|
70
|
+
}
|
|
71
|
+
/** Is this URI a JSON document (by extension)? */
|
|
72
|
+
export function isJsonUri(uri) {
|
|
73
|
+
return basenameFromUri(uri).endsWith(".json");
|
|
74
|
+
}
|
|
75
|
+
/** Is this URI a YAML document (by extension)? */
|
|
76
|
+
export function isYamlUri(uri) {
|
|
77
|
+
const name = basenameFromUri(uri);
|
|
78
|
+
return name.endsWith(".yaml") || name.endsWith(".yml");
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gate.js","sourceRoot":"","sources":["../../src/lsp/gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,UAAU,EAAmB,MAAM,cAAc,CAAC;AACpE,OAAO,IAAI,MAAM,MAAM,CAAC;AAkBxB,4EAA4E;AAC5E,MAAM,UAAU,eAAe,CAAC,GAAW;IACzC,gEAAgE;IAChE,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7D,CAAC;AAED,MAAM,SAAS,GAAG,uBAAuB,CAAC;AAC1C,MAAM,WAAW,GAAG,iCAAiC,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAE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AC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,QAAQ,CAAC;IAC5D,CAAC;IAED,sEAAsE;IACtE,mEAAmE;IACnE,qEAAqE;IACrE,iEAAiE;IACjE,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC;IAE/C,OAAO,IAAI,CAAC;AACd,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,oBAAoB,CAAC,KAAoB;IACvD,OAAO,gBAAgB,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;AAC1C,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,eAAe,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,kDAAkD;AAClD,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,MAAM,IAAI,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Hover, type Position } from "vscode-languageserver";
|
|
2
|
+
import type { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
/**
|
|
4
|
+
* Hover over an action key (a step's `"goTo"`, `"find"`, …) surfaces that
|
|
5
|
+
* action's description straight from the schema — one source of truth, no
|
|
6
|
+
* hand-written copies. Spec + JSON only.
|
|
7
|
+
*/
|
|
8
|
+
export declare function computeHover(doc: TextDocument, position: Position): Hover | null;
|
|
9
|
+
//# sourceMappingURL=hover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../src/lsp/hover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,KAAK,EAAE,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AA6BvE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,GAAG,KAAK,GAAG,IAAI,CAyBhF"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { MarkupKind } from "vscode-languageserver";
|
|
2
|
+
import { findNodeAtOffset, parseTree } from "jsonc-parser";
|
|
3
|
+
import { classifyDocument, isJsonUri } from "./gate.js";
|
|
4
|
+
import { getRegistry } from "./registry.js";
|
|
5
|
+
/**
|
|
6
|
+
* Is `keyNode` the key of a property that is a direct child of a `steps`
|
|
7
|
+
* array element? Walks: string(key) → property → object(step) → array →
|
|
8
|
+
* property("steps"). Returns true only for an action key on a step.
|
|
9
|
+
*/
|
|
10
|
+
function isStepPropertyKey(keyNode) {
|
|
11
|
+
const property = keyNode.parent;
|
|
12
|
+
if (!property ||
|
|
13
|
+
property.type !== "property" ||
|
|
14
|
+
property.children?.[0] !== keyNode) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
const stepObject = property.parent;
|
|
18
|
+
const array = stepObject?.parent;
|
|
19
|
+
const arrayProperty = array?.parent;
|
|
20
|
+
return (array?.type === "array" &&
|
|
21
|
+
arrayProperty?.type === "property" &&
|
|
22
|
+
arrayProperty.children?.[0]?.value === "steps");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Hover over an action key (a step's `"goTo"`, `"find"`, …) surfaces that
|
|
26
|
+
* action's description straight from the schema — one source of truth, no
|
|
27
|
+
* hand-written copies. Spec + JSON only.
|
|
28
|
+
*/
|
|
29
|
+
export function computeHover(doc, position) {
|
|
30
|
+
const text = doc.getText();
|
|
31
|
+
if (classifyDocument({ uri: doc.uri, text }) !== "spec")
|
|
32
|
+
return null;
|
|
33
|
+
if (!isJsonUri(doc.uri))
|
|
34
|
+
return null;
|
|
35
|
+
const root = parseTree(text);
|
|
36
|
+
if (!root)
|
|
37
|
+
return null;
|
|
38
|
+
const offset = doc.offsetAt(position);
|
|
39
|
+
const node = findNodeAtOffset(root, offset);
|
|
40
|
+
if (!node || node.type !== "string" || !isStepPropertyKey(node))
|
|
41
|
+
return null;
|
|
42
|
+
const action = getRegistry().byKey.get(node.value);
|
|
43
|
+
if (!action)
|
|
44
|
+
return null;
|
|
45
|
+
const parts = [`**${action.title}**`];
|
|
46
|
+
if (action.description)
|
|
47
|
+
parts.push("", action.description);
|
|
48
|
+
return {
|
|
49
|
+
contents: { kind: MarkupKind.Markdown, value: parts.join("\n") },
|
|
50
|
+
range: {
|
|
51
|
+
start: doc.positionAt(node.offset),
|
|
52
|
+
end: doc.positionAt(node.offset + node.length),
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=hover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hover.js","sourceRoot":"","sources":["../../src/lsp/hover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA6B,MAAM,uBAAuB,CAAC;AAE9E,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAa,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,OAAa;IACtC,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAChC,IACE,CAAC,QAAQ;QACT,QAAQ,CAAC,IAAI,KAAK,UAAU;QAC5B,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,OAAO,EAClC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC;IACnC,MAAM,KAAK,GAAG,UAA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AM,CAAC,WAAW,CAAC,CAAC;IAE3D,OAAO;QACL,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAChE,KAAK,EAAE;YACL,KAAK,EAAE,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;YAClC,GAAG,EAAE,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;SAC/C;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Diagnostic } from "vscode-languageserver";
|
|
2
|
+
import type { TextDocument } from "vscode-languageserver-textdocument";
|
|
3
|
+
import { type FileType } from "../common/src/fileTypes.js";
|
|
4
|
+
import { type OffsetRange } from "./json/positions.js";
|
|
5
|
+
/** Find the fileType whose extensions match this URI, or null. */
|
|
6
|
+
export declare function fileTypeForUri(uri: string): FileType | null;
|
|
7
|
+
/** A raw inline statement: its parsed payload and the payload's source span. */
|
|
8
|
+
interface InlineStatement {
|
|
9
|
+
payload: any;
|
|
10
|
+
/** Whether parseObject could turn the captured text into an object. */
|
|
11
|
+
parsed: boolean;
|
|
12
|
+
range: OffsetRange;
|
|
13
|
+
}
|
|
14
|
+
export declare function collectMatchOffsets(text: string, patterns?: string[]): number[];
|
|
15
|
+
/** Extract statements of one kind (testStart / step) with payloads + spans. */
|
|
16
|
+
export declare function extractStatements(text: string, patterns: string[] | undefined, ignore: OffsetRange[]): InlineStatement[];
|
|
17
|
+
/**
|
|
18
|
+
* Compute diagnostics for inline Doc Detective test statements embedded in a
|
|
19
|
+
* markup document (markdown/asciidoc/html/dita, or a config fileType). Only the
|
|
20
|
+
* `test` open and `step` statement regions the runner recognizes get language
|
|
21
|
+
* features — the rest of the prose is left alone.
|
|
22
|
+
*/
|
|
23
|
+
export declare function computeInlineDiagnostics(doc: TextDocument, fileType: FileType): Diagnostic[];
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=inline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/lsp/inline.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAGX,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAGvE,OAAO,EAAoB,KAAK,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG7E,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAoBxE,kEAAkE;AAClE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAS3D;AAED,gFAAgF;AAChF,UAAU,eAAe;IACvB,OAAO,EAAE,GAAG,CAAC;IACb,uEAAuE;IACvE,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,WAAW,CAAC;CACpB;AA2BD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAe/E;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAAE,GAAG,SAAS,EAC9B,MAAM,EAAE,WAAW,EAAE,GACpB,eAAe,EAAE,CAwBnB;AAkGD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,QAAQ,GACjB,UAAU,EAAE,CAad"}
|