@eagleoutice/flowr 2.13.10 → 2.13.12

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 (80) hide show
  1. package/README.md +33 -33
  2. package/dataflow/environments/default-builtin-config.d.ts +11 -4
  3. package/dataflow/environments/default-builtin-config.js +43 -5
  4. package/dataflow/environments/environment.js +56 -20
  5. package/dataflow/environments/resolve-by-name.js +16 -6
  6. package/dataflow/environments/resolve-helper.d.ts +43 -0
  7. package/dataflow/environments/resolve-helper.js +47 -0
  8. package/dataflow/graph/df-helper.d.ts +48 -1
  9. package/dataflow/graph/df-helper.js +63 -0
  10. package/dataflow/graph/graph.js +24 -13
  11. package/documentation/data/faq/faqs.js +1 -1
  12. package/documentation/data/faq/wiki-faq-store.js +3 -2
  13. package/documentation/data/server/doc-data-server-messages.js +1 -1
  14. package/documentation/doc-readme.js +1 -1
  15. package/documentation/doc-util/doc-files.d.ts +5 -0
  16. package/documentation/doc-util/doc-files.js +13 -3
  17. package/documentation/wiki-analyzer.js +10 -10
  18. package/documentation/wiki-core.js +1 -1
  19. package/documentation/wiki-dataflow-graph.js +3 -3
  20. package/documentation/wiki-linting-and-testing.js +13 -13
  21. package/documentation/wiki-mk/doc-context.d.ts +1 -1
  22. package/documentation/wiki-mk/doc-context.js +9 -5
  23. package/documentation/wiki-normalized-ast.js +1 -1
  24. package/documentation/wiki-overview.js +2 -2
  25. package/documentation/wiki-query.js +1 -1
  26. package/documentation/wiki-setup.js +3 -3
  27. package/linter/linter-rules.d.ts +1 -1
  28. package/linter/rules/syntactically-valid.d.ts +12 -1
  29. package/linter/rules/syntactically-valid.js +88 -17
  30. package/package.json +7 -8
  31. package/project/context/flowr-analyzer-loading-order-context.d.ts +8 -0
  32. package/project/context/flowr-analyzer-loading-order-context.js +23 -2
  33. package/project/sigdb/reader.d.ts +20 -0
  34. package/project/sigdb/reader.js +93 -10
  35. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +1 -1
  36. package/queries/catalog/dependencies-query/dependencies-query-executor.js +3 -2
  37. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +6 -0
  38. package/queries/catalog/dependencies-query/link-devices.d.ts +7 -3
  39. package/queries/catalog/dependencies-query/link-devices.js +56 -10
  40. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
  41. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +14 -0
  42. package/queries/catalog/happens-before-query/happens-before-query-format.js +18 -2
  43. package/queries/catalog/signature-query/signature-query-executor.js +5 -1
  44. package/queries/catalog/slice-query-options.d.ts +11 -1
  45. package/queries/catalog/slice-query-options.js +8 -4
  46. package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -1
  47. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +5 -1
  48. package/r-bridge/lang-4.x/ast/model/model.d.ts +9 -0
  49. package/r-bridge/lang-4.x/ast/model/model.js +12 -0
  50. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
  51. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +1 -0
  52. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
  53. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
  54. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
  55. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
  56. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
  57. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +1 -0
  58. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
  59. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
  60. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
  61. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
  62. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
  63. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
  64. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
  65. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
  66. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
  67. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
  68. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
  69. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
  70. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
  71. package/reconstruct/reconstruct.d.ts +9 -0
  72. package/reconstruct/reconstruct.js +1 -0
  73. package/search/flowr-search-filters.d.ts +8 -0
  74. package/search/flowr-search-filters.js +19 -7
  75. package/search/search-executor/search-generators.js +7 -2
  76. package/search/search-executor/search-transformer.js +4 -1
  77. package/slicing/static/slice-call.js +2 -2
  78. package/util/collections/bimap.d.ts +21 -1
  79. package/util/collections/bimap.js +43 -7
  80. package/util/version.js +1 -1
@@ -2,9 +2,13 @@ import type { DependencyInfo } from './dependencies-query-format';
2
2
  import type { NormalizedAst } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
3
3
  import type { DataflowInformation } from '../../../dataflow/info';
4
4
  /**
5
- * Names the file each visualization lands in: a device opener (`pdf("a.pdf")`) takes every plot until the
6
- * device is closed (`dev.off()`), so those plots end up in its file instead of on screen. A plot outside any
7
- * open device keeps the value it had.
5
+ * Names the file each visualization lands in, and the statements that build it.
6
+ *
7
+ * A device opener (`pdf("a.pdf")`) takes every plot until the device is closed (`dev.off()`), so those plots
8
+ * end up in its file instead of on screen; a plot outside any open device keeps the value it had. Every plot
9
+ * that lands in a file also reports the statements it takes to produce that file in
10
+ * {@link DependencyInfo#parts}: the addons drawn onto it, plus the device opener and closer around it.
11
+ * Closing a device ends the plot, so an addon after it builds whatever device is open then, not this file.
8
12
  *
9
13
  * Openers are the `write` entries that draw ({@link CallProp.Graphics}), closers the calls that end a device
10
14
  * ({@link CallProp.Closes}), and the order is the one the source states.
@@ -16,9 +16,13 @@ function propsOf(id, { graph, environment }) {
16
16
  return (0, query_fn_props_1.queryFnProps)(name, { environment: vertex.environment ?? environment })?.props ?? 0;
17
17
  }
18
18
  /**
19
- * Names the file each visualization lands in: a device opener (`pdf("a.pdf")`) takes every plot until the
20
- * device is closed (`dev.off()`), so those plots end up in its file instead of on screen. A plot outside any
21
- * open device keeps the value it had.
19
+ * Names the file each visualization lands in, and the statements that build it.
20
+ *
21
+ * A device opener (`pdf("a.pdf")`) takes every plot until the device is closed (`dev.off()`), so those plots
22
+ * end up in its file instead of on screen; a plot outside any open device keeps the value it had. Every plot
23
+ * that lands in a file also reports the statements it takes to produce that file in
24
+ * {@link DependencyInfo#parts}: the addons drawn onto it, plus the device opener and closer around it.
25
+ * Closing a device ends the plot, so an addon after it builds whatever device is open then, not this file.
22
26
  *
23
27
  * Openers are the `write` entries that draw ({@link CallProp.Graphics}), closers the calls that end a device
24
28
  * ({@link CallProp.Closes}), and the order is the one the source states.
@@ -27,9 +31,6 @@ function linkPlotsToDevices(written, plots, dataflow, ast) {
27
31
  const opened = new Map(written
28
32
  .filter(w => w.value !== undefined && (propsOf(w.nodeId, dataflow) & built_in_props_1.CallProp.Graphics) !== 0)
29
33
  .map(w => [w.nodeId, w.value]));
30
- if (opened.size === 0) {
31
- return;
32
- }
33
34
  const closed = new Set(dataflow.graph.vertices(true)
34
35
  .filter(([id, v]) => v.tag === vertex_1.VertexType.FunctionCall && (propsOf(id, dataflow) & built_in_props_1.CallProp.Closes) !== 0)
35
36
  .map(([id]) => id));
@@ -40,18 +41,63 @@ function linkPlotsToDevices(written, plots, dataflow, ast) {
40
41
  return at ? [[id, at]] : [];
41
42
  })
42
43
  .sort(([, a], [, b]) => range_1.SourceRange.compare(a, b));
44
+ /* an addon points at the creation it belongs to, a creation points at nothing */
45
+ const linkOf = new Map(plots.filter(p => p.linkedIds?.length).map(p => [p.nodeId, p.linkedIds]));
43
46
  const devices = [];
47
+ /* the opener/closer pair enclosing a plot, so it can report what it takes to produce its file */
48
+ const around = new Map();
49
+ /* what each addon draws onto, and the creation each device window is currently showing */
50
+ const builds = new Map();
51
+ const showing = new Map();
44
52
  for (const [id] of located) {
45
53
  const file = opened.get(id);
46
54
  const plot = plotAt.get(id);
47
55
  if (file !== undefined) {
48
- devices.push(file);
56
+ devices.push({ file, opener: id, plots: [] });
57
+ continue;
49
58
  }
50
59
  else if (closed.has(id)) {
51
- devices.pop();
60
+ const device = devices.pop();
61
+ for (const on of device?.plots ?? []) {
62
+ around.set(on, [device?.opener, id]);
63
+ }
64
+ continue;
65
+ }
66
+ else if (plot === undefined) {
67
+ continue;
68
+ }
69
+ const device = devices[devices.length - 1];
70
+ if (device !== undefined) {
71
+ device.plots.push(id);
72
+ around.set(id, [device.opener]);
73
+ plots[plot] = { ...plots[plot], value: device.file };
52
74
  }
53
- else if (plot !== undefined && devices.length > 0) {
54
- plots[plot] = { ...plots[plot], value: devices[devices.length - 1] };
75
+ const window = device?.opener;
76
+ const linked = linkOf.get(id);
77
+ if (linked === undefined) {
78
+ /* a creation: whatever is drawn on this device from here on adds to it, as R keeps it current */
79
+ showing.set(window, id);
80
+ continue;
81
+ }
82
+ /*
83
+ * Prefer what the dataflow linked the addon to, which knows about `p <- ggplot(); p + geom_point()`.
84
+ * It only tracks position, though, so an addon after a nested device closed still points into that
85
+ * device; R hands the drawing back to the plot the restored device is showing, so take that instead.
86
+ */
87
+ const inWindow = linked.find(to => (around.get(to)?.[0]) === window);
88
+ const target = inWindow ?? showing.get(window);
89
+ if (target !== undefined) {
90
+ builds.set(id, target);
91
+ }
92
+ }
93
+ const addonsOf = new Map();
94
+ for (const [addon, creation] of builds) {
95
+ addonsOf.set(creation, [...addonsOf.get(creation) ?? [], addon]);
96
+ }
97
+ for (const [id, index] of plotAt) {
98
+ const parts = [...addonsOf.get(id) ?? [], ...around.get(id) ?? []];
99
+ if (parts.length > 0) {
100
+ plots[index] = { ...plots[index], parts };
55
101
  }
56
102
  }
57
103
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.executeHappensBefore = executeHappensBefore;
4
+ const happens_before_query_format_1 = require("./happens-before-query-format");
4
5
  const logic_1 = require("../../../util/logic");
5
6
  const log_1 = require("../../../util/log");
6
7
  const happens_before_1 = require("../../../control-flow/happens-before");
@@ -17,7 +18,7 @@ async function executeHappensBefore({ analyzer }, queries) {
17
18
  const cfg = await analyzer.controlflow(undefined, cfg_kind_1.CfgKind.Quick);
18
19
  for (const query of queries) {
19
20
  const { a, b } = query;
20
- const fingerprint = `${a}<${b}`;
21
+ const fingerprint = happens_before_query_format_1.HappensBeforeKey.of(a, b);
21
22
  if (fingerprint in results) {
22
23
  log_1.log.warn('Duplicate happens-before query', query, 'ignoring');
23
24
  }
@@ -11,6 +11,20 @@ export interface HappensBeforeQuery extends BaseQueryFormat {
11
11
  export interface HappensBeforeQueryResult extends BaseQueryResult {
12
12
  readonly results: Record<string, Ternary>;
13
13
  }
14
+ /**
15
+ * How an answer of the {@link HappensBeforeQuery} is keyed: the two criteria it was asked about, so that both
16
+ * the executor writing an answer and anyone reading one spell the key the same way.
17
+ */
18
+ export declare const HappensBeforeKey: {
19
+ readonly name: "HappensBeforeKey";
20
+ /** The key the answer for `a` and `b` is stored under. */
21
+ readonly of: (this: void, a: SlicingCriterion, b: SlicingCriterion) => string;
22
+ /** The two criteria a key was built from. */
23
+ readonly criteria: (this: void, key: string) => {
24
+ a: string;
25
+ b: string;
26
+ };
27
+ };
14
28
  export declare const HappensBeforeQueryDefinition: {
15
29
  readonly title: "Happens-Before Query";
16
30
  readonly executor: typeof executeHappensBefore;
@@ -3,11 +3,27 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.HappensBeforeQueryDefinition = void 0;
6
+ exports.HappensBeforeQueryDefinition = exports.HappensBeforeKey = void 0;
7
7
  const ansi_1 = require("../../../util/text/ansi");
8
8
  const time_1 = require("../../../util/text/time");
9
9
  const joi_1 = __importDefault(require("joi"));
10
10
  const happens_before_query_executor_1 = require("./happens-before-query-executor");
11
+ /**
12
+ * How an answer of the {@link HappensBeforeQuery} is keyed: the two criteria it was asked about, so that both
13
+ * the executor writing an answer and anyone reading one spell the key the same way.
14
+ */
15
+ exports.HappensBeforeKey = {
16
+ name: 'HappensBeforeKey',
17
+ /** The key the answer for `a` and `b` is stored under. */
18
+ of(a, b) {
19
+ return `${a}<${b}`;
20
+ },
21
+ /** The two criteria a key was built from. */
22
+ criteria(key) {
23
+ const at = key.indexOf('<');
24
+ return at < 0 ? { a: key, b: '' } : { a: key.slice(0, at), b: key.slice(at + 1) };
25
+ }
26
+ };
11
27
  exports.HappensBeforeQueryDefinition = {
12
28
  title: 'Happens-Before Query',
13
29
  executor: happens_before_query_executor_1.executeHappensBefore,
@@ -15,7 +31,7 @@ exports.HappensBeforeQueryDefinition = {
15
31
  const out = queryResults;
16
32
  result.push(`Query: ${(0, ansi_1.bold)('happens-before', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
17
33
  for (const [fingerprint, value] of Object.entries(out.results)) {
18
- const { a, b } = JSON.parse(fingerprint);
34
+ const { a, b } = exports.HappensBeforeKey.criteria(fingerprint);
19
35
  result.push(` ╰ ${(0, ansi_1.bold)(a, formatter)} happens before ${(0, ansi_1.bold)(b, formatter)}: ${value}`);
20
36
  }
21
37
  return true;
@@ -228,9 +228,13 @@ function flowrOnlyFunctionInfo(env, pkg, name) {
228
228
  if (info === undefined || (info.props === undefined && info.sig === undefined)) {
229
229
  return undefined;
230
230
  }
231
+ const namespace = definition.name === undefined ? undefined : identifier_1.Identifier.getNamespace(definition.name);
232
+ if (pkg !== undefined && namespace !== undefined && namespace !== pkg) {
233
+ return undefined;
234
+ }
231
235
  return {
232
236
  name,
233
- package: pkg ?? (definition.name === undefined ? undefined : identifier_1.Identifier.getNamespace(definition.name)) ?? 'base',
237
+ package: namespace ?? pkg ?? 'base',
234
238
  flowrOnly: true,
235
239
  exported: true,
236
240
  properties: [],
@@ -31,6 +31,14 @@ export interface SliceQueryOptions {
31
31
  * the definition's binding and call sites. Defaults to `false`.
32
32
  */
33
33
  readonly includeCallees?: boolean;
34
+ /**
35
+ * Reconstruct the slice as the project's files rather than as one program, reported in
36
+ * {@link ReconstructionResult#files} in loading order with their paths. Without this only the entry file is
37
+ * reconstructed. Overridden by {@link inlineSources}/{@link inlineFull}, which produce the opposite.
38
+ */
39
+ readonly perFile?: boolean;
40
+ /** Also report the packages the slice calls into; see {@link Dataflow.packagesOf}. */
41
+ readonly reportPackages?: boolean;
34
42
  }
35
43
  /** The Joi keys of {@link SliceQueryOptions}, to be spread into the schema of every slicing query. */
36
44
  export declare const SliceQueryOptionsSchema: {
@@ -39,11 +47,13 @@ export declare const SliceQueryOptionsSchema: {
39
47
  readonly inlineSources: Joi.BooleanSchema<boolean>;
40
48
  readonly inlineFull: Joi.AlternativesSchema<string | boolean>;
41
49
  readonly includeCallees: Joi.BooleanSchema<boolean>;
50
+ readonly perFile: Joi.BooleanSchema<boolean>;
51
+ readonly reportPackages: Joi.BooleanSchema<boolean>;
42
52
  };
43
53
  /**
44
54
  * Resolves the criteria to their node ids, reporting those that match no node: they would slice nothing,
45
55
  * as {@link SlicingCriteria.convertAll} keeps them verbatim.
46
56
  */
47
57
  export declare function resolveSliceCriteria(criteria: SlicingCriteria, ast: NormalizedAst): NodeId[];
48
- /** Reconstruct the given `nodes` of `ast`, honoring the inlining and magic-comment options. */
58
+ /** Reconstruct the given `nodes` of `ast`, honoring the inlining, per-file and magic-comment options. */
49
59
  export declare function reconstructSlice(ast: NormalizedAst, graph: DataflowGraph, nodes: ReadonlySet<NodeId>, options: SliceQueryOptions): ReconstructionResult;
@@ -23,7 +23,9 @@ exports.SliceQueryOptionsSchema = {
23
23
  noMagicComments: joi_1.default.boolean().optional().description('Should the magic comments (force-including lines within the slice) be ignored?'),
24
24
  inlineSources: joi_1.default.boolean().optional().description('Inline resolvable source() calls into the reconstruction so the result is a single self-contained R text.'),
25
25
  inlineFull: joi_1.default.alternatives(joi_1.default.boolean(), joi_1.default.string().valid('banner')).optional().description('Inline all files into the reconstruction, in flowR\'s loading order and independent of whether they are sourced explicitly; "banner" precedes every file with a banner comment naming it.'),
26
- includeCallees: joi_1.default.boolean().optional().description('If set (and slicing backward), continue the slice past a function-definition boundary, also including the definition\'s binding and call sites.')
26
+ includeCallees: joi_1.default.boolean().optional().description('If set (and slicing backward), continue the slice past a function-definition boundary, also including the definition\'s binding and call sites.'),
27
+ perFile: joi_1.default.boolean().optional().description('Reconstruct the slice as the project\'s files, reported in `reconstruct.files` in loading order with their paths, instead of only the entry file.'),
28
+ reportPackages: joi_1.default.boolean().optional().description('Also report the packages the slice calls into, i.e. what this selection needs installed rather than what the whole program loads.')
27
29
  };
28
30
  /**
29
31
  * Resolves the criteria to their node ids, reporting those that match no node: they would slice nothing,
@@ -37,14 +39,16 @@ function resolveSliceCriteria(criteria, ast) {
37
39
  }
38
40
  return ids;
39
41
  }
40
- /** Reconstruct the given `nodes` of `ast`, honoring the inlining and magic-comment options. */
42
+ /** Reconstruct the given `nodes` of `ast`, honoring the inlining, per-file and magic-comment options. */
41
43
  function reconstructSlice(ast, graph, nodes, options) {
42
- const { inlineSources, inlineFull, noMagicComments } = options;
44
+ const { inlineSources, inlineFull, perFile, noMagicComments } = options;
45
+ const inlining = inlineSources || inlineFull;
43
46
  return (0, reconstruct_1.reconstructToCode)(ast, {
44
47
  nodes,
45
48
  inlineSources,
46
49
  inlineFull,
47
- sourceMap: inlineSources || inlineFull ? source_inline_map_1.SourceInlineMap.build(ast, graph) : undefined
50
+ reconstructFiles: perFile && !inlining ? 'all' : undefined,
51
+ sourceMap: inlining ? source_inline_map_1.SourceInlineMap.build(ast, graph) : undefined
48
52
  }, noMagicComments ? auto_select_defaults_1.doNotAutoSelect : (0, magic_comments_1.makeMagicCommentHandler)(auto_select_defaults_1.doNotAutoSelect));
49
53
  }
50
54
  //# sourceMappingURL=slice-query-options.js.map
@@ -6,6 +6,7 @@ const static_slicer_1 = require("../../../slicing/static/static-slicer");
6
6
  const slice_query_options_1 = require("../slice-query-options");
7
7
  const log_1 = require("../../../util/log");
8
8
  const slice_direction_1 = require("../../../util/slice-direction");
9
+ const df_helper_1 = require("../../../dataflow/graph/df-helper");
9
10
  /**
10
11
  * Produce a fingerprint string for a static slice query
11
12
  */
@@ -32,14 +33,16 @@ async function executeStaticSliceQuery({ analyzer }, queries) {
32
33
  const df = await analyzer.dataflow();
33
34
  const slice = (0, static_slicer_1.staticSlice)({ ctx: analyzer.inspectContext(), info: df, ast: n, ids: (0, slice_query_options_1.resolveSliceCriteria)(criteria, n), direction: query.direction ?? slice_direction_1.SliceDirection.Backward, threshold: analyzer.flowrConfig.solver.slicer?.threshold, includeCallees });
34
35
  const sliceEnd = Date.now();
36
+ const packages = query.reportPackages ? [...df_helper_1.Dataflow.packagesOf(slice.result, df.graph)] : undefined;
35
37
  if (noReconstruction) {
36
- results[key] = { slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } } };
38
+ results[key] = { packages, slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } } };
37
39
  }
38
40
  else {
39
41
  const reconstructStart = Date.now();
40
42
  const reconstruct = (0, slice_query_options_1.reconstructSlice)(n, df.graph, slice.result, query);
41
43
  const reconstructEnd = Date.now();
42
44
  results[key] = {
45
+ packages,
43
46
  slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } },
44
47
  reconstruct: { ...reconstruct, '.meta': { timing: reconstructEnd - reconstructStart } }
45
48
  };
@@ -27,7 +27,11 @@ export interface StaticSliceQueryResult extends BaseQueryResult {
27
27
  * The keys are serialized versions of the used queries (i.e., the result of `JSON.stringify`).
28
28
  * This implies that multiple slice queries with the same query configuration will _not_ be re-executed.
29
29
  */
30
- results: Record<string, Omit<PipelineOutput<typeof DEFAULT_SLICING_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>> | Omit<PipelineOutput<typeof DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>>>;
30
+ results: Record<string, (Omit<PipelineOutput<typeof DEFAULT_SLICING_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>> | Omit<PipelineOutput<typeof DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>>)
31
+ /** the packages the slice calls into, only set with {@link SliceQueryOptions#reportPackages} */
32
+ & {
33
+ packages?: readonly string[];
34
+ }>;
31
35
  }
32
36
  declare function sliceQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'static-slice'>;
33
37
  export declare const StaticSliceQueryDefinition: {
@@ -234,6 +234,15 @@ export declare const RNode: {
234
234
  * A helper function to retrieve the id of a given node, if available.
235
235
  */
236
236
  readonly getId: (this: void, node: RNode<ParentInformation>) => NodeId;
237
+ /**
238
+ * An identity for `node` that two analyses of the same source agree on, unlike {@link RNode.getId|the numeric
239
+ * id}, which only means something within the analysis that handed it out. Made of the file the node came
240
+ * from, where it starts, and what it is: `<file>:<line>:<column>:<type>`.
241
+ *
242
+ * This survives re-analyzing the same text, not editing it -- an edit above the node moves it.
243
+ * `undefined` for a node that carries no location (an artificial node, e.g. a built-in).
244
+ */
245
+ readonly stableId: (this: void, node: RNode<ParentInformation>) => string | undefined;
237
246
  /**
238
247
  * The source range the whole subtree of `node` covers, from the first position any of its nodes starts at to
239
248
  * the last one any of them ends at. Unlike {@link SourceRange.fromNode} this does not stop at what the node
@@ -139,6 +139,18 @@ exports.RNode = {
139
139
  getId(node) {
140
140
  return node.info.id;
141
141
  },
142
+ /**
143
+ * An identity for `node` that two analyses of the same source agree on, unlike {@link RNode.getId|the numeric
144
+ * id}, which only means something within the analysis that handed it out. Made of the file the node came
145
+ * from, where it starts, and what it is: `<file>:<line>:<column>:<type>`.
146
+ *
147
+ * This survives re-analyzing the same text, not editing it -- an edit above the node moves it.
148
+ * `undefined` for a node that carries no location (an artificial node, e.g. a built-in).
149
+ */
150
+ stableId(node) {
151
+ const location = node.location;
152
+ return location === undefined ? undefined : `${node.info.file ?? ''}:${location[0]}:${location[1]}:${node.type}`;
153
+ },
142
154
  /**
143
155
  * The source range the whole subtree of `node` covers, from the first position any of its nodes starts at to
144
156
  * the last one any of them ends at. Unlike {@link SourceRange.fromNode} this does not stop at what the node
@@ -45,6 +45,7 @@ export declare const RAccess: {
45
45
  readonly isIndex: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RIndexAccess<Info>;
46
46
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
47
47
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
48
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
48
49
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
49
50
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
50
51
  readonly getType: (this: void, node: RNode) => RType;
@@ -64,6 +64,7 @@ export declare const RArgument: {
64
64
  readonly getValue: <OtherInfo>(args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], id: NodeId | undefined) => RNode<OtherInfo> | undefined;
65
65
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
66
66
  readonly getId: (this: void, node: RNode<ParentInformation>) => NodeId;
67
+ readonly stableId: (this: void, node: RNode<ParentInformation>) => string | undefined;
67
68
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
68
69
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & ParentInformation>) => RNode<OtherInfo & ParentInformation>;
69
70
  readonly getType: (this: void, node: RNode) => RType;
@@ -26,6 +26,7 @@ export declare const RBinaryOp: {
26
26
  readonly getOperatorInfo: <Info = object>(node: RBinaryOp<Info>) => OperatorInformationValue | undefined;
27
27
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
28
28
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
29
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
29
30
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
30
31
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
31
32
  readonly getType: (this: void, node: RNode) => RType;
@@ -18,6 +18,7 @@ export declare const RBreak: {
18
18
  readonly is: <Info = object>(this: void, node: unknown) => node is RBreak<Info>;
19
19
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
20
20
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
21
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
21
22
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
22
23
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
23
24
  readonly getType: (this: void, node: RNode) => RType;
@@ -20,6 +20,7 @@ export declare const RComment: {
20
20
  readonly is: <Info = object>(this: void, node: unknown) => node is RComment<Info>;
21
21
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
22
22
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
23
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
23
24
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
24
25
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
25
26
  readonly getType: (this: void, node: RNode) => RType;
@@ -34,6 +34,7 @@ export declare const RExpressionList: {
34
34
  readonly groupEnd: <Info = object>(this: void, node: RExpressionList<Info>) => RSymbol<Info> | undefined;
35
35
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
36
36
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
37
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
37
38
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
38
39
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
39
40
  readonly getType: (this: void, node: RNode) => RType;
@@ -28,6 +28,7 @@ export declare const RForLoop: {
28
28
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RForLoop<Info>;
29
29
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
30
30
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
31
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
31
32
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
32
33
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
33
34
  readonly getType: (this: void, node: RNode) => RType;
@@ -56,6 +56,7 @@ export declare const RFunctionCall: {
56
56
  readonly matchArgsToParams: <Info = object>(this: void, args: readonly PotentiallyEmptyRArgument<Info>[], paramNames: readonly string[]) => ReadonlyMap<string, RArgument<Info>>;
57
57
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
58
58
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
59
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
59
60
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
60
61
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
61
62
  readonly getType: (this: void, node: RNode) => RType;
@@ -41,6 +41,7 @@ export declare const RFunctionDefinition: {
41
41
  readonly rootFunctionDefinition: <Info = object>(this: void, n: RNode<ParentInformation & Info> | undefined, idMap: AstIdMap<ParentInformation & Info>) => RFunctionDefinition<ParentInformation & Info> | undefined;
42
42
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
43
43
  readonly getId: (this: void, node: RNode<ParentInformation>) => import("../processing/node-id").NodeId;
44
+ readonly stableId: (this: void, node: RNode<ParentInformation>) => string | undefined;
44
45
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
45
46
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: AstIdMap<OtherInfo & ParentInformation>) => RNode<OtherInfo & ParentInformation>;
46
47
  readonly getType: (this: void, node: RNode) => RType;
@@ -24,6 +24,7 @@ export declare const RIfThenElse: {
24
24
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RIfThenElse<Info>;
25
25
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
26
26
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
27
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
27
28
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
28
29
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
29
30
  readonly getType: (this: void, node: RNode) => RType;
@@ -20,6 +20,7 @@ export declare const RLineDirective: {
20
20
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RLineDirective<Info>;
21
21
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
22
22
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
23
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
23
24
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
24
25
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
25
26
  readonly getType: (this: void, node: RNode) => RType;
@@ -28,6 +28,7 @@ export declare const RLogical: {
28
28
  readonly isFalse: <Info = object>(this: void, node: RNode<Info> | undefined) => boolean;
29
29
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
30
30
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
31
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
31
32
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
32
33
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
33
34
  readonly getType: (this: void, node: RNode) => RType;
@@ -18,6 +18,7 @@ export declare const RNext: {
18
18
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RNext<Info>;
19
19
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
20
20
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
21
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
21
22
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
22
23
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
23
24
  readonly getType: (this: void, node: RNode) => RType;
@@ -22,6 +22,7 @@ export declare const RNumber: {
22
22
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RNumber<Info>;
23
23
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
24
24
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
25
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
25
26
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
26
27
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
27
28
  readonly getType: (this: void, node: RNode) => RType;
@@ -30,6 +30,7 @@ export declare const RParameter: {
30
30
  readonly isDotDotDotDot: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RParameter<Info>;
31
31
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
32
32
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
33
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
33
34
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
34
35
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
35
36
  readonly getType: (this: void, node: RNode) => RType;
@@ -34,6 +34,7 @@ export declare const RPipe: {
34
34
  readonly hasAccessPlaceHolderFromRVersion: (this: void) => SemVer;
35
35
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
36
36
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
37
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
37
38
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
38
39
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
39
40
  readonly getType: (this: void, node: RNode) => RType;
@@ -22,6 +22,7 @@ export declare const RRepeatLoop: {
22
22
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RRepeatLoop<Info>;
23
23
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
24
24
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
25
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
25
26
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
26
27
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
27
28
  readonly getType: (this: void, node: RNode) => RType;
@@ -27,6 +27,7 @@ export declare const RString: {
27
27
  rawStringAvailableFromRVersion(): SemVer;
28
28
  getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
29
29
  getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
30
+ stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
30
31
  span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
31
32
  topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
32
33
  getType: (this: void, node: RNode) => RType;
@@ -32,6 +32,7 @@ export declare const RSymbol: {
32
32
  readonly isSpecial: <OtherInfo = object>(this: void, node: RNode<OtherInfo> | undefined) => node is RSymbol<OtherInfo, typeof RNull | typeof RNa>;
33
33
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
34
34
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
35
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
35
36
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
36
37
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
37
38
  readonly getType: (this: void, node: RNode) => RType;
@@ -25,6 +25,7 @@ export declare const RUnaryOp: {
25
25
  readonly getOperatorInfo: <Info = object>(node: RUnaryOp<Info>) => OperatorInformationValue | undefined;
26
26
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
27
27
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
28
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
28
29
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
29
30
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
30
31
  readonly getType: (this: void, node: RNode) => RType;
@@ -23,6 +23,7 @@ export declare const RWhileLoop: {
23
23
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RWhileLoop<Info>;
24
24
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
25
25
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
26
+ readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
26
27
  readonly span: <OtherInfo>(this: void, node: RNode<OtherInfo> | undefined) => import("../../../../../util/range").SourceRange | undefined;
27
28
  readonly topLevelStatement: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation>;
28
29
  readonly getType: (this: void, node: RNode) => RType;
@@ -52,6 +52,15 @@ export interface ReconstructionResult {
52
52
  linesWithAutoSelected: number;
53
53
  /** warnings raised while inlining `source()` calls (only set when {@link Selection#inlineSources} is active) */
54
54
  inlineWarnings?: InlineWarning[];
55
+ /**
56
+ * The reconstructed files, in loading order, each with the path it came from (absent for inline code).
57
+ * `code` holds the same parts, joined into one string when only a single file was reconstructed.
58
+ * Not set by the inlinings, whose whole purpose is to produce one self-contained text.
59
+ */
60
+ files?: readonly {
61
+ path: string | undefined;
62
+ code: string;
63
+ }[];
55
64
  }
56
65
  export declare function reconstructToCode(ast: NormalizedAst, selection: Selection & ({
57
66
  inlineSources: true;
@@ -540,6 +540,7 @@ function reconstructToCode(ast, selection, autoSelectIf = auto_select_defaults_1
540
540
  (0, log_1.expensiveTrace)(exports.reconstructLogger, () => `reconstructed ast before string conversion: ${JSON.stringify(results)}`);
541
541
  return {
542
542
  code: indices.length === 1 ? results[0] : results,
543
+ files: indices.map((i, k) => ({ path: ast.ast.files[i].filePath, code: results[k] })),
543
544
  linesWithAutoSelected: linesWithAutoSelected.size
544
545
  };
545
546
  }