@markup-carve/carve-lsp 0.1.4 → 0.1.7
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 +41 -21
- package/dist/analyze.js +46 -8
- package/dist/analyze.js.map +1 -1
- package/dist/analyze.test.js +5 -4
- package/dist/analyze.test.js.map +1 -1
- package/dist/definition.d.ts +1 -1
- package/dist/definition.js +76 -0
- package/dist/definition.js.map +1 -1
- package/dist/include-completion.js +226 -30
- package/dist/include-completion.js.map +1 -1
- package/dist/include-completion.test.js +266 -7
- package/dist/include-completion.test.js.map +1 -1
- package/dist/include-definition.js +31 -4
- package/dist/include-definition.js.map +1 -1
- package/dist/include-denial.d.ts +33 -0
- package/dist/include-denial.js +41 -0
- package/dist/include-denial.js.map +1 -0
- package/dist/include-denial.test.d.ts +1 -0
- package/dist/include-denial.test.js +126 -0
- package/dist/include-denial.test.js.map +1 -0
- package/dist/include-directive.js +118 -11
- package/dist/include-directive.js.map +1 -1
- package/dist/include-directive.test.js +42 -0
- package/dist/include-directive.test.js.map +1 -1
- package/dist/include-merge-diagnostics.test.d.ts +1 -0
- package/dist/include-merge-diagnostics.test.js +220 -0
- package/dist/include-merge-diagnostics.test.js.map +1 -0
- package/dist/include-path.d.ts +11 -6
- package/dist/include-path.js +10 -1
- package/dist/include-path.js.map +1 -1
- package/dist/include-path.test.js +23 -0
- package/dist/include-path.test.js.map +1 -1
- package/dist/include-resolver-guards.test.d.ts +1 -0
- package/dist/include-resolver-guards.test.js +227 -0
- package/dist/include-resolver-guards.test.js.map +1 -0
- package/dist/include-root-containment.test.d.ts +1 -0
- package/dist/include-root-containment.test.js +169 -0
- package/dist/include-root-containment.test.js.map +1 -0
- package/dist/include-seam-mapping.test.d.ts +1 -0
- package/dist/include-seam-mapping.test.js +181 -0
- package/dist/include-seam-mapping.test.js.map +1 -0
- package/dist/include-seam-navigation.test.d.ts +1 -0
- package/dist/include-seam-navigation.test.js +141 -0
- package/dist/include-seam-navigation.test.js.map +1 -0
- package/dist/include-security-conformance.test.js +281 -35
- package/dist/include-security-conformance.test.js.map +1 -1
- package/dist/include-selection-diagnostics.test.d.ts +1 -0
- package/dist/include-selection-diagnostics.test.js +120 -0
- package/dist/include-selection-diagnostics.test.js.map +1 -0
- package/dist/include-selection-navigation.test.d.ts +1 -0
- package/dist/include-selection-navigation.test.js +75 -0
- package/dist/include-selection-navigation.test.js.map +1 -0
- package/dist/include-selection.d.ts +14 -0
- package/dist/include-selection.js +67 -0
- package/dist/include-selection.js.map +1 -0
- package/dist/include-settings.d.ts +47 -2
- package/dist/include-settings.js +69 -6
- package/dist/include-settings.js.map +1 -1
- package/dist/include-settings.test.js +118 -0
- package/dist/include-settings.test.js.map +1 -1
- package/dist/includes.d.ts +112 -6
- package/dist/includes.js +375 -134
- package/dist/includes.js.map +1 -1
- package/dist/lsp-stdio-client.d.ts +33 -0
- package/dist/lsp-stdio-client.js +92 -0
- package/dist/lsp-stdio-client.js.map +1 -0
- package/dist/position-encoding.test.js +97 -1
- package/dist/position-encoding.test.js.map +1 -1
- package/dist/position.d.ts +11 -0
- package/dist/position.js +23 -0
- package/dist/position.js.map +1 -1
- package/dist/preview-includes.test.d.ts +1 -0
- package/dist/preview-includes.test.js +141 -0
- package/dist/preview-includes.test.js.map +1 -0
- package/dist/preview.d.ts +7 -0
- package/dist/preview.js +14 -0
- package/dist/preview.js.map +1 -0
- package/dist/server-capabilities.test.js +3 -56
- package/dist/server-capabilities.test.js.map +1 -1
- package/dist/server.js +22 -7
- package/dist/server.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two selections an include directive can carry - `#section` and a line
|
|
3
|
+
* range - resolved against a child's own source (PART 9 §19 I4, I5).
|
|
4
|
+
*
|
|
5
|
+
* Both are decidable from the child alone: no merge, no heading shift, no id
|
|
6
|
+
* renaming. That is what lets this server diagnose and navigate them while
|
|
7
|
+
* expansion itself still lives in the engine.
|
|
8
|
+
*
|
|
9
|
+
* Heading ids come from the resolver rather than a lexical scan, because the
|
|
10
|
+
* resolver is authoritative for Unicode, inline markup and duplicate suffixes.
|
|
11
|
+
* A lexical guess would report `include-section` against ids the engine
|
|
12
|
+
* generates perfectly well, and a false diagnostic on a working document is
|
|
13
|
+
* worse than a missing one.
|
|
14
|
+
*/
|
|
15
|
+
import { parse, resolve } from '@markup-carve/carve';
|
|
16
|
+
const HEADING_MARKER_RE = /^#{1,6}\s+/;
|
|
17
|
+
/** Every heading id the child declares, in document order. */
|
|
18
|
+
export function sections(source) {
|
|
19
|
+
const lines = source.replace(/\r\n?/g, '\n').split('\n');
|
|
20
|
+
let document;
|
|
21
|
+
try {
|
|
22
|
+
document = resolve(parse(source, { positions: true }));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
const found = [];
|
|
28
|
+
walk(document.children, (node) => {
|
|
29
|
+
if (node.type !== 'heading' || !node.pos || !node.attrs?.id)
|
|
30
|
+
return;
|
|
31
|
+
const line = node.pos.startLine - 1;
|
|
32
|
+
const text = lines[line] ?? '';
|
|
33
|
+
const character = Math.min(text.length, HEADING_MARKER_RE.exec(text)?.[0].length ?? 0);
|
|
34
|
+
found.push({
|
|
35
|
+
id: node.attrs.id,
|
|
36
|
+
range: { start: { line, character }, end: { line, character: text.length } },
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
return found;
|
|
40
|
+
}
|
|
41
|
+
/** Where a named section starts in the child, or undefined when it has none. */
|
|
42
|
+
export function sectionRange(source, id) {
|
|
43
|
+
return sections(source).find((section) => section.id === id)?.range;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Lines as the line-range option counts them. A trailing newline does not open
|
|
47
|
+
* a further line, so `@lines:3-3` on a three-line file is in range.
|
|
48
|
+
*/
|
|
49
|
+
export function lineCount(source) {
|
|
50
|
+
if (source === '')
|
|
51
|
+
return 0;
|
|
52
|
+
const normalized = source.replace(/\r\n?/g, '\n');
|
|
53
|
+
const lines = normalized.split('\n');
|
|
54
|
+
if (lines.length > 1 && lines[lines.length - 1] === '')
|
|
55
|
+
lines.pop();
|
|
56
|
+
return lines.length;
|
|
57
|
+
}
|
|
58
|
+
function walk(nodes, visit) {
|
|
59
|
+
for (const node of nodes) {
|
|
60
|
+
visit(node);
|
|
61
|
+
const children = node.children;
|
|
62
|
+
if (!Array.isArray(children))
|
|
63
|
+
continue;
|
|
64
|
+
walk(children.filter((child) => Boolean(child && typeof child === 'object' && 'type' in child)), visit);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=include-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"include-selection.js","sourceRoot":"","sources":["../src/include-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAkB,MAAM,qBAAqB,CAAA;AAQpE,MAAM,iBAAiB,GAAG,YAAY,CAAA;AAEtC,8DAA8D;AAC9D,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACxD,IAAI,QAAQ,CAAA;IACZ,IAAI,CAAC;QACH,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAA;IACX,CAAC;IACD,MAAM,KAAK,GAAc,EAAE,CAAA;IAC3B,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE;QAC/B,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,EA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AAA;IACnE,OAAO,KAAK,CAAC,MAAM,CAAA;AACrB,CAAC;AAED,SAAS,IAAI,CAAC,KAA2B,EAAE,KAAgC;IACzE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,CAAA;QACX,MAAM,QAAQ,GAAI,IAA+B,CAAC,QAAQ,CAAA;QAC1D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;YAAE,SAAQ;QACtC,IAAI,CACF,QAAQ,CAAC,MAAM,CACb,CAAC,KAAK,EAAsB,EAAE,CAC5B,OAAO,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,MAAM,IAAI,KAAK,CAAC,CACjE,EACD,KAAK,CACN,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -7,7 +7,13 @@ export interface IncludeSettings {
|
|
|
7
7
|
* OFF: silence is not consent.
|
|
8
8
|
*/
|
|
9
9
|
enabled: 'auto' | 'on' | 'off';
|
|
10
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Containment root override. Otherwise the workspace root, then the
|
|
12
|
+
* document's directory.
|
|
13
|
+
*
|
|
14
|
+
* Only an ABSOLUTE, non-blank path is a root. See {@link usableIncludeRoot}
|
|
15
|
+
* for why the other spellings are dropped rather than resolved.
|
|
16
|
+
*/
|
|
11
17
|
includeRoot?: string;
|
|
12
18
|
/** Allow absolute include paths, still subject to root containment. */
|
|
13
19
|
allowAbsolute?: boolean;
|
|
@@ -15,6 +21,8 @@ export interface IncludeSettings {
|
|
|
15
21
|
allowedRemoteHosts?: string[];
|
|
16
22
|
maxDepth?: number;
|
|
17
23
|
maxBytes?: number;
|
|
24
|
+
/** Resolver calls allowed for one walk. Default 1000. */
|
|
25
|
+
maxResolverCalls?: number;
|
|
18
26
|
}
|
|
19
27
|
export declare const DEFAULT_INCLUDE_SETTINGS: IncludeSettings;
|
|
20
28
|
/**
|
|
@@ -22,7 +30,39 @@ export declare const DEFAULT_INCLUDE_SETTINGS: IncludeSettings;
|
|
|
22
30
|
* `workspace/didChangeConfiguration` payload. Anything unrecognized falls back
|
|
23
31
|
* to the default rather than being trusted as given.
|
|
24
32
|
*/
|
|
25
|
-
export declare function readIncludeSettings(raw: unknown): IncludeSettings;
|
|
33
|
+
export declare function readIncludeSettings(raw: unknown, log?: (message: string) => void): IncludeSettings;
|
|
34
|
+
/**
|
|
35
|
+
* Whether a configured `includeRoot` is usable as a containment root, and why
|
|
36
|
+
* not when it is not.
|
|
37
|
+
*
|
|
38
|
+
* Both rejected spellings resolve against the PROCESS WORKING DIRECTORY, which
|
|
39
|
+
* is the one root §19 containment must never have: a language server is
|
|
40
|
+
* commonly spawned from the project the editor opened, from the user's home or
|
|
41
|
+
* from `/`, and none of those is the workspace.
|
|
42
|
+
*
|
|
43
|
+
* - BLANK. `realpathSync('')` returns the process working directory and does
|
|
44
|
+
* NOT throw, so a blank value is not a value that fails - it is a value that
|
|
45
|
+
* silently succeeds at the wrong root. An editor returns `''` for an unset
|
|
46
|
+
* string setting, so a client forwarding its setting unchanged sends one by
|
|
47
|
+
* default.
|
|
48
|
+
* - RELATIVE. The configuration protocol gives a relative path no base, so the
|
|
49
|
+
* only base available here is again the working directory. Resolving it
|
|
50
|
+
* against the workspace root instead would be a policy this server invented:
|
|
51
|
+
* it reads the client's intent, and a value such as `..` would widen the root
|
|
52
|
+
* ABOVE the workspace, which is the same escape by another route. Dropping it
|
|
53
|
+
* falls back to a root the client did name.
|
|
54
|
+
*
|
|
55
|
+
* Dropping is fail-closed in both cases: the fallback chain - workspace root,
|
|
56
|
+
* then the document's own directory - is never wider than the workspace.
|
|
57
|
+
*/
|
|
58
|
+
export declare function usableIncludeRoot(value: string): {
|
|
59
|
+
root: string;
|
|
60
|
+
ignored?: undefined;
|
|
61
|
+
} | {
|
|
62
|
+
root?: undefined;
|
|
63
|
+
ignored: 'blank' | 'relative';
|
|
64
|
+
};
|
|
65
|
+
export declare function ignoredIncludeRootMessage(value: string, reason: 'blank' | 'relative'): string;
|
|
26
66
|
/** Client-reported workspace trust. Absent means untrusted. */
|
|
27
67
|
export declare function readWorkspaceTrusted(raw: unknown): boolean;
|
|
28
68
|
export declare function fsPath(uri: string): string | undefined;
|
|
@@ -50,3 +90,8 @@ export interface IncludeGateInput {
|
|
|
50
90
|
* meaningless.
|
|
51
91
|
*/
|
|
52
92
|
export declare function includeOptionsFor(input: IncludeGateInput): IncludeOptions | undefined;
|
|
93
|
+
/**
|
|
94
|
+
* Include options for `carve.previewHtml`. The preview expands only under an
|
|
95
|
+
* explicitly configured root; otherwise it renders the source as written.
|
|
96
|
+
*/
|
|
97
|
+
export declare function previewIncludeOptionsFor(input: IncludeGateInput): IncludeOptions | undefined;
|
package/dist/include-settings.js
CHANGED
|
@@ -17,7 +17,7 @@ export const DEFAULT_INCLUDE_SETTINGS = { enabled: 'auto' };
|
|
|
17
17
|
* `workspace/didChangeConfiguration` payload. Anything unrecognized falls back
|
|
18
18
|
* to the default rather than being trusted as given.
|
|
19
19
|
*/
|
|
20
|
-
export function readIncludeSettings(raw) {
|
|
20
|
+
export function readIncludeSettings(raw, log) {
|
|
21
21
|
const source = raw?.carve
|
|
22
22
|
?.includes;
|
|
23
23
|
if (!source || typeof source !== 'object')
|
|
@@ -26,8 +26,14 @@ export function readIncludeSettings(raw) {
|
|
|
26
26
|
const settings = {
|
|
27
27
|
enabled: enabled === 'on' || enabled === 'off' ? enabled : 'auto',
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const configuredRoot = source['includeRoot'];
|
|
30
|
+
if (typeof configuredRoot === 'string') {
|
|
31
|
+
const verdict = usableIncludeRoot(configuredRoot);
|
|
32
|
+
if (verdict.root !== undefined)
|
|
33
|
+
settings.includeRoot = verdict.root;
|
|
34
|
+
else
|
|
35
|
+
log?.(ignoredIncludeRootMessage(configuredRoot, verdict.ignored));
|
|
36
|
+
}
|
|
31
37
|
if (typeof source['allowAbsolute'] === 'boolean')
|
|
32
38
|
settings.allowAbsolute = source['allowAbsolute'];
|
|
33
39
|
if (Array.isArray(source['allowedRemoteHosts'])) {
|
|
@@ -37,8 +43,48 @@ export function readIncludeSettings(raw) {
|
|
|
37
43
|
settings.maxDepth = source['maxDepth'];
|
|
38
44
|
if (typeof source['maxBytes'] === 'number')
|
|
39
45
|
settings.maxBytes = source['maxBytes'];
|
|
46
|
+
if (typeof source['maxResolverCalls'] === 'number') {
|
|
47
|
+
settings.maxResolverCalls = source['maxResolverCalls'];
|
|
48
|
+
}
|
|
40
49
|
return settings;
|
|
41
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Whether a configured `includeRoot` is usable as a containment root, and why
|
|
53
|
+
* not when it is not.
|
|
54
|
+
*
|
|
55
|
+
* Both rejected spellings resolve against the PROCESS WORKING DIRECTORY, which
|
|
56
|
+
* is the one root §19 containment must never have: a language server is
|
|
57
|
+
* commonly spawned from the project the editor opened, from the user's home or
|
|
58
|
+
* from `/`, and none of those is the workspace.
|
|
59
|
+
*
|
|
60
|
+
* - BLANK. `realpathSync('')` returns the process working directory and does
|
|
61
|
+
* NOT throw, so a blank value is not a value that fails - it is a value that
|
|
62
|
+
* silently succeeds at the wrong root. An editor returns `''` for an unset
|
|
63
|
+
* string setting, so a client forwarding its setting unchanged sends one by
|
|
64
|
+
* default.
|
|
65
|
+
* - RELATIVE. The configuration protocol gives a relative path no base, so the
|
|
66
|
+
* only base available here is again the working directory. Resolving it
|
|
67
|
+
* against the workspace root instead would be a policy this server invented:
|
|
68
|
+
* it reads the client's intent, and a value such as `..` would widen the root
|
|
69
|
+
* ABOVE the workspace, which is the same escape by another route. Dropping it
|
|
70
|
+
* falls back to a root the client did name.
|
|
71
|
+
*
|
|
72
|
+
* Dropping is fail-closed in both cases: the fallback chain - workspace root,
|
|
73
|
+
* then the document's own directory - is never wider than the workspace.
|
|
74
|
+
*/
|
|
75
|
+
export function usableIncludeRoot(value) {
|
|
76
|
+
if (value.trim() === '')
|
|
77
|
+
return { ignored: 'blank' };
|
|
78
|
+
if (!path.isAbsolute(value))
|
|
79
|
+
return { ignored: 'relative' };
|
|
80
|
+
return { root: value };
|
|
81
|
+
}
|
|
82
|
+
export function ignoredIncludeRootMessage(value, reason) {
|
|
83
|
+
const because = reason === 'blank'
|
|
84
|
+
? 'it is blank'
|
|
85
|
+
: `it is relative (${JSON.stringify(value)}), and a relative root would resolve against the server's working directory`;
|
|
86
|
+
return `Carve: ignoring carve.includes.includeRoot because ${because}; falling back to the workspace root.`;
|
|
87
|
+
}
|
|
42
88
|
/** Client-reported workspace trust. Absent means untrusted. */
|
|
43
89
|
export function readWorkspaceTrusted(raw) {
|
|
44
90
|
return raw?.workspaceTrusted === true;
|
|
@@ -98,9 +144,13 @@ export function includeOptionsFor(input) {
|
|
|
98
144
|
// directory to resolve against and gets no capability.
|
|
99
145
|
if (documentPath === undefined)
|
|
100
146
|
return undefined;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
147
|
+
// Defense in depth against a settings object built by hand rather than read
|
|
148
|
+
// through `readIncludeSettings`: an unusable root is ABSENT here too, so the
|
|
149
|
+
// fallback chain below is the same one an omitted key already takes.
|
|
150
|
+
const override = input.settings.includeRoot === undefined
|
|
151
|
+
? undefined
|
|
152
|
+
: usableIncludeRoot(input.settings.includeRoot).root;
|
|
153
|
+
const configured = override ?? workspaceRootFor(documentPath, input.workspaceRoots) ?? dirname(documentPath);
|
|
104
154
|
// Canonicalize the root here as well as inside the resolver, so that the
|
|
105
155
|
// root a caller sees on `includeRoot` is in the same coordinate system as
|
|
106
156
|
// the ids the resolver returns. Without it, a root reached through a symlink
|
|
@@ -131,6 +181,19 @@ export function includeOptionsFor(input) {
|
|
|
131
181
|
options.maxDepth = input.settings.maxDepth;
|
|
132
182
|
if (input.settings.maxBytes !== undefined)
|
|
133
183
|
options.maxBytes = input.settings.maxBytes;
|
|
184
|
+
if (input.settings.maxResolverCalls !== undefined) {
|
|
185
|
+
options.maxResolverCalls = input.settings.maxResolverCalls;
|
|
186
|
+
}
|
|
134
187
|
return options;
|
|
135
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* Include options for `carve.previewHtml`. The preview expands only under an
|
|
191
|
+
* explicitly configured root; otherwise it renders the source as written.
|
|
192
|
+
*/
|
|
193
|
+
export function previewIncludeOptionsFor(input) {
|
|
194
|
+
const configured = input.settings.includeRoot;
|
|
195
|
+
if (configured === undefined || usableIncludeRoot(configured).root === undefined)
|
|
196
|
+
return undefined;
|
|
197
|
+
return includeOptionsFor(input);
|
|
198
|
+
}
|
|
136
199
|
//# sourceMappingURL=include-settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"include-settings.js","sourceRoot":"","sources":["../src/include-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"include-settings.js","sourceRoot":"","sources":["../src/include-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AA6BtD,MAAM,CAAC,MAAM,wBAAwB,GAAoB,EAAE,OAAO,EAAE,MAAM,EAAE,CAAA;AAE5E;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY,EAAE,GAA+B;IAC/E,MAAM,MAAM,GAAI,GAAsE,EAAE,KAAK;QAC3F,EAAE,QAAQ,CAAA;IACZ,IAA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QAAQ,CAAA;IACrF,IAAI,KAAK,CAAC,QAAQ,CAAC,gBAAgB,KAAK,SAAS,EAAE,CAAC;QAClD,OAAO,CAAC,gBAAgB,GAAG,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAA;IAC5D,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAuB;IAC9D,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAA;IAC7C,IAAI,UAAU,KAAK,SAAS,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAA;IAClG,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAA;AACjC,CAAC"}
|
|
@@ -188,4 +188,122 @@ test('settings are read from the carve.includes section', () => {
|
|
|
188
188
|
maxBytes: 2048,
|
|
189
189
|
});
|
|
190
190
|
});
|
|
191
|
+
// ---------------------------------------------------------------------------
|
|
192
|
+
// The resolver-call bound (PART 9 §19), configurable like the other two totals
|
|
193
|
+
// ---------------------------------------------------------------------------
|
|
194
|
+
test('the resolver-call bound is read from the carve.includes section', () => {
|
|
195
|
+
const settings = readIncludeSettings({ carve: { includes: { maxResolverCalls: 25 } } });
|
|
196
|
+
assert.equal(settings.maxResolverCalls, 25);
|
|
197
|
+
});
|
|
198
|
+
test('a non-numeric resolver-call bound is ignored rather than trusted as given', () => {
|
|
199
|
+
const settings = readIncludeSettings({ carve: { includes: { maxResolverCalls: 'lots' } } });
|
|
200
|
+
assert.equal(settings.maxResolverCalls, undefined);
|
|
201
|
+
});
|
|
202
|
+
test('an unset resolver-call bound leaves the walk on its own default', () => {
|
|
203
|
+
const settings = readIncludeSettings({ carve: { includes: { enabled: 'on' } } });
|
|
204
|
+
assert.equal(settings.maxResolverCalls, undefined);
|
|
205
|
+
});
|
|
206
|
+
test('a configured resolver-call bound reaches the walk options', () => {
|
|
207
|
+
const dir = workspace();
|
|
208
|
+
const options = includeOptionsFor({
|
|
209
|
+
uri: pathToFileURL(path.join(dir, 'docs/main.crv')).href,
|
|
210
|
+
settings: { enabled: 'on', maxResolverCalls: 25 },
|
|
211
|
+
workspaceTrusted: true,
|
|
212
|
+
workspaceRoots: [dir],
|
|
213
|
+
});
|
|
214
|
+
assert.equal(options?.maxResolverCalls, 25);
|
|
215
|
+
});
|
|
216
|
+
test('an unconfigured resolver-call bound is left off the options entirely', () => {
|
|
217
|
+
// Absent rather than undefined-valued, so the walk applies its own default
|
|
218
|
+
// under exactOptionalPropertyTypes.
|
|
219
|
+
const dir = workspace();
|
|
220
|
+
const options = includeOptionsFor({
|
|
221
|
+
uri: pathToFileURL(path.join(dir, 'docs/main.crv')).href,
|
|
222
|
+
settings: { enabled: 'on' },
|
|
223
|
+
workspaceTrusted: true,
|
|
224
|
+
workspaceRoots: [dir],
|
|
225
|
+
});
|
|
226
|
+
assert.ok(options && !('maxResolverCalls' in options));
|
|
227
|
+
});
|
|
228
|
+
test('the resolver-call bound does not open the capability on its own', () => {
|
|
229
|
+
// §19 opt-in: a bound is a limit, never a grant.
|
|
230
|
+
const dir = workspace();
|
|
231
|
+
const options = includeOptionsFor({
|
|
232
|
+
uri: pathToFileURL(path.join(dir, 'docs/main.crv')).href,
|
|
233
|
+
settings: { enabled: 'auto', maxResolverCalls: 25 },
|
|
234
|
+
workspaceTrusted: false,
|
|
235
|
+
workspaceRoots: [dir],
|
|
236
|
+
});
|
|
237
|
+
assert.equal(options, undefined);
|
|
238
|
+
});
|
|
239
|
+
/**
|
|
240
|
+
* The reader-level half of the containment fix. The behavior it produces is
|
|
241
|
+
* pinned end-to-end in `include-root-containment.test.ts`, against the running
|
|
242
|
+
* server; these pin the seam and the wording the log carries.
|
|
243
|
+
*/
|
|
244
|
+
test('a blank includeRoot is read as absent, not as the working directory', () => {
|
|
245
|
+
const settings = readIncludeSettings({ carve: { includes: { enabled: 'on', includeRoot: '' } } });
|
|
246
|
+
assert.equal(settings.includeRoot, undefined);
|
|
247
|
+
});
|
|
248
|
+
test('a whitespace-only includeRoot is read as absent too', () => {
|
|
249
|
+
const settings = readIncludeSettings({
|
|
250
|
+
carve: { includes: { enabled: 'on', includeRoot: ' \t ' } },
|
|
251
|
+
});
|
|
252
|
+
assert.equal(settings.includeRoot, undefined);
|
|
253
|
+
});
|
|
254
|
+
test('a relative includeRoot is read as absent, since it has no base but the cwd', () => {
|
|
255
|
+
const settings = readIncludeSettings({
|
|
256
|
+
carve: { includes: { enabled: 'on', includeRoot: 'docs' } },
|
|
257
|
+
});
|
|
258
|
+
assert.equal(settings.includeRoot, undefined);
|
|
259
|
+
});
|
|
260
|
+
test('dropping a blank includeRoot does not disable includes', () => {
|
|
261
|
+
const settings = readIncludeSettings({ carve: { includes: { enabled: 'on', includeRoot: '' } } });
|
|
262
|
+
assert.equal(settings.enabled, 'on');
|
|
263
|
+
});
|
|
264
|
+
test('an absolute includeRoot is still read as given', () => {
|
|
265
|
+
const settings = readIncludeSettings({
|
|
266
|
+
carve: { includes: { enabled: 'on', includeRoot: '/ws/docs' } },
|
|
267
|
+
});
|
|
268
|
+
assert.equal(settings.includeRoot, '/ws/docs');
|
|
269
|
+
});
|
|
270
|
+
test('a dropped includeRoot is logged once, naming the reason', () => {
|
|
271
|
+
const logged = [];
|
|
272
|
+
readIncludeSettings({ carve: { includes: { includeRoot: '' } } }, (m) => logged.push(m));
|
|
273
|
+
assert.deepEqual(logged, [
|
|
274
|
+
'Carve: ignoring carve.includes.includeRoot because it is blank; falling back to the workspace root.',
|
|
275
|
+
]);
|
|
276
|
+
});
|
|
277
|
+
test('a dropped relative includeRoot names the value it dropped', () => {
|
|
278
|
+
const logged = [];
|
|
279
|
+
readIncludeSettings({ carve: { includes: { includeRoot: 'docs' } } }, (m) => logged.push(m));
|
|
280
|
+
assert.match(logged[0] ?? '', /relative \("docs"\)/);
|
|
281
|
+
});
|
|
282
|
+
test('an honored includeRoot logs nothing', () => {
|
|
283
|
+
const logged = [];
|
|
284
|
+
readIncludeSettings({ carve: { includes: { includeRoot: '/ws' } } }, (m) => logged.push(m));
|
|
285
|
+
assert.deepEqual(logged, []);
|
|
286
|
+
});
|
|
287
|
+
test('a blank includeRoot reaching includeOptionsFor directly falls back as well', () => {
|
|
288
|
+
// `readIncludeSettings` is not the only way an `IncludeSettings` is built;
|
|
289
|
+
// the containment decision is owned here, so the guard is here too.
|
|
290
|
+
const dir = workspace();
|
|
291
|
+
const options = includeOptionsFor({
|
|
292
|
+
uri: pathToFileURL(path.join(dir, 'docs/main.crv')).href,
|
|
293
|
+
settings: { enabled: 'on', includeRoot: '' },
|
|
294
|
+
workspaceTrusted: true,
|
|
295
|
+
workspaceRoots: [dir],
|
|
296
|
+
});
|
|
297
|
+
assert.equal(options?.includeRoot, dir);
|
|
298
|
+
});
|
|
299
|
+
test('a relative includeRoot reaching includeOptionsFor directly falls back as well', () => {
|
|
300
|
+
const dir = workspace();
|
|
301
|
+
const options = includeOptionsFor({
|
|
302
|
+
uri: pathToFileURL(path.join(dir, 'docs/main.crv')).href,
|
|
303
|
+
settings: { enabled: 'on', includeRoot: 'docs' },
|
|
304
|
+
workspaceTrusted: true,
|
|
305
|
+
workspaceRoots: [dir],
|
|
306
|
+
});
|
|
307
|
+
assert.equal(options?.includeRoot, dir);
|
|
308
|
+
});
|
|
191
309
|
//# sourceMappingURL=include-settings.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"include-settings.test.js","sourceRoot":"","sources":["../src/include-settings.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAClG,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC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AAE,IAAI;QACtB,cAAc,EAAE,CAAC,GAAG,CAAC;KACtB,CAAC,CAAA;IACF,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,CAAA;AACzC,CAAC,CAAC,CAAA"}
|
package/dist/includes.d.ts
CHANGED
|
@@ -1,5 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Include resolution for the language server (PART 9 §19), delegated to the
|
|
3
|
+
* engine.
|
|
4
|
+
*
|
|
5
|
+
* The rules are `expandIncludes`': it merges each child into the parent and
|
|
6
|
+
* reports every §19 degradation, including the six that are only decidable
|
|
7
|
+
* once the merge has happened - a clamped heading level, a renamed heading id
|
|
8
|
+
* or footnote label, block content at an inline position. This server used to
|
|
9
|
+
* carry its own walk because the pinned engine had no include pass; it has one
|
|
10
|
+
* now, so the walk is gone and there is one spelling of each rule again.
|
|
11
|
+
*
|
|
12
|
+
* What stays here is what a language server needs and the engine's contract
|
|
13
|
+
* cannot carry:
|
|
14
|
+
*
|
|
15
|
+
* - the ROOT anchor for every warning. The engine reports a child's problem at
|
|
16
|
+
* the child's own offsets, which is right for a renderer and unusable as an
|
|
17
|
+
* LSP range: the client has the root open. Each warning keeps its root span
|
|
18
|
+
* and gains {@link IncludeWarning.within} for the other end.
|
|
19
|
+
* - the `watch` candidate and the refusal class, which the engine's resolver
|
|
20
|
+
* contract has no slot for.
|
|
21
|
+
* - the child sources, which the outline and the seam location read back.
|
|
22
|
+
* - a sliced child's own coordinates. The engine slices before it parses, so a
|
|
23
|
+
* child pulled in with `@lines` reports positions against the slice under the
|
|
24
|
+
* whole file's id, which §19 requires to be the file's own. See
|
|
25
|
+
* {@link sliceShifts}; markup-carve/carve-js#1861 is the engine-side defect.
|
|
26
|
+
*
|
|
27
|
+
* The path-level security guards are untouched in {@link ./include-path.js}.
|
|
28
|
+
* The resolver is still this server's, so what may be read at all is still
|
|
29
|
+
* decided here.
|
|
30
|
+
*/
|
|
31
|
+
import { type Document } from '@markup-carve/carve';
|
|
32
|
+
import type { IncludeDenial, IncludeResolver } from './include-path.js';
|
|
33
|
+
/** Warning emitted by {@link resolveIncludes}. */
|
|
3
34
|
export interface IncludeWarning {
|
|
4
35
|
/** 1-based line number in the ROOT document. */
|
|
5
36
|
line: number;
|
|
@@ -10,13 +41,22 @@ export interface IncludeWarning {
|
|
|
10
41
|
/** Human-readable explanation of the include degradation. */
|
|
11
42
|
message: string;
|
|
12
43
|
/**
|
|
13
|
-
*
|
|
44
|
+
* Raw text of a resolver that THREW. Kept OUT of `message` on purpose: §19 I7
|
|
14
45
|
* requires a processor-generated message naming the failure class rather
|
|
15
46
|
* than a resolver's own error, which routinely embeds absolute filesystem
|
|
16
47
|
* paths. Tools that want it (a log sink, a test) read it here; the published
|
|
17
|
-
* diagnostic does not print it.
|
|
48
|
+
* diagnostic does not print it. A resolver that REFUSED rather than threw
|
|
49
|
+
* reports its class on {@link denial}, which is typed and safe to publish.
|
|
18
50
|
*/
|
|
19
51
|
detail?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Resolver refusal class, when the failure came from a resolver that reports
|
|
54
|
+
* one. Typed, unlike {@link detail}, which is overloaded with the raw text of
|
|
55
|
+
* a resolver that THREW and must never reach an author. The published
|
|
56
|
+
* diagnostic maps this to its code and wording; see
|
|
57
|
+
* {@link ./include-denial.js}.
|
|
58
|
+
*/
|
|
59
|
+
denial?: IncludeDenial;
|
|
20
60
|
/** 0-based start offset in the ROOT document, inclusive. */
|
|
21
61
|
start: number;
|
|
22
62
|
/** 0-based end offset in the ROOT document, exclusive. */
|
|
@@ -25,9 +65,28 @@ export interface IncludeWarning {
|
|
|
25
65
|
* Identity of the file the warning arose in: the resolver's canonical id, or
|
|
26
66
|
* the raw directive path when there is none. A directive that failed to
|
|
27
67
|
* resolve is attributed to the document containing it, not to the target it
|
|
28
|
-
* names; a warning raised while
|
|
68
|
+
* names; a warning raised while expanding a child is attributed to that child.
|
|
29
69
|
*/
|
|
30
70
|
file?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Where the warning actually sits inside {@link file}: that file's own
|
|
73
|
+
* offsets, and its own 1-based line and column.
|
|
74
|
+
*
|
|
75
|
+
* `start`/`end` above stay anchored to the ROOT document, because that is
|
|
76
|
+
* the only range valid in the document the client has open. This is the
|
|
77
|
+
* other half, for a host that can also open the child: a diagnostic that
|
|
78
|
+
* points at the parent for a child's problem sends the author to edit the
|
|
79
|
+
* wrong file, which is worse than reporting nothing.
|
|
80
|
+
*
|
|
81
|
+
* Absent for a warning raised in the root document, where `start`/`end`
|
|
82
|
+
* already are that position.
|
|
83
|
+
*/
|
|
84
|
+
within?: {
|
|
85
|
+
line: number;
|
|
86
|
+
column: number;
|
|
87
|
+
start: number;
|
|
88
|
+
end: number;
|
|
89
|
+
};
|
|
31
90
|
}
|
|
32
91
|
/**
|
|
33
92
|
* One include target touched during resolution. Hosts key file watchers off
|
|
@@ -57,9 +116,27 @@ export interface IncludeOptions {
|
|
|
57
116
|
maxDepth?: number;
|
|
58
117
|
/** Total byte budget across the walk. Default max(1 MiB, 8 x root bytes). */
|
|
59
118
|
maxBytes?: number;
|
|
119
|
+
/**
|
|
120
|
+
* Resolver calls allowed for one walk. Default 1000, the §19 RECOMMENDED
|
|
121
|
+
* floor and the engine's own default.
|
|
122
|
+
*
|
|
123
|
+
* Bounds the WORK, which the byte budget does not: a target is resolved
|
|
124
|
+
* before its size is known, and a target that fails to resolve is never
|
|
125
|
+
* charged at all.
|
|
126
|
+
*/
|
|
127
|
+
maxResolverCalls?: number;
|
|
128
|
+
/**
|
|
129
|
+
* Warnings retained. Default 100, the engine's. One per distinct rule always
|
|
130
|
+
* survives and {@link IncludeResolution.suppressedWarnings} reports the
|
|
131
|
+
* remainder, so a document of a thousand refused directives costs a bounded
|
|
132
|
+
* republish on every keystroke without hiding a failure class.
|
|
133
|
+
*/
|
|
134
|
+
maxWarnings?: number;
|
|
60
135
|
}
|
|
61
136
|
export interface IncludeResolution {
|
|
62
137
|
warnings: IncludeWarning[];
|
|
138
|
+
/** Warnings raised but not retained. Zero on every uncapped run. */
|
|
139
|
+
suppressedWarnings: number;
|
|
63
140
|
/**
|
|
64
141
|
* Every include target touched, nested children included, de-duplicated and
|
|
65
142
|
* in first-encounter order. Empty when no resolver was supplied.
|
|
@@ -67,13 +144,42 @@ export interface IncludeResolution {
|
|
|
67
144
|
dependencies: IncludeDependency[];
|
|
68
145
|
/** Bytes charged against the budget. */
|
|
69
146
|
bytes: number;
|
|
70
|
-
/**
|
|
147
|
+
/**
|
|
148
|
+
* Successfully read child documents, de-duplicated by canonical id.
|
|
149
|
+
*
|
|
150
|
+
* `watch` is the resolver's own filesystem path for the child, present only
|
|
151
|
+
* when the resolver has one. It is what separates a real file from an
|
|
152
|
+
* identity that merely looks like a path: a virtual-filesystem resolver may
|
|
153
|
+
* hand back `/virtual/child.crv`, and a host that turned that into a `file:`
|
|
154
|
+
* URI would offer the author a location that does not exist.
|
|
155
|
+
*/
|
|
71
156
|
documents: Array<{
|
|
72
157
|
id: string;
|
|
73
158
|
source: string;
|
|
74
159
|
version?: string;
|
|
160
|
+
watch?: string;
|
|
75
161
|
}>;
|
|
162
|
+
/**
|
|
163
|
+
* The document with every child merged in, as §19 defines it, or `undefined`
|
|
164
|
+
* when the pass was inert or the root did not parse.
|
|
165
|
+
*
|
|
166
|
+
* Every node a child contributed carries that child's identity on `pos.file`
|
|
167
|
+
* (§19 source mapping), and carries it AFTER the renames, clamps and section
|
|
168
|
+
* selection the merge applied. That is what makes it the thing to navigate
|
|
169
|
+
* through: a crossref in the parent names the id the merged document ended
|
|
170
|
+
* up with, which is not always the id the child file spells.
|
|
171
|
+
*/
|
|
172
|
+
expanded?: Document;
|
|
76
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Offset of each line's first character, counted in the unit the installed
|
|
176
|
+
* parser's offsets are in, so `locateIn` can be given one directly.
|
|
177
|
+
*
|
|
178
|
+
* Exported for the test that drives the branch the installed engine does not
|
|
179
|
+
* take. A test that built its own table would agree with this one under either
|
|
180
|
+
* unit and so could not see the branch at all.
|
|
181
|
+
*/
|
|
182
|
+
export declare function lineStarts(source: string): number[];
|
|
77
183
|
/**
|
|
78
184
|
* Walk the include graph rooted at `source`.
|
|
79
185
|
*
|