@eagleoutice/flowr 2.8.4 → 2.8.6

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 CHANGED
@@ -24,7 +24,7 @@ It offers a wide variety of features, for example:
24
24
 
25
25
  ```shell
26
26
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
27
- flowR repl using flowR v2.7.6, R grammar v14 (tree-sitter engine)
27
+ flowR repl using flowR v2.8.5, R grammar v14 (tree-sitter engine)
28
28
  R> :query @linter "read.csv(\"/root/x.txt\")"
29
29
  ```
30
30
 
@@ -45,7 +45,7 @@ It offers a wide variety of features, for example:
45
45
  ╰ Absolute Paths (absolute-file-paths):
46
46
  ╰ certain:
47
47
  ╰ Path `/root/x.txt` at 1.1-23
48
- ╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0
48
+ ╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 0
49
49
  ╰ Unused Definitions (unused-definitions):
50
50
  ╰ Metadata: totalConsidered: 0, searchTimeMs: 0, processTimeMs: 0
51
51
  ╰ Naming Convention (naming-convention):
@@ -53,7 +53,7 @@ It offers a wide variety of features, for example:
53
53
  ╰ Network Functions (network-functions):
54
54
  ╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0
55
55
  ╰ Dataframe Access Validation (dataframe-access-validation):
56
- ╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 1
56
+ ╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 0
57
57
  ╰ Dead Code (dead-code):
58
58
  ╰ Metadata: consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0
59
59
  ╰ Useless Loops (useless-loop):
@@ -82,7 +82,7 @@ It offers a wide variety of features, for example:
82
82
 
83
83
  Query: **linter** (2 ms)\
84
84
     ╰ **Deprecated Functions** (deprecated-functions):\
85
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 1, processTimeMs: 0</code>\
85
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 1</code>\
86
86
  &nbsp;&nbsp;&nbsp;╰ **File Path Validity** (file-path-validity):\
87
87
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ certain:\
88
88
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ Path `/root/x.txt` at 1.1-23\
@@ -105,11 +105,11 @@ It offers a wide variety of features, for example:
105
105
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0</code>\
106
106
  &nbsp;&nbsp;&nbsp;╰ **Useless Loops** (useless-loop):\
107
107
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0</code>\
108
- _All queries together required ≈2 ms (1ms accuracy, total 2 ms)_
108
+ _All queries together required ≈2 ms (1ms accuracy, total 3 ms)_
109
109
 
110
110
  <details> <summary style="color:gray">Show Detailed Results as Json</summary>
111
111
 
112
- The analysis required _2.2 ms_ (including parsing and normalization and the query) within the generation environment.
112
+ The analysis required _2.6 ms_ (including parsing and normalization and the query) within the generation environment.
113
113
 
114
114
  In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
115
115
  Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
@@ -126,13 +126,14 @@ It offers a wide variety of features, for example:
126
126
  ".meta": {
127
127
  "totalCalls": 0,
128
128
  "totalFunctionDefinitions": 0,
129
- "searchTimeMs": 1,
130
- "processTimeMs": 0
129
+ "searchTimeMs": 0,
130
+ "processTimeMs": 1
131
131
  }
132
132
  },
133
133
  "file-path-validity": {
134
134
  "results": [
135
135
  {
136
+ "involvedId": 3,
136
137
  "range": [
137
138
  1,
138
139
  1,
@@ -307,7 +308,7 @@ It offers a wide variety of features, for example:
307
308
 
308
309
  ```shell
309
310
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
310
- flowR repl using flowR v2.7.6, R grammar v14 (tree-sitter engine)
311
+ flowR repl using flowR v2.8.5, R grammar v14 (tree-sitter engine)
311
312
  R> :query @static-slice (11@sum) file://test/testfiles/example.R
312
313
  ```
313
314
 
@@ -321,7 +322,7 @@ It offers a wide variety of features, for example:
321
322
  N <- 10
322
323
  for(i in 1:(N-1)) sum <- sum + i + w
323
324
  sum
324
- All queries together required ≈2 ms (1ms accuracy, total 2 ms)
325
+ All queries together required ≈3 ms (1ms accuracy, total 3 ms)
325
326
  ```
326
327
 
327
328
 
@@ -355,7 +356,7 @@ It offers a wide variety of features, for example:
355
356
 
356
357
 
357
358
  * 🚀 **fast call-graph, data-, and control-flow graphs**\
358
- Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">118 ms</span></i> (as of Dec 23, 2025)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
359
+ Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">117.7 ms</span></i> (as of Jan 5, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
359
360
  _flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
360
361
  and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/dataflow-graph) for more details on the dataflow graphs as well as call graphs.
361
362
 
@@ -391,7 +392,7 @@ It offers a wide variety of features, for example:
391
392
 
392
393
  ```shell
393
394
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
394
- flowR repl using flowR v2.7.6, R grammar v14 (tree-sitter engine)
395
+ flowR repl using flowR v2.8.5, R grammar v14 (tree-sitter engine)
395
396
  R> :dataflow* test/testfiles/example.R
396
397
  ```
397
398
 
@@ -401,7 +402,6 @@ It offers a wide variety of features, for example:
401
402
 
402
403
  ```text
403
404
  https://mermaid.live/view#base64:eyJjb2RlIjoiZmxvd2NoYXJ0IEJUXG4gICAgMChbXCJgIzkxO1JTeW1ib2wjOTM7IHRlc3RcbiAgICAgICgwKVxuICAgICAgKjEuMS00KmBcIl0pXG4gICAgMShbXCJgIzkxO1JTeW1ib2wjOTM7IHRlc3RmaWxlc1xuICAgICAgKDEpXG4gICAgICAqMS42LTE0KmBcIl0pXG4gICAgMltbXCJgIzkxO1JCaW5hcnlPcCM5MzsgL1xuICAgICAgKDIpXG4gICAgICAqMS4xLTE0KlxuICAgICgwLCAxKWBcIl1dXG4gICAgYnVpbHQtaW46X1tcImBCdWlsdC1Jbjpcbi9gXCJdXG4gICAgc3R5bGUgYnVpbHQtaW46XyBzdHJva2U6Z3JheSxmaWxsOmdyYXksc3Ryb2tlLXdpZHRoOjJweCxvcGFjaXR5Oi44O1xuICAgIDMoW1wiYCM5MTtSU3ltYm9sIzkzOyBleGFtcGxlLlJcbiAgICAgICgzKVxuICAgICAgKjEuMTYtMjQqYFwiXSlcbiAgICA0W1tcImAjOTE7UkJpbmFyeU9wIzkzOyAvXG4gICAgICAoNClcbiAgICAgICoxLjEtMjQqXG4gICAgKDIsIDMpYFwiXV1cbiAgICAyIC0tPnxcInJlYWRzLCBhcmd1bWVudFwifCAwXG4gICAgMiAtLT58XCJyZWFkcywgYXJndW1lbnRcInwgMVxuICAgIDIgLS4tPnxcInJlYWRzLCBjYWxsc1wifCBidWlsdC1pbjpfXG4gICAgbGlua1N0eWxlIDIgc3Ryb2tlOmdyYXk7XG4gICAgNCAtLT58XCJyZWFkcywgYXJndW1lbnRcInwgMlxuICAgIDQgLS0+fFwicmVhZHMsIGFyZ3VtZW50XCJ8IDNcbiAgICA0IC0uLT58XCJyZWFkcywgY2FsbHNcInwgYnVpbHQtaW46X1xuICAgIGxpbmtTdHlsZSA1IHN0cm9rZTpncmF5OyIsIm1lcm1haWQiOnsiYXV0b1N5bmMiOnRydWV9fQ==
404
- Copied mermaid url to clipboard (dataflow: 0ms).
405
405
  ```
406
406
 
407
407
 
@@ -697,7 +697,7 @@ It offers a wide variety of features, for example:
697
697
  ```
698
698
 
699
699
 
700
- (The analysis required _3.1 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
700
+ (The analysis required _4.1 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
701
701
 
702
702
 
703
703
 
package/cli/flowr.js CHANGED
@@ -136,6 +136,8 @@ async function mainRepl() {
136
136
  }
137
137
  else {
138
138
  await (0, print_version_1.printVersionRepl)(defaultEngine);
139
+ const w = (x) => ansi_1.ansiFormatter.format(x, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
140
+ console.log(w('use ') + ansi_1.ansiFormatter.format(':help', { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 1 /* FontStyles.Bold */ }) + w(' to get a list of available commands.'));
139
141
  await (0, core_1.repl)({ analyzer: analyzer, allowRSessionAccess });
140
142
  }
141
143
  process.exit(0);
@@ -33,7 +33,7 @@ async function executeRShellCommand(output, analyzer, statement) {
33
33
  }
34
34
  }
35
35
  exports.executeCommand = {
36
- description: 'Execute the given code as R code (essentially similar to using now command). This requires the `--r-session-access` flag to be set and requires the r-shell engine.',
36
+ description: 'Execute the given code as R code. This requires the `--r-session-access` flag to be set and requires the r-shell engine.',
37
37
  isCodeCommand: false,
38
38
  usageExample: ':execute',
39
39
  aliases: ['e', 'r'],
@@ -112,7 +112,7 @@ The builder provides two methods for building the analyzer:
112
112
 
113
113
  For more information on how to configure the builder, please refer to the [Builder Configuration](#builder-configuration) section below.
114
114
 
115
- ${(0, doc_structure_1.section)('Overview of the Analyzer', 3)}
115
+ ${(0, doc_structure_1.section)('Overview of the Analyzer', 3)}
116
116
 
117
117
  Once you have created an analyzer instance, you can add R files, folders, or even entire projects for analysis using the
118
118
  ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'addRequest')} method.
@@ -906,7 +906,7 @@ Let's start by looking at the properties of the dataflow information object: ${O
906
906
 
907
907
  ${(() => {
908
908
  /* this includes the meta field for timing and the quick CFG in order to enable re-use and improve performance */
909
- (0, assert_1.guard)(Object.keys(result).length === 9, () => 'Update Dataflow Documentation!');
909
+ (0, assert_1.guard)(Object.keys(result).length === 10, () => 'Update Dataflow Documentation! (Keys: ' + Object.keys(result).join(', ') + ')');
910
910
  return '';
911
911
  })()}
912
912
 
@@ -11,6 +11,7 @@ import type { SourceRange } from '../util/range';
11
11
  import type { DataflowInformation } from '../dataflow/info';
12
12
  import type { ControlFlowInformation } from '../control-flow/control-flow-graph';
13
13
  import type { ReadonlyFlowrAnalysisProvider } from '../project/flowr-analyzer';
14
+ import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
14
15
  export interface LinterRuleInformation<Config extends MergeableRecord = never> {
15
16
  /** Human-Readable name of the linting rule. */
16
17
  readonly name: string;
@@ -94,11 +95,16 @@ export type LintQuickFix = LintQuickFixReplacement | LintQuickFixRemove;
94
95
  * A linting result for a single linting rule match.
95
96
  */
96
97
  export interface LintingResult {
98
+ /** The certainty of the linting result. */
97
99
  readonly certainty: LintingResultCertainty;
98
100
  /**
99
101
  * If available, what to do to fix the linting result.
100
102
  */
101
103
  readonly quickFix?: LintQuickFix[];
104
+ /**
105
+ * The node ID involved in this linting result, if applicable.
106
+ */
107
+ readonly involvedId: NodeId | undefined;
102
108
  }
103
109
  export interface ConfiguredLintingRule<Name extends LintingRuleNames = LintingRuleNames> {
104
110
  readonly name: Name;
@@ -9,6 +9,7 @@ export declare const LintingRules: {
9
9
  readonly processSearchResult: <T extends import("../search/flowr-search").FlowrSearchElement<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>(elements: import("../search/flowr-search").FlowrSearchElements<import("../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, T>, _config: unknown, _data: unknown, refineSearch?: (elements: T) => T) => {
10
10
  results: {
11
11
  certainty: import("./linter-format").LintingResultCertainty;
12
+ involvedId: import("../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
12
13
  function: import("../dataflow/environments/identifier").Identifier;
13
14
  range: import("../util/range").SourceRange;
14
15
  }[];
@@ -64,6 +65,7 @@ export declare const LintingRules: {
64
65
  analyzer: import("../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
65
66
  }) => {
66
67
  results: {
68
+ involvedId: import("../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
67
69
  certainty: import("./linter-format").LintingResultCertainty;
68
70
  function: import("../dataflow/environments/identifier").Identifier;
69
71
  range: import("../util/range").SourceRange;
@@ -156,6 +158,7 @@ export declare const LintingRules: {
156
158
  analyzer: import("../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
157
159
  }) => {
158
160
  results: {
161
+ involvedId: import("../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
159
162
  quickFix: import("./linter-format").LintQuickFixReplacement[] | undefined;
160
163
  certainty: import("./linter-format").LintingResultCertainty;
161
164
  detectedCasing: import("./rules/naming-convention").CasingConvention;
@@ -192,6 +195,7 @@ export declare const LintingRules: {
192
195
  }) => {
193
196
  results: {
194
197
  certainty: import("./linter-format").LintingResultCertainty;
198
+ involvedId: import("../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
195
199
  function: import("../dataflow/environments/identifier").Identifier;
196
200
  range: import("../util/range").SourceRange;
197
201
  }[];
@@ -247,6 +251,7 @@ export declare const LintingRules: {
247
251
  }) => {
248
252
  results: {
249
253
  certainty: import("./linter-format").LintingResultCertainty.Certain;
254
+ involvedId: undefined;
250
255
  range: import("../util/range").SourceRange;
251
256
  }[];
252
257
  '.meta': import("./rules/dead-code").DeadCodeMetadata;
@@ -275,6 +280,7 @@ export declare const LintingRules: {
275
280
  certainty: import("./linter-format").LintingResultCertainty.Certain;
276
281
  name: string;
277
282
  range: import("../util/range").SourceRange;
283
+ involvedId: import("../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
278
284
  }[];
279
285
  '.meta': {
280
286
  numOfUselessLoops: number;
@@ -65,6 +65,7 @@ exports.DATA_FRAME_ACCESS_VALIDATION = {
65
65
  }))
66
66
  .map(({ node, operand, ...accessed }) => ({
67
67
  ...accessed,
68
+ involvedId: node?.info.id,
68
69
  access: node?.lexeme ?? '???',
69
70
  ...(operand?.type === type_1.RType.Symbol ? { operand: operand.content } : {}),
70
71
  range: node?.info.fullRange ?? node?.location ?? (0, range_1.rangeFrom)(-1, -1, -1, -1),
@@ -26,6 +26,7 @@ export declare const DEAD_CODE: {
26
26
  }) => {
27
27
  results: {
28
28
  certainty: LintingResultCertainty.Certain;
29
+ involvedId: undefined;
29
30
  range: SourceRange;
30
31
  }[];
31
32
  '.meta': DeadCodeMetadata;
@@ -29,6 +29,7 @@ exports.DEAD_CODE = {
29
29
  .filter(assert_1.isNotUndefined)))
30
30
  .map(range => ({
31
31
  certainty: linter_format_1.LintingResultCertainty.Certain,
32
+ involvedId: undefined,
32
33
  range
33
34
  })),
34
35
  '.meta': meta
@@ -6,6 +6,7 @@ export declare const DEPRECATED_FUNCTIONS: {
6
6
  readonly processSearchResult: <T extends import("../../search/flowr-search").FlowrSearchElement<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>[]>(elements: import("../../search/flowr-search").FlowrSearchElements<import("../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, T>, _config: unknown, _data: unknown, refineSearch?: (elements: T) => T) => {
7
7
  results: {
8
8
  certainty: import("../linter-format").LintingResultCertainty;
9
+ involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
9
10
  function: import("../../dataflow/environments/identifier").Identifier;
10
11
  range: import("../../util/range").SourceRange;
11
12
  }[];
@@ -39,6 +39,7 @@ exports.FILE_PATH_VALIDITY = {
39
39
  metadata.totalUnknown++;
40
40
  if (config.includeUnknown) {
41
41
  return [{
42
+ involvedId: matchingRead.nodeId,
42
43
  range,
43
44
  filePath: dependencies_query_format_1.Unknown,
44
45
  certainty: linter_format_1.LintingResultCertainty.Uncertain
@@ -65,6 +66,7 @@ exports.FILE_PATH_VALIDITY = {
65
66
  return [];
66
67
  }
67
68
  return [{
69
+ involvedId: matchingRead.nodeId,
68
70
  range,
69
71
  filePath: matchingRead.value,
70
72
  certainty: writesBefore && writesBefore.length && writesBefore.every(w => w === logic_1.Ternary.Maybe) ? linter_format_1.LintingResultCertainty.Uncertain : linter_format_1.LintingResultCertainty.Certain
@@ -29,6 +29,7 @@ export declare const functionFinderUtil: {
29
29
  processSearchResult: <T extends FlowrSearchElement<ParentInformation>[]>(elements: FlowrSearchElements<ParentInformation, T>, _config: unknown, _data: unknown, refineSearch?: (elements: T) => T) => {
30
30
  results: {
31
31
  certainty: LintingResultCertainty;
32
+ involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
32
33
  function: Identifier;
33
34
  range: SourceRange;
34
35
  }[];
@@ -45,6 +45,7 @@ exports.functionFinderUtil = {
45
45
  return {
46
46
  results: results.map(element => ({
47
47
  certainty: linter_format_1.LintingResultCertainty.Certain,
48
+ involvedId: element.node.info.id,
48
49
  function: element.target,
49
50
  range: element.range
50
51
  })),
@@ -60,6 +60,7 @@ export declare const NAMING_CONVENTION: {
60
60
  analyzer: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
61
61
  }) => {
62
62
  results: {
63
+ involvedId: NodeId;
63
64
  quickFix: LintQuickFixReplacement[] | undefined;
64
65
  certainty: LintingResultCertainty;
65
66
  detectedCasing: CasingConvention;
@@ -168,6 +168,7 @@ exports.NAMING_CONVENTION = {
168
168
  const fix = fixCasing(m.name, casing);
169
169
  return {
170
170
  ...m,
171
+ involvedId: id,
171
172
  quickFix: fix ? createNamingConventionQuickFixes(data.dataflow.graph, id, fix, casing) : undefined
172
173
  };
173
174
  });
@@ -18,6 +18,7 @@ export declare const NETWORK_FUNCTIONS: {
18
18
  }) => {
19
19
  results: {
20
20
  certainty: import("../linter-format").LintingResultCertainty;
21
+ involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
21
22
  function: import("../../dataflow/environments/identifier").Identifier;
22
23
  range: import("../../util/range").SourceRange;
23
24
  }[];
@@ -38,6 +38,7 @@ export declare const SEEDED_RANDOMNESS: {
38
38
  analyzer: import("../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider;
39
39
  }) => {
40
40
  results: {
41
+ involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
41
42
  certainty: LintingResultCertainty;
42
43
  function: Identifier;
43
44
  range: SourceRange;
@@ -47,6 +47,7 @@ exports.SEEDED_RANDOMNESS = {
47
47
  .flatMap(element => (0, search_enrichers_1.enrichmentContent)(element, search_enrichers_1.Enrichment.CallTargets).targets.map(target => {
48
48
  metadata.consumerCalls++;
49
49
  return {
50
+ involvedId: element.node.info.id,
50
51
  range: element.node.info.fullRange,
51
52
  target: target,
52
53
  searchElement: element
@@ -110,6 +111,7 @@ exports.SEEDED_RANDOMNESS = {
110
111
  metadata.callsWithOtherBranchProducers++;
111
112
  }
112
113
  return [{
114
+ involvedId: element.involvedId,
113
115
  certainty: cdsOfProduces.size > 0 ? linter_format_1.LintingResultCertainty.Uncertain : linter_format_1.LintingResultCertainty.Certain,
114
116
  function: element.target,
115
117
  range: element.range
@@ -83,6 +83,7 @@ exports.UNUSED_DEFINITION = {
83
83
  return [{
84
84
  certainty: linter_format_1.LintingResultCertainty.Uncertain,
85
85
  variableName,
86
+ involvedId: element.node.info.id,
86
87
  range: element.node.info.fullRange ?? element.node.location ?? (0, range_1.rangeFrom)(-1, -1, -1, -1),
87
88
  quickFix: buildQuickFix(element.node, data.dataflow.graph, data.normalize)
88
89
  }];
@@ -26,6 +26,7 @@ export declare const USELESS_LOOP: {
26
26
  certainty: LintingResultCertainty.Certain;
27
27
  name: string;
28
28
  range: SourceRange;
29
+ involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
29
30
  }[];
30
31
  '.meta': {
31
32
  numOfUselessLoops: number;
@@ -19,7 +19,8 @@ exports.USELESS_LOOP = {
19
19
  }).filter(loop => (0, useless_loop_1.onlyLoopsOnce)(loop.node.info.id, dataflow.graph, cfg, normalize, analyzer.inspectContext())).map(res => ({
20
20
  certainty: linter_format_1.LintingResultCertainty.Certain,
21
21
  name: res.node.lexeme,
22
- range: res.node.info.fullRange
22
+ range: res.node.info.fullRange,
23
+ involvedId: res.node.info.id
23
24
  }));
24
25
  return {
25
26
  results: results,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.8.4",
3
+ "version": "2.8.6",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "repository": {
@@ -41,14 +41,19 @@ function makeReport(collector) {
41
41
  function isSubCallQuery(query) {
42
42
  return 'linkTo' in query && query.linkTo !== undefined;
43
43
  }
44
- function exactCallNameRegex(name) {
45
- return new RegExp(`^(${name})$`);
46
- }
47
44
  /**
48
45
  *
49
46
  */
50
47
  function promoteCallName(callName, exact = false) {
51
- return Array.isArray(callName) ? new Set(callName) : exact ? exactCallNameRegex(callName) : new RegExp(callName);
48
+ if (Array.isArray(callName)) {
49
+ return new Set(callName);
50
+ }
51
+ else if (exact) {
52
+ return new Set([typeof callName === 'string' ? callName : callName.source]);
53
+ }
54
+ else {
55
+ return new RegExp(callName);
56
+ }
52
57
  }
53
58
  function promoteQueryCallNames(queries) {
54
59
  let requiresCfg = false;
@@ -31,6 +31,10 @@ export declare const LinterQueryDefinition: {
31
31
  readonly completer: typeof linterQueryCompleter;
32
32
  readonly fromLine: typeof linterQueryLineParser;
33
33
  readonly schema: Joi.ObjectSchema<any>;
34
- readonly flattenInvolvedNodes: () => never[];
34
+ readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => ((string & {
35
+ __brand?: "node-id";
36
+ }) | (number & {
37
+ __brand?: "node-id";
38
+ }))[];
35
39
  };
36
40
  export {};
@@ -105,7 +105,15 @@ exports.LinterQueryDefinition = {
105
105
  config: joi_1.default.object()
106
106
  })).description('The rules to lint for. If unset, all rules will be included.')
107
107
  }).description('The linter query lints for the given set of rules and returns the result.'),
108
- flattenInvolvedNodes: () => []
108
+ flattenInvolvedNodes: (queryResults) => {
109
+ const out = queryResults;
110
+ return Object.values(out.results).flatMap(v => {
111
+ if ((0, linter_format_1.isLintingResultsError)(v)) {
112
+ return [];
113
+ }
114
+ return v.results.map(v => v.involvedId);
115
+ }).filter(assert_1.isNotUndefined);
116
+ }
109
117
  };
110
118
  function addLintingRuleResult(ruleName, results, result) {
111
119
  const rule = linter_rules_1.LintingRules[ruleName];
@@ -228,7 +228,11 @@ export declare const SupportedQueries: {
228
228
  readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfigOptions) => CommandCompletions;
229
229
  readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"linter">;
230
230
  readonly schema: Joi.ObjectSchema<any>;
231
- readonly flattenInvolvedNodes: () => never[];
231
+ readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => ((string & {
232
+ __brand?: "node-id";
233
+ }) | (number & {
234
+ __brand?: "node-id";
235
+ }))[];
232
236
  };
233
237
  };
234
238
  export type SupportedQueryTypes = keyof typeof SupportedQueries;
package/util/version.js CHANGED
@@ -6,7 +6,7 @@ exports.printVersionInformation = printVersionInformation;
6
6
  const semver_1 = require("semver");
7
7
  const assert_1 = require("./assert");
8
8
  // this is automatically replaced with the current version by release-it
9
- const version = '2.8.4';
9
+ const version = '2.8.6';
10
10
  /**
11
11
  * Retrieves the current flowR version as a new {@link SemVer} object.
12
12
  */