@eagleoutice/flowr 2.2.3 → 2.2.4

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 (63) hide show
  1. package/README.md +412 -39
  2. package/benchmark/slicer.js +0 -1
  3. package/benchmark/summarizer/first-phase/process.js +18 -8
  4. package/benchmark/summarizer/summarizer.d.ts +1 -1
  5. package/benchmark/summarizer/summarizer.js +1 -1
  6. package/cli/benchmark-app.js +1 -1
  7. package/cli/common/script.js +0 -1
  8. package/cli/repl/commands/repl-cfg.js +38 -8
  9. package/cli/repl/commands/repl-commands.js +1 -1
  10. package/cli/repl/commands/repl-dataflow.js +38 -8
  11. package/cli/repl/commands/repl-normalize.js +38 -8
  12. package/cli/repl/commands/repl-query.js +2 -2
  13. package/cli/repl/core.js +17 -8
  14. package/cli/repl/print-version.js +2 -1
  15. package/cli/repl/server/connection.js +17 -7
  16. package/cli/repl/server/messages/all-messages.js +17 -7
  17. package/cli/repl/server/messages/message-repl.js +17 -7
  18. package/cli/repl/server/messages/message-slice.js +17 -7
  19. package/cli/script-core/statistics-helper-core.js +0 -1
  20. package/core/print/normalize-printer.js +0 -1
  21. package/dataflow/environments/resolve-by-name.d.ts +2 -0
  22. package/dataflow/environments/resolve-by-name.js +2 -0
  23. package/dataflow/graph/resolve-graph.js +1 -1
  24. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -1
  25. package/documentation/data/server/doc-data-server-messages.js +1 -2
  26. package/documentation/doc-util/doc-auto-gen.d.ts +1 -0
  27. package/documentation/doc-util/doc-auto-gen.js +5 -1
  28. package/documentation/doc-util/doc-benchmarks.d.ts +23 -0
  29. package/documentation/doc-util/doc-benchmarks.js +76 -0
  30. package/documentation/doc-util/doc-code.d.ts +1 -0
  31. package/documentation/doc-util/doc-code.js +4 -0
  32. package/documentation/doc-util/doc-files.d.ts +1 -0
  33. package/documentation/doc-util/doc-files.js +2 -1
  34. package/documentation/doc-util/doc-server-message.js +1 -1
  35. package/documentation/doc-util/doc-structure.d.ts +1 -1
  36. package/documentation/doc-util/doc-structure.js +2 -2
  37. package/documentation/doc-util/doc-types.d.ts +1 -0
  38. package/documentation/doc-util/doc-types.js +16 -8
  39. package/documentation/print-core-wiki.js +8 -1
  40. package/documentation/print-interface-wiki.js +21 -15
  41. package/documentation/print-linting-and-testing-wiki.js +3 -1
  42. package/documentation/print-readme.d.ts +1 -0
  43. package/documentation/print-readme.js +160 -0
  44. package/package.json +28 -40
  45. package/queries/catalog/dependencies-query/dependencies-query-executor.js +77 -45
  46. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +3 -0
  47. package/queries/catalog/dependencies-query/dependencies-query-format.js +3 -2
  48. package/r-bridge/lang-4.x/ast/model/model.d.ts +2 -3
  49. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +1 -0
  50. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +3 -0
  51. package/r-bridge/shell.js +18 -8
  52. package/statistics/features/supported/comments/comments.js +17 -7
  53. package/statistics/features/supported/used-functions/post-process.js +0 -1
  54. package/statistics/features/supported/used-packages/used-packages.js +17 -7
  55. package/statistics/features/supported/values/values.js +17 -7
  56. package/statistics/summarizer/summarizer.js +1 -2
  57. package/util/files.js +17 -7
  58. package/util/json.js +0 -2
  59. package/util/numbers.d.ts +1 -0
  60. package/util/numbers.js +5 -0
  61. package/util/parallel.js +17 -7
  62. package/util/quads.js +3 -3
  63. package/util/version.js +1 -1
@@ -1,13 +1,43 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
5
35
  Object.defineProperty(exports, "__esModule", { value: true });
6
36
  exports.dataflowStarCommand = exports.dataflowCommand = void 0;
7
37
  const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
8
38
  const retriever_1 = require("../../../r-bridge/retriever");
9
39
  const dfg_1 = require("../../../util/mermaid/dfg");
10
- const clipboardy_1 = __importDefault(require("clipboardy"));
40
+ const clipboard = Promise.resolve().then(() => __importStar(require('clipboardy')));
11
41
  const ansi_1 = require("../../../util/ansi");
12
42
  /**
13
43
  * Obtain the dataflow graph using a known parser (such as the {@link RShell} or {@link TreeSitterExecutor}).
@@ -33,10 +63,10 @@ exports.dataflowCommand = {
33
63
  const mermaid = (0, dfg_1.graphToMermaid)({ graph: result.dataflow.graph, includeEnvironments: false }).string;
34
64
  output.stdout(mermaid);
35
65
  try {
36
- clipboardy_1.default.writeSync(mermaid);
66
+ (await clipboard).default.writeSync(mermaid);
37
67
  output.stdout(formatInfo(output, 'mermaid code', result.dataflow['.meta'].timing));
38
68
  }
39
- catch (e) { /* do nothing this is a service thing */ }
69
+ catch { /* do nothing this is a service thing */ }
40
70
  }
41
71
  };
42
72
  exports.dataflowStarCommand = {
@@ -49,10 +79,10 @@ exports.dataflowStarCommand = {
49
79
  const mermaid = (0, dfg_1.graphToMermaidUrl)(result.dataflow.graph, false);
50
80
  output.stdout(mermaid);
51
81
  try {
52
- clipboardy_1.default.writeSync(mermaid);
82
+ (await clipboard).default.writeSync(mermaid);
53
83
  output.stdout(formatInfo(output, 'mermaid url', result.dataflow['.meta'].timing));
54
84
  }
55
- catch (e) { /* do nothing this is a service thing */ }
85
+ catch { /* do nothing this is a service thing */ }
56
86
  }
57
87
  };
58
88
  //# sourceMappingURL=repl-dataflow.js.map
@@ -1,13 +1,43 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
5
35
  Object.defineProperty(exports, "__esModule", { value: true });
6
36
  exports.normalizeStarCommand = exports.normalizeCommand = void 0;
7
37
  const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
8
38
  const retriever_1 = require("../../../r-bridge/retriever");
9
39
  const ast_1 = require("../../../util/mermaid/ast");
10
- const clipboardy_1 = __importDefault(require("clipboardy"));
40
+ const clipboard = Promise.resolve().then(() => __importStar(require('clipboardy')));
11
41
  const ansi_1 = require("../../../util/ansi");
12
42
  async function normalize(parser, remainingLine) {
13
43
  return await (0, default_pipelines_1.createNormalizePipeline)(parser, {
@@ -30,10 +60,10 @@ exports.normalizeCommand = {
30
60
  const mermaid = (0, ast_1.normalizedAstToMermaid)(result.normalize.ast);
31
61
  output.stdout(mermaid);
32
62
  try {
33
- clipboardy_1.default.writeSync(mermaid);
63
+ (await clipboard).default.writeSync(mermaid);
34
64
  output.stdout(formatInfo(output, 'mermaid url', result.normalize['.meta'].timing));
35
65
  }
36
- catch (e) { /* do nothing this is a service thing */ }
66
+ catch { /* do nothing this is a service thing */ }
37
67
  }
38
68
  };
39
69
  exports.normalizeStarCommand = {
@@ -46,10 +76,10 @@ exports.normalizeStarCommand = {
46
76
  const mermaid = (0, ast_1.normalizedAstToMermaidUrl)(result.normalize.ast);
47
77
  output.stdout(mermaid);
48
78
  try {
49
- clipboardy_1.default.writeSync(mermaid);
79
+ (await clipboard).default.writeSync(mermaid);
50
80
  output.stdout(formatInfo(output, 'mermaid url', result.normalize['.meta'].timing));
51
81
  }
52
- catch (e) { /* do nothing this is a service thing */ }
82
+ catch { /* do nothing this is a service thing */ }
53
83
  }
54
84
  };
55
85
  //# sourceMappingURL=repl-normalize.js.map
@@ -21,14 +21,14 @@ function printHelp(output) {
21
21
  output.stdout(`\n\nThe example ${(0, ansi_1.italic)(':query "[{\\"type\\": \\"call-context\\", \\"callName\\": \\"mean\\" }]" mean(1:10)', output.formatter)} would return the call context of the mean function.`);
22
22
  output.stdout('As a convenience, we interpret any (non-help, non-@) string not starting with \'[\' as a regex for the simple call-context query.');
23
23
  output.stdout(`Hence, ${(0, ansi_1.italic)(':query "mean" mean(1:10)', output.formatter)} is equivalent to the above example.`);
24
- output.stdout(`Similarly, '@<type>' is interpreted as a query of the given type.`);
24
+ output.stdout('Similarly, \'@<type>\' is interpreted as a query of the given type.');
25
25
  output.stdout(`With this, ${(0, ansi_1.italic)(':query @config', output.formatter)} prints the result of the config query.`);
26
26
  }
27
27
  async function processQueryArgs(line, parser, output) {
28
28
  const args = (0, args_1.splitAtEscapeSensitive)(line);
29
29
  const query = args.shift();
30
30
  if (!query) {
31
- output.stderr(`No query provided, use ':query help' to get more information.`);
31
+ output.stderr('No query provided, use \':query help\' to get more information.');
32
32
  return;
33
33
  }
34
34
  if (query === 'help') {
package/cli/repl/core.js CHANGED
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -152,7 +162,6 @@ async function repl({ parser = new shell_1.RShell({ revive: 2 /* RShellReviveOpt
152
162
  rl.on('history', h => fs_1.default.writeFileSync(historyFile, h.join('\n'), { encoding: 'utf-8' }));
153
163
  }
154
164
  // the incredible repl :D, we kill it with ':quit'
155
- // eslint-disable-next-line no-constant-condition,@typescript-eslint/no-unnecessary-condition
156
165
  while (true) {
157
166
  await new Promise((resolve, reject) => {
158
167
  rl.question((0, prompt_1.prompt)(), answer => {
@@ -6,7 +6,8 @@ const repl_version_1 = require("./commands/repl-version");
6
6
  async function versionReplString(parser) {
7
7
  const version = await (0, repl_version_1.retrieveVersionInformation)(parser);
8
8
  const rVersion = version.r === 'none' ? '' : version.r === 'unknown' ? ', R version unknown' : `, R v${version.r}`;
9
- return `flowR repl using flowR v${version.flowr}${rVersion} (${version.engine} engine)`;
9
+ const treeSitterVer = parser.name === 'tree-sitter' ? `, R grammar v${parser.treeSitterVersion()}` : '';
10
+ return `flowR repl using flowR v${version.flowr}${rVersion}${treeSitterVer} (${version.engine} engine)`;
10
11
  }
11
12
  async function printVersionRepl(parser) {
12
13
  console.log(await versionReplString(parser));
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
37
  };
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.baseMessage = void 0;
27
37
  /**
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.responseExecuteReplEndMessage = exports.responseExecuteReplIntermediateMessage = exports.requestExecuteReplExpressionMessage = void 0;
27
37
  const Joi = __importStar(require("joi"));
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.responseSliceMessage = exports.requestSliceMessage = void 0;
27
37
  const Joi = __importStar(require("joi"));
@@ -21,7 +21,6 @@ const time_1 = require("../../util/time");
21
21
  const tar_1 = require("tar");
22
22
  const ansi_1 = require("../../util/ansi");
23
23
  function compressFolder(folder, target) {
24
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
25
24
  return (0, tar_1.create)({
26
25
  gzip: true,
27
26
  file: target,
@@ -14,7 +14,6 @@ function normalizedAstToJson(ast) {
14
14
  if (k === 'fullLexeme') {
15
15
  return undefined;
16
16
  }
17
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
18
17
  return (0, json_1.jsonReplacer)(k, v);
19
18
  });
20
19
  }
@@ -17,8 +17,10 @@ import type { AstIdMap } from '../../r-bridge/lang-4.x/ast/model/processing/deco
17
17
  */
18
18
  export declare function resolveByName(name: Identifier, environment: REnvironmentInformation, target?: ReferenceType): IdentifierDefinition[] | undefined;
19
19
  export declare function resolvesToBuiltInConstant(name: Identifier | undefined, environment: REnvironmentInformation, wantedValue: unknown): Ternary;
20
+ /** Please use {@link resolveValueOfVariable} */
20
21
  export declare function resolveToConstants(name: Identifier | undefined, environment: REnvironmentInformation): unknown[] | undefined;
21
22
  export declare function getAliases(sourceIds: readonly NodeId[], dataflow: DataflowGraph, environment: REnvironmentInformation): NodeId[] | undefined;
23
+ /** Please use {@link resolveValueOfVariable} */
22
24
  export declare function resolveToValues(identifier: Identifier | undefined, environment: REnvironmentInformation, idMap?: AstIdMap): unknown[] | undefined;
23
25
  /**
24
26
  * Convenience function using the variable resolver as specified within the configuration file
@@ -90,6 +90,7 @@ function resolvesToBuiltInConstant(name, environment, wantedValue) {
90
90
  return some ? logic_1.Ternary.Maybe : logic_1.Ternary.Never;
91
91
  }
92
92
  }
93
+ /** Please use {@link resolveValueOfVariable} */
93
94
  function resolveToConstants(name, environment) {
94
95
  if (name === undefined) {
95
96
  return undefined;
@@ -147,6 +148,7 @@ function getAliases(sourceIds, dataflow, environment) {
147
148
  }
148
149
  return [...definitions];
149
150
  }
151
+ /** Please use {@link resolveValueOfVariable} */
150
152
  function resolveToValues(identifier, environment, idMap) {
151
153
  if (identifier === undefined) {
152
154
  return undefined;
@@ -22,7 +22,7 @@ function resolveDataflowGraph(graph, idMap) {
22
22
  try {
23
23
  resolved = (0, parse_1.slicingCriterionToId)(id, resolveMap);
24
24
  }
25
- catch (e) {
25
+ catch {
26
26
  /* just keep it :D */
27
27
  resolved = id;
28
28
  }
@@ -47,4 +47,4 @@ export interface AssignmentToSymbolParameters<OtherInfo> extends AssignmentConfi
47
47
  export declare function markAsAssignment(information: {
48
48
  environment: REnvironmentInformation;
49
49
  graph: DataflowGraph;
50
- }, nodeToDefine: InGraphIdentifierDefinition, sourceIds: readonly NodeId[], rootIdOfAssignment: NodeId, config?: AssignmentConfiguration | undefined): void;
50
+ }, nodeToDefine: InGraphIdentifierDefinition, sourceIds: readonly NodeId[], rootIdOfAssignment: NodeId, config?: AssignmentConfiguration): void;
@@ -69,7 +69,7 @@ Requests for the [REPL](#message-request-repl) are independent of that.
69
69
  The request allows the server to analyze a file and prepare it for slicing.
70
70
  The message can contain a \`filetoken\`, which is used to identify the file in later slice or lineage requests (if you do not add one, the request will not be stored and therefore, it is not available for subsequent requests).
71
71
 
72
- > [!IMPORTANT]
72
+ > **Please note!**\\
73
73
  > If you want to send and process a lot of analysis requests, but do not want to slice them, please do not pass the \`filetoken\` field. This will save the server a lot of memory allocation.
74
74
 
75
75
  Furthermore, the request must contain either a \`content\` field to directly pass the file's content or a \`filepath\` field which contains the path to the file (this path must be accessible for the server to be useful).
@@ -420,7 +420,6 @@ See [above](#message-request-file-analysis) for the general structure of the res
420
420
  {
421
421
  type: 'compound',
422
422
  query: 'call-context',
423
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- otherwise we would have to carry generic typing information through the test infrastrcuture
424
423
  commonArguments: {
425
424
  kind: 'visualize',
426
425
  subkind: 'text',
@@ -5,3 +5,4 @@ export interface AutoGenHeaderArguments {
5
5
  readonly purpose: string;
6
6
  }
7
7
  export declare function autoGenHeader({ rVersion, filename, purpose, currentDateAndTime }: AutoGenHeaderArguments): string;
8
+ export declare function fileNameForGenHeader(filename: string): string;
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.autoGenHeader = autoGenHeader;
4
+ exports.fileNameForGenHeader = fileNameForGenHeader;
4
5
  const version_1 = require("../../util/version");
5
6
  const doc_files_1 = require("./doc-files");
6
7
  function autoGenHeader({ rVersion, filename, purpose, currentDateAndTime = new Date().toISOString().replace('T', ', ').replace(/\.\d+Z$/, ' UTC') }) {
8
+ return `_This document was generated from '${fileNameForGenHeader(filename)}' on ${currentDateAndTime} presenting an overview of flowR's ${purpose} (v${(0, version_1.flowrVersion)().format()}${rVersion ? ', using R v' + rVersion : ''}). Please do not edit this file/wiki page directly._`;
9
+ }
10
+ function fileNameForGenHeader(filename) {
7
11
  const shortenFilename = filename.replace(/^.*src\//, 'src/');
8
- return `_This document was generated from '${(0, doc_files_1.linkFlowRSourceFile)(shortenFilename)}' on ${currentDateAndTime} presenting an overview of flowR's ${purpose} (v${(0, version_1.flowrVersion)().format()}${rVersion ? ', using R v' + rVersion : ''}). Please do not edit this file/wiki page directly._`;
12
+ return (0, doc_files_1.linkFlowRSourceFile)(shortenFilename);
9
13
  }
10
14
  //# sourceMappingURL=doc-auto-gen.js.map
@@ -0,0 +1,23 @@
1
+ interface BenchmarkData {
2
+ readonly lastUpdate: number;
3
+ readonly repoUrl: string;
4
+ readonly entries: Record<string, [BenchmarkElement]>;
5
+ }
6
+ interface BenchmarkElement {
7
+ readonly commit: Record<string, unknown>;
8
+ readonly date: number;
9
+ readonly tool: string;
10
+ readonly benches: BenchmarkElementBench[];
11
+ }
12
+ interface BenchmarkElementBench {
13
+ readonly name: string;
14
+ readonly value: number;
15
+ readonly unit: string;
16
+ readonly range: number;
17
+ readonly extra: string;
18
+ }
19
+ export declare function loadBenchmarkData(): Promise<BenchmarkData>;
20
+ export declare function getLatestBenchmark(suite: string): Promise<BenchmarkElement>;
21
+ export declare function getLastBenchmarkUpdate(): Promise<number>;
22
+ export declare function getLatestDfAnalysisTime(suite: string): Promise<number>;
23
+ export {};
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.loadBenchmarkData = loadBenchmarkData;
40
+ exports.getLatestBenchmark = getLatestBenchmark;
41
+ exports.getLastBenchmarkUpdate = getLastBenchmarkUpdate;
42
+ exports.getLatestDfAnalysisTime = getLatestDfAnalysisTime;
43
+ const path_1 = __importDefault(require("path"));
44
+ const assert_1 = require("../../util/assert");
45
+ const BenchmarkDataPath = path_1.default.resolve(__dirname, '..', '..', '..', 'wiki', 'stats', 'benchmark', 'data.js');
46
+ let benchmarkData = null;
47
+ async function loadBenchmarkData() {
48
+ if (benchmarkData === null) {
49
+ // provide a window object to attach to in the import
50
+ globalThis['window'] = {};
51
+ await Promise.resolve(`${BenchmarkDataPath}`).then(s => __importStar(require(s)));
52
+ // @ts-expect-error -- we know that the data is there
53
+ benchmarkData = window['BENCHMARK_DATA'];
54
+ }
55
+ return benchmarkData;
56
+ }
57
+ async function getLatestBenchmark(suite) {
58
+ // provide a window object to attach to in the import
59
+ const suiteData = (await loadBenchmarkData()).entries[suite];
60
+ (0, assert_1.guard)(suiteData, `No benchmark data for suite '${suite}' found!`);
61
+ return suiteData.sort((a, b) => b.date - a.date)[0];
62
+ }
63
+ async function getLastBenchmarkUpdate() {
64
+ return (await loadBenchmarkData()).lastUpdate;
65
+ }
66
+ function getBenchmarkElement(bench, name) {
67
+ const element = bench.benches.find(b => b.name === name);
68
+ (0, assert_1.guard)(element, `No benchmark data for '${name}' found!`);
69
+ return element;
70
+ }
71
+ async function getLatestDfAnalysisTime(suite) {
72
+ const elem = await getLatestBenchmark(suite);
73
+ const [parse, normalize, analyze] = ['Retrieve AST from R code', 'Normalize R AST', 'Produce dataflow information'].map(name => getBenchmarkElement(elem, name));
74
+ return parse.value + normalize.value + analyze.value;
75
+ }
76
+ //# sourceMappingURL=doc-benchmarks.js.map
@@ -1,2 +1,3 @@
1
1
  export declare function codeBlock(language: string, code: string | undefined): string;
2
+ export declare function codeInline(code: string): string;
2
3
  export declare function jsonWithLimit(object: object, maxLength?: number, tooLongText?: string): string;
@@ -1,11 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.codeBlock = codeBlock;
4
+ exports.codeInline = codeInline;
4
5
  exports.jsonWithLimit = jsonWithLimit;
5
6
  const json_1 = require("../../util/json");
6
7
  function codeBlock(language, code) {
7
8
  return `\n\`\`\`${language}\n${code?.trim() ?? ''}\n\`\`\`\n`;
8
9
  }
10
+ function codeInline(code) {
11
+ return `<code>${code}</code>`;
12
+ }
9
13
  function jsonWithLimit(object, maxLength = 5_000, tooLongText = '_As the code is pretty long, we inhibit pretty printing and syntax highlighting (JSON):_') {
10
14
  const prettyPrinted = JSON.stringify(object, json_1.jsonReplacer, 2);
11
15
  return `
@@ -5,6 +5,7 @@ export declare const FlowrWikiBaseRef = "https://github.com/flowr-analysis/flowr
5
5
  export declare const FlowrNpmRef = "https://www.npmjs.com/package/@eagleoutice/flowr";
6
6
  export declare const FlowrDockerRef = "https://hub.docker.com/r/eagleoutice/flowr";
7
7
  export declare const FlowrCodecovRef = "https://app.codecov.io/gh/flowr-analysis/flowr";
8
+ export declare const FlowrVsCode = "https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr";
8
9
  export declare function getFilePathMd(path: string): string;
9
10
  export declare function getFileContentFromRoot(path: string): string;
10
11
  export declare function linkFlowRSourceFile(path: string): string;
@@ -3,7 +3,7 @@ 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.FlowrCodecovRef = exports.FlowrDockerRef = exports.FlowrNpmRef = exports.FlowrWikiBaseRef = exports.RemoteFlowrFilePathBaseRef = exports.FlowrSiteBaseRef = exports.FlowrGithubBaseRef = void 0;
6
+ exports.FlowrVsCode = exports.FlowrCodecovRef = exports.FlowrDockerRef = exports.FlowrNpmRef = exports.FlowrWikiBaseRef = exports.RemoteFlowrFilePathBaseRef = exports.FlowrSiteBaseRef = exports.FlowrGithubBaseRef = void 0;
7
7
  exports.getFilePathMd = getFilePathMd;
8
8
  exports.getFileContentFromRoot = getFileContentFromRoot;
9
9
  exports.linkFlowRSourceFile = linkFlowRSourceFile;
@@ -15,6 +15,7 @@ exports.FlowrWikiBaseRef = `${exports.FlowrGithubBaseRef}/flowr/wiki`;
15
15
  exports.FlowrNpmRef = 'https://www.npmjs.com/package/@eagleoutice/flowr';
16
16
  exports.FlowrDockerRef = 'https://hub.docker.com/r/eagleoutice/flowr';
17
17
  exports.FlowrCodecovRef = 'https://app.codecov.io/gh/flowr-analysis/flowr';
18
+ exports.FlowrVsCode = 'https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr';
18
19
  function getFilePathMd(path) {
19
20
  // we go one up as we are in doc-util now :D #convenience
20
21
  const fullpath = require.resolve('../' + path);
@@ -80,7 +80,7 @@ async function documentServerMessageResponse({ shell, title, messageType, messag
80
80
  try {
81
81
  await socket.waitForMessage(metaMessage.expectedType, 20);
82
82
  }
83
- catch (e) {
83
+ catch {
84
84
  console.error('Failed to receive message', metaMessage.expectedType, 'has', socket.getMessages());
85
85
  }
86
86
  }
@@ -6,7 +6,7 @@ export interface DetailsOptions {
6
6
  }
7
7
  export declare function details(title: string, content: string, { color, open, hideIfEmpty, prefixInit }?: DetailsOptions): string;
8
8
  export interface BlockOptions {
9
- readonly type: 'NOTE' | 'WARNING' | 'TIP';
9
+ readonly type: 'NOTE' | 'WARNING' | 'TIP' | 'IMPORTANT';
10
10
  readonly content: string;
11
11
  }
12
12
  export declare function block({ type, content }: BlockOptions): string;
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.details = details;
4
4
  exports.block = block;
5
5
  const doc_general_1 = require("./doc-general");
6
- function details(title, content, { color = 'black', open = false, hideIfEmpty = true, prefixInit = '' } = {}) {
6
+ function details(title, content, { color, open = false, hideIfEmpty = true, prefixInit = '' } = {}) {
7
7
  return hideIfEmpty && content.trim().length === 0 ? '' : `
8
- ${prefixInit}<details${open ? ' open' : ''}><summary style="color:${color}">${title}</summary>
8
+ ${prefixInit}<details${open ? ' open' : ''}><summary style="${color ? 'color:' + color : ''}">${title}</summary>
9
9
 
10
10
  ${content}
11
11