@abaplint/cli 2.91.9 → 2.91.10

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 (4) hide show
  1. package/README.md +21 -21
  2. package/abaplint +2 -2
  3. package/build/cli.js +81 -81
  4. package/package.json +64 -64
package/build/cli.js CHANGED
@@ -7188,7 +7188,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
7188
7188
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7189
7189
 
7190
7190
  "use strict";
7191
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ValueBody = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst for_1 = __webpack_require__(/*! ./for */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/for.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst let_1 = __webpack_require__(/*! ./let */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/let.js\");\r\nconst field_assignment_1 = __webpack_require__(/*! ./field_assignment */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_assignment.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nclass ValueBody {\r\n runSyntax(node, scope, filename, targetType) {\r\n var _a;\r\n if (node === undefined) {\r\n return targetType;\r\n }\r\n for (const forNode of node.findDirectExpressions(Expressions.For) || []) {\r\n new for_1.For().runSyntax(forNode, scope, filename);\r\n }\r\n let scoped = false;\r\n const letNode = node.findDirectExpression(Expressions.Let);\r\n if (letNode) {\r\n scoped = new let_1.Let().runSyntax(letNode, scope, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.FieldAssignment)) {\r\n new field_assignment_1.FieldAssignment().runSyntax(s, scope, filename, targetType);\r\n }\r\n let type = undefined; // todo, this is only correct if there is a single source in the body\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n type = new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const s of ((_a = node.findDirectExpression(Expressions.ValueBodyLines)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.Source)) || []) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n if (scoped === true) {\r\n scope.pop(node.getLastToken().getEnd());\r\n }\r\n while (scope.getType() === _scope_type_1.ScopeType.For) {\r\n scope.pop(node.getLastToken().getEnd());\r\n }\r\n if ((targetType === null || targetType === void 0 ? void 0 : targetType.isGeneric()) && type) {\r\n return type;\r\n }\r\n return targetType ? targetType : type;\r\n }\r\n}\r\nexports.ValueBody = ValueBody;\r\n//# sourceMappingURL=value_body.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/value_body.js?");
7191
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ValueBody = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst for_1 = __webpack_require__(/*! ./for */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/for.js\");\r\nconst source_1 = __webpack_require__(/*! ./source */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/source.js\");\r\nconst let_1 = __webpack_require__(/*! ./let */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/let.js\");\r\nconst field_assignment_1 = __webpack_require__(/*! ./field_assignment */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/field_assignment.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nclass ValueBody {\r\n runSyntax(node, scope, filename, targetType) {\r\n if (node === undefined) {\r\n return targetType;\r\n }\r\n for (const forNode of node.findDirectExpressions(Expressions.For) || []) {\r\n new for_1.For().runSyntax(forNode, scope, filename);\r\n }\r\n let scoped = false;\r\n const letNode = node.findDirectExpression(Expressions.Let);\r\n if (letNode) {\r\n scoped = new let_1.Let().runSyntax(letNode, scope, filename);\r\n }\r\n for (const s of node.findDirectExpressions(Expressions.FieldAssignment)) {\r\n new field_assignment_1.FieldAssignment().runSyntax(s, scope, filename, targetType);\r\n }\r\n let type = undefined; // todo, this is only correct if there is a single source in the body\r\n for (const s of node.findDirectExpressions(Expressions.Source)) {\r\n type = new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n for (const l of node.findDirectExpressions(Expressions.ValueBodyLines)) {\r\n for (const s of l.findDirectExpressions(Expressions.Source)) {\r\n new source_1.Source().runSyntax(s, scope, filename);\r\n }\r\n }\r\n if (scoped === true) {\r\n scope.pop(node.getLastToken().getEnd());\r\n }\r\n while (scope.getType() === _scope_type_1.ScopeType.For) {\r\n scope.pop(node.getLastToken().getEnd());\r\n }\r\n if ((targetType === null || targetType === void 0 ? void 0 : targetType.isGeneric()) && type) {\r\n return type;\r\n }\r\n return targetType ? targetType : type;\r\n }\r\n}\r\nexports.ValueBody = ValueBody;\r\n//# sourceMappingURL=value_body.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/value_body.js?");
7192
7192
 
7193
7193
  /***/ }),
7194
7194
 
@@ -8585,7 +8585,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
8585
8585
  /***/ ((__unused_webpack_module, exports) => {
8586
8586
 
8587
8587
  "use strict";
8588
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FlowGraph = void 0;\r\nclass FlowGraph {\r\n constructor(counter) {\r\n this.label = \"undefined\";\r\n this.edges = {};\r\n this.start = \"start#\" + counter;\r\n this.end = \"end#\" + counter;\r\n }\r\n getStart() {\r\n return this.start;\r\n }\r\n getEnd() {\r\n return this.end;\r\n }\r\n addEdge(from, to) {\r\n if (this.edges[from] === undefined) {\r\n this.edges[from] = {};\r\n }\r\n this.edges[from][to] = true;\r\n }\r\n removeEdge(from, to) {\r\n if (this.edges[from] === undefined) {\r\n return;\r\n }\r\n delete this.edges[from][to];\r\n if (Object.keys(this.edges[from]).length === 0) {\r\n delete this.edges[from];\r\n }\r\n }\r\n listEdges() {\r\n const list = [];\r\n for (const from of Object.keys(this.edges)) {\r\n for (const to of Object.keys(this.edges[from])) {\r\n list.push({ from, to });\r\n }\r\n }\r\n return list;\r\n }\r\n listNodes() {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n set.add(l.from);\r\n set.add(l.to);\r\n }\r\n return Array.from(set.values());\r\n }\r\n hasEdges() {\r\n return Object.keys(this.edges).length > 0;\r\n }\r\n /** return value: end node of to graph */\r\n addGraph(from, to) {\r\n if (to.hasEdges() === false) {\r\n return from;\r\n }\r\n this.addEdge(from, to.getStart());\r\n to.listEdges().forEach(e => this.addEdge(e.from, e.to));\r\n return to.getEnd();\r\n }\r\n toJSON() {\r\n return JSON.stringify(this.edges);\r\n }\r\n toTextEdges() {\r\n let graph = \"\";\r\n for (const l of this.listEdges()) {\r\n graph += `\"${l.from}\" -> \"${l.to}\";\\n`;\r\n }\r\n return graph.trim();\r\n }\r\n setLabel(label) {\r\n this.label = label;\r\n }\r\n toDigraph() {\r\n return `digraph G {\nlabelloc=\"t\";\nlabel=\"${this.label}\";\ngraph [fontname = \"helvetica\"];\nnode [fontname = \"helvetica\", shape=\"box\"];\nedge [fontname = \"helvetica\"];\n${this.toTextEdges()}\n}`;\r\n }\r\n listSources(node) {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n if (node === l.to) {\r\n set.add(l.from);\r\n }\r\n }\r\n return Array.from(set.values());\r\n }\r\n listTargets(node) {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n if (node === l.from) {\r\n set.add(l.to);\r\n }\r\n }\r\n return Array.from(set.values());\r\n }\r\n /** removes all nodes containing \"#\" that have one ingoing and one outgoing edge */\r\n reduce() {\r\n for (const node of this.listNodes()) {\r\n if (node.includes(\"#\") === false) {\r\n continue;\r\n }\r\n const sources = this.listSources(node);\r\n const targets = this.listTargets(node);\r\n if (sources.length > 0 && targets.length > 0) {\r\n // hash node in the middle of the graph\r\n for (const s of sources) {\r\n this.removeEdge(s, node);\r\n }\r\n for (const t of targets) {\r\n this.removeEdge(node, t);\r\n }\r\n for (const s of sources) {\r\n for (const t of targets) {\r\n this.addEdge(s, t);\r\n }\r\n }\r\n }\r\n if (node.startsWith(\"end#\") && sources.length === 0) {\r\n for (const t of targets) {\r\n this.removeEdge(node, t);\r\n }\r\n }\r\n }\r\n return this;\r\n }\r\n}\r\nexports.FlowGraph = FlowGraph;\r\n//# sourceMappingURL=flow_graph.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js?");
8588
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FlowGraph = void 0;\r\nclass FlowGraph {\r\n constructor(counter) {\r\n this.label = \"undefined\";\r\n this.edges = {};\r\n this.start = \"start#\" + counter;\r\n this.end = \"end#\" + counter;\r\n }\r\n getStart() {\r\n return this.start;\r\n }\r\n getEnd() {\r\n return this.end;\r\n }\r\n addEdge(from, to) {\r\n if (this.edges[from] === undefined) {\r\n this.edges[from] = {};\r\n }\r\n this.edges[from][to] = true;\r\n }\r\n removeEdge(from, to) {\r\n if (this.edges[from] === undefined) {\r\n return;\r\n }\r\n delete this.edges[from][to];\r\n if (Object.keys(this.edges[from]).length === 0) {\r\n delete this.edges[from];\r\n }\r\n }\r\n listEdges() {\r\n const list = [];\r\n for (const from of Object.keys(this.edges)) {\r\n for (const to of Object.keys(this.edges[from])) {\r\n list.push({ from, to });\r\n }\r\n }\r\n return list;\r\n }\r\n listNodes() {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n set.add(l.from);\r\n set.add(l.to);\r\n }\r\n return Array.from(set.values());\r\n }\r\n hasEdges() {\r\n return Object.keys(this.edges).length > 0;\r\n }\r\n /** return value: end node of to graph */\r\n addGraph(from, to) {\r\n if (to.hasEdges() === false) {\r\n return from;\r\n }\r\n this.addEdge(from, to.getStart());\r\n to.listEdges().forEach(e => this.addEdge(e.from, e.to));\r\n return to.getEnd();\r\n }\r\n toJSON() {\r\n return JSON.stringify(this.edges);\r\n }\r\n toTextEdges() {\r\n let graph = \"\";\r\n for (const l of this.listEdges()) {\r\n graph += `\"${l.from}\" -> \"${l.to}\";\\n`;\r\n }\r\n return graph.trim();\r\n }\r\n setLabel(label) {\r\n this.label = label;\r\n }\r\n toDigraph() {\r\n return `digraph G {\r\nlabelloc=\"t\";\r\nlabel=\"${this.label}\";\r\ngraph [fontname = \"helvetica\"];\r\nnode [fontname = \"helvetica\", shape=\"box\"];\r\nedge [fontname = \"helvetica\"];\r\n${this.toTextEdges()}\r\n}`;\r\n }\r\n listSources(node) {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n if (node === l.to) {\r\n set.add(l.from);\r\n }\r\n }\r\n return Array.from(set.values());\r\n }\r\n listTargets(node) {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n if (node === l.from) {\r\n set.add(l.to);\r\n }\r\n }\r\n return Array.from(set.values());\r\n }\r\n /** removes all nodes containing \"#\" that have one ingoing and one outgoing edge */\r\n reduce() {\r\n for (const node of this.listNodes()) {\r\n if (node.includes(\"#\") === false) {\r\n continue;\r\n }\r\n const sources = this.listSources(node);\r\n const targets = this.listTargets(node);\r\n if (sources.length > 0 && targets.length > 0) {\r\n // hash node in the middle of the graph\r\n for (const s of sources) {\r\n this.removeEdge(s, node);\r\n }\r\n for (const t of targets) {\r\n this.removeEdge(node, t);\r\n }\r\n for (const s of sources) {\r\n for (const t of targets) {\r\n this.addEdge(s, t);\r\n }\r\n }\r\n }\r\n if (node.startsWith(\"end#\") && sources.length === 0) {\r\n for (const t of targets) {\r\n this.removeEdge(node, t);\r\n }\r\n }\r\n }\r\n return this;\r\n }\r\n}\r\nexports.FlowGraph = FlowGraph;\r\n//# sourceMappingURL=flow_graph.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js?");
8589
8589
 
8590
8590
  /***/ }),
8591
8591
 
@@ -9883,7 +9883,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
9883
9883
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9884
9884
 
9885
9885
  "use strict";
9886
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Help = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ \"./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst dump_scope_1 = __webpack_require__(/*! ./dump_scope */ \"./node_modules/@abaplint/core/build/src/lsp/dump_scope.js\");\r\nclass Help {\r\n static find(reg, textDocument, position) {\r\n const file = _lsp_utils_1.LSPUtils.getABAPFile(reg, textDocument.uri);\r\n if (file === undefined) {\r\n return \"file not found\";\r\n }\r\n else {\r\n return this.dumpABAP(file, reg, textDocument, position);\r\n }\r\n }\r\n /////////////////////////////////////////////////\r\n static dumpABAP(file, reg, textDocument, position) {\r\n let content = \"\";\r\n content = `\n <a href=\"#_tokens\" rel=\"no-refresh\">Tokens</a> |\n <a href=\"#_statements\" rel=\"no-refresh\">Statements</a> |\n <a href=\"#_structure\" rel=\"no-refresh\">Structure</a> |\n <a href=\"#_files\" rel=\"no-refresh\">Files</a> |\n <a href=\"#_info\" rel=\"no-refresh\">Info Dump</a>\n <hr>\n ` +\r\n \"<tt>\" + textDocument.uri + \" (\" +\r\n (position.line + 1) + \", \" +\r\n (position.character + 1) + \")</tt>\";\r\n content = content + \"<hr>\";\r\n content = content + this.cursorInformation(reg, textDocument, position, file);\r\n content = content + this.fileInformation(file);\r\n content = content + \"<hr>\";\r\n content = content + this.dumpFiles(reg);\r\n content = content + \"<hr>\";\r\n content = content + this.dumpInfo(file);\r\n return content;\r\n }\r\n static dumpInfo(file) {\r\n const info = file.getInfo();\r\n const dump = {\r\n classDefinitions: info.listClassDefinitions(),\r\n classImplementations: info.listClassImplementations(),\r\n interfaceDefinitions: info.listInterfaceDefinitions(),\r\n forms: info.listFormDefinitions(),\r\n };\r\n const text = JSON.stringify(dump, null, 2);\r\n return `<h3 id=\"_info\">Info Dump</h3><pre>` + text + \"</pre>\";\r\n }\r\n static cursorInformation(reg, textDocument, position, file) {\r\n let ret = \"\";\r\n const found = _lsp_utils_1.LSPUtils.findCursor(reg, { textDocument, position });\r\n if (found !== undefined) {\r\n ret = \"Statement: \" + this.linkToStatement(found.snode.get()) + \"<br>\\n\" +\r\n \"Token: \" + found.token.constructor.name + \"<br>\\n\" +\r\n this.fullPath(file, found.token).value;\r\n }\r\n else {\r\n ret = \"No token found at cursor position\";\r\n }\r\n const obj = reg.getObject(file.getObjectType(), file.getObjectName());\r\n if (obj instanceof _abap_object_1.ABAPObject) {\r\n const spaghetti = new syntax_1.SyntaxLogic(reg, obj).run().spaghetti;\r\n ret = ret + dump_scope_1.DumpScope.dump(spaghetti);\r\n if (found !== undefined) {\r\n ret = ret + \"<hr>Spaghetti Scope by Cursor Position:<br><br>\\n\";\r\n const lookup = spaghetti.lookupPosition(found.token.getStart(), textDocument.uri);\r\n if (lookup) {\r\n const identifier = lookup.getIdentifier();\r\n ret = ret + \"<u>\" + identifier.stype + \", <tt>\" + identifier.sname + \"</tt>, \" + identifier.filename;\r\n ret = ret + \", (\" + identifier.start.getRow() + \", \" + identifier.start.getCol() + \")</u><br>\";\r\n }\r\n else {\r\n ret = ret + \"Not found\";\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n static fullPath(file, token) {\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return { value: \"\", keyword: false };\r\n }\r\n const found = this.traverse(structure, \"\", token);\r\n if (found === undefined) {\r\n return { value: \"\", keyword: false };\r\n }\r\n return { value: \"\\n\\n\" + found.value, keyword: found.keyword };\r\n }\r\n static traverse(node, parents, search) {\r\n let local = parents;\r\n if (local !== \"\") {\r\n local = local + \" -> \";\r\n }\r\n if (node instanceof nodes_1.StructureNode) {\r\n local = local + \"Structure: \" + this.linkToStructure(node.get());\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n local = local + \"Statement: \" + this.linkToStatement(node.get());\r\n }\r\n else if (node instanceof nodes_1.ExpressionNode) {\r\n local = local + \"Expression: \" + this.linkToExpression(node.get());\r\n }\r\n else if (node instanceof nodes_1.TokenNode) {\r\n local = local + \"Token: \" + node.get().constructor.name;\r\n const token = node.get();\r\n if (token.getStr() === search.getStr()\r\n && token.getCol() === search.getCol()\r\n && token.getRow() === search.getRow()) {\r\n const keyword = !(node instanceof nodes_1.TokenNodeRegex);\r\n return { value: local, keyword };\r\n }\r\n }\r\n else {\r\n throw new Error(\"hover, traverse, unexpected node type\");\r\n }\r\n for (const child of node.getChildren()) {\r\n const ret = this.traverse(child, local, search);\r\n if (ret) {\r\n return ret;\r\n }\r\n }\r\n return undefined;\r\n }\r\n static fileInformation(file) {\r\n let content = \"\";\r\n content = content + `<hr><h3 id=\"_tokens\">Tokens</h3>\\n`;\r\n content = content + this.tokens(file);\r\n content = content + `<hr><h3 id=\"_statements\">Statements</h3>\\n`;\r\n content = content + this.buildStatements(file);\r\n content = content + `<hr><h3 id=\"_structure\">Structure</h3>\\n`;\r\n const structure = file.getStructure();\r\n if (structure !== undefined) {\r\n content = content + this.buildStructure([structure]);\r\n }\r\n else {\r\n content = content + \"structure undefined\";\r\n }\r\n return content;\r\n }\r\n static escape(str) {\r\n str = str.replace(/&/g, \"&amp;\");\r\n str = str.replace(/>/g, \"&gt;\");\r\n str = str.replace(/</g, \"&lt;\");\r\n str = str.replace(/\"/g, \"&quot;\");\r\n str = str.replace(/'/g, \"&#039;\");\r\n return str;\r\n }\r\n static linkToStatement(statement) {\r\n return `<a href=\"https://syntax.abaplint.org/#/statement/${statement.constructor.name}\" target=\"_blank\">${statement.constructor.name}</a>\\n`;\r\n }\r\n static linkToStructure(structure) {\r\n return `<a href=\"https://syntax.abaplint.org/#/structure/${structure.constructor.name}\" target=\"_blank\">${structure.constructor.name}</a>\\n`;\r\n }\r\n static linkToExpression(expression) {\r\n return `<a href=\"https://syntax.abaplint.org/#/expression/${expression.constructor.name}\" target=\"_blank\">${expression.constructor.name}</a>\\n`;\r\n }\r\n static outputNodes(nodes) {\r\n let ret = \"<ul>\";\r\n for (const node of nodes) {\r\n let extra = \"\";\r\n switch (node.constructor.name) {\r\n case \"TokenNode\":\r\n case \"TokenNodeRegex\":\r\n extra = node.get().constructor.name + \", \\\"\" + node.get().getStr() + \"\\\"\";\r\n break;\r\n case \"ExpressionNode\":\r\n extra = this.linkToExpression(node.get()) + this.outputNodes(node.getChildren());\r\n break;\r\n default:\r\n break;\r\n }\r\n ret = ret + \"<li>\" + node.constructor.name + \", \" + extra + \"</li>\";\r\n }\r\n return ret + \"</ul>\";\r\n }\r\n static tokens(file) {\r\n let inner = \"<table><tr><td><b>String</b></td><td><b>Type</b></td><td><b>Row</b></td><td><b>Column</b></td></tr>\";\r\n for (const token of file.getTokens()) {\r\n inner = inner + \"<tr><td><tt>\" +\r\n this.escape(token.getStr()) + \"</tt></td><td>\" +\r\n token.constructor.name + \"</td><td align=\\\"right\\\">\" +\r\n token.getRow() + \"</td><td align=\\\"right\\\">\" +\r\n token.getCol() + \"</td></tr>\";\r\n }\r\n inner = inner + \"</table>\";\r\n return inner;\r\n }\r\n static buildStatements(file) {\r\n let output = \"\";\r\n for (const statement of file.getStatements()) {\r\n const row = statement.getStart().getRow();\r\n // getting the class name only works if uglify does not mangle names\r\n output = output +\r\n row + \": \" +\r\n this.linkToStatement(statement.get()) +\r\n \"</div></b>\\n\" + this.outputNodes(statement.getChildren());\r\n }\r\n return output;\r\n }\r\n static buildStructure(nodes) {\r\n let output = \"<ul>\";\r\n for (const node of nodes) {\r\n if (node instanceof nodes_1.StructureNode) {\r\n output = output + \"<li>\" + this.linkToStructure(node.get()) + \", Structure \" + this.buildStructure(node.getChildren()) + \"</li>\";\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n output = output + \"<li>\" + this.linkToStatement(node.get()) + \", Statement</li>\";\r\n }\r\n }\r\n return output + \"</ul>\";\r\n }\r\n static dumpFiles(reg) {\r\n let output = `<h3 id=\"_files\">Files</h3><table>\\n`;\r\n for (const o of reg.getObjects()) {\r\n if (reg.isDependency(o) === true) {\r\n continue;\r\n }\r\n output = output + \"<tr><td valign=\\\"top\\\">\" + o.getType() + \" \" + o.getName() + \"</td><td>\";\r\n for (const f of o.getFiles()) {\r\n output = output + f.getFilename() + \"<br>\";\r\n }\r\n output = output + \"</td></tr>\\n\";\r\n }\r\n return output + \"</table>\\n\";\r\n }\r\n}\r\nexports.Help = Help;\r\n//# sourceMappingURL=help.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/lsp/help.js?");
9886
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Help = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ \"./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst dump_scope_1 = __webpack_require__(/*! ./dump_scope */ \"./node_modules/@abaplint/core/build/src/lsp/dump_scope.js\");\r\nclass Help {\r\n static find(reg, textDocument, position) {\r\n const file = _lsp_utils_1.LSPUtils.getABAPFile(reg, textDocument.uri);\r\n if (file === undefined) {\r\n return \"file not found\";\r\n }\r\n else {\r\n return this.dumpABAP(file, reg, textDocument, position);\r\n }\r\n }\r\n /////////////////////////////////////////////////\r\n static dumpABAP(file, reg, textDocument, position) {\r\n let content = \"\";\r\n content = `\r\n <a href=\"#_tokens\" rel=\"no-refresh\">Tokens</a> |\r\n <a href=\"#_statements\" rel=\"no-refresh\">Statements</a> |\r\n <a href=\"#_structure\" rel=\"no-refresh\">Structure</a> |\r\n <a href=\"#_files\" rel=\"no-refresh\">Files</a> |\r\n <a href=\"#_info\" rel=\"no-refresh\">Info Dump</a>\r\n <hr>\r\n ` +\r\n \"<tt>\" + textDocument.uri + \" (\" +\r\n (position.line + 1) + \", \" +\r\n (position.character + 1) + \")</tt>\";\r\n content = content + \"<hr>\";\r\n content = content + this.cursorInformation(reg, textDocument, position, file);\r\n content = content + this.fileInformation(file);\r\n content = content + \"<hr>\";\r\n content = content + this.dumpFiles(reg);\r\n content = content + \"<hr>\";\r\n content = content + this.dumpInfo(file);\r\n return content;\r\n }\r\n static dumpInfo(file) {\r\n const info = file.getInfo();\r\n const dump = {\r\n classDefinitions: info.listClassDefinitions(),\r\n classImplementations: info.listClassImplementations(),\r\n interfaceDefinitions: info.listInterfaceDefinitions(),\r\n forms: info.listFormDefinitions(),\r\n };\r\n const text = JSON.stringify(dump, null, 2);\r\n return `<h3 id=\"_info\">Info Dump</h3><pre>` + text + \"</pre>\";\r\n }\r\n static cursorInformation(reg, textDocument, position, file) {\r\n let ret = \"\";\r\n const found = _lsp_utils_1.LSPUtils.findCursor(reg, { textDocument, position });\r\n if (found !== undefined) {\r\n ret = \"Statement: \" + this.linkToStatement(found.snode.get()) + \"<br>\\n\" +\r\n \"Token: \" + found.token.constructor.name + \"<br>\\n\" +\r\n this.fullPath(file, found.token).value;\r\n }\r\n else {\r\n ret = \"No token found at cursor position\";\r\n }\r\n const obj = reg.getObject(file.getObjectType(), file.getObjectName());\r\n if (obj instanceof _abap_object_1.ABAPObject) {\r\n const spaghetti = new syntax_1.SyntaxLogic(reg, obj).run().spaghetti;\r\n ret = ret + dump_scope_1.DumpScope.dump(spaghetti);\r\n if (found !== undefined) {\r\n ret = ret + \"<hr>Spaghetti Scope by Cursor Position:<br><br>\\n\";\r\n const lookup = spaghetti.lookupPosition(found.token.getStart(), textDocument.uri);\r\n if (lookup) {\r\n const identifier = lookup.getIdentifier();\r\n ret = ret + \"<u>\" + identifier.stype + \", <tt>\" + identifier.sname + \"</tt>, \" + identifier.filename;\r\n ret = ret + \", (\" + identifier.start.getRow() + \", \" + identifier.start.getCol() + \")</u><br>\";\r\n }\r\n else {\r\n ret = ret + \"Not found\";\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n static fullPath(file, token) {\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return { value: \"\", keyword: false };\r\n }\r\n const found = this.traverse(structure, \"\", token);\r\n if (found === undefined) {\r\n return { value: \"\", keyword: false };\r\n }\r\n return { value: \"\\n\\n\" + found.value, keyword: found.keyword };\r\n }\r\n static traverse(node, parents, search) {\r\n let local = parents;\r\n if (local !== \"\") {\r\n local = local + \" -> \";\r\n }\r\n if (node instanceof nodes_1.StructureNode) {\r\n local = local + \"Structure: \" + this.linkToStructure(node.get());\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n local = local + \"Statement: \" + this.linkToStatement(node.get());\r\n }\r\n else if (node instanceof nodes_1.ExpressionNode) {\r\n local = local + \"Expression: \" + this.linkToExpression(node.get());\r\n }\r\n else if (node instanceof nodes_1.TokenNode) {\r\n local = local + \"Token: \" + node.get().constructor.name;\r\n const token = node.get();\r\n if (token.getStr() === search.getStr()\r\n && token.getCol() === search.getCol()\r\n && token.getRow() === search.getRow()) {\r\n const keyword = !(node instanceof nodes_1.TokenNodeRegex);\r\n return { value: local, keyword };\r\n }\r\n }\r\n else {\r\n throw new Error(\"hover, traverse, unexpected node type\");\r\n }\r\n for (const child of node.getChildren()) {\r\n const ret = this.traverse(child, local, search);\r\n if (ret) {\r\n return ret;\r\n }\r\n }\r\n return undefined;\r\n }\r\n static fileInformation(file) {\r\n let content = \"\";\r\n content = content + `<hr><h3 id=\"_tokens\">Tokens</h3>\\n`;\r\n content = content + this.tokens(file);\r\n content = content + `<hr><h3 id=\"_statements\">Statements</h3>\\n`;\r\n content = content + this.buildStatements(file);\r\n content = content + `<hr><h3 id=\"_structure\">Structure</h3>\\n`;\r\n const structure = file.getStructure();\r\n if (structure !== undefined) {\r\n content = content + this.buildStructure([structure]);\r\n }\r\n else {\r\n content = content + \"structure undefined\";\r\n }\r\n return content;\r\n }\r\n static escape(str) {\r\n str = str.replace(/&/g, \"&amp;\");\r\n str = str.replace(/>/g, \"&gt;\");\r\n str = str.replace(/</g, \"&lt;\");\r\n str = str.replace(/\"/g, \"&quot;\");\r\n str = str.replace(/'/g, \"&#039;\");\r\n return str;\r\n }\r\n static linkToStatement(statement) {\r\n return `<a href=\"https://syntax.abaplint.org/#/statement/${statement.constructor.name}\" target=\"_blank\">${statement.constructor.name}</a>\\n`;\r\n }\r\n static linkToStructure(structure) {\r\n return `<a href=\"https://syntax.abaplint.org/#/structure/${structure.constructor.name}\" target=\"_blank\">${structure.constructor.name}</a>\\n`;\r\n }\r\n static linkToExpression(expression) {\r\n return `<a href=\"https://syntax.abaplint.org/#/expression/${expression.constructor.name}\" target=\"_blank\">${expression.constructor.name}</a>\\n`;\r\n }\r\n static outputNodes(nodes) {\r\n let ret = \"<ul>\";\r\n for (const node of nodes) {\r\n let extra = \"\";\r\n switch (node.constructor.name) {\r\n case \"TokenNode\":\r\n case \"TokenNodeRegex\":\r\n extra = node.get().constructor.name + \", \\\"\" + node.get().getStr() + \"\\\"\";\r\n break;\r\n case \"ExpressionNode\":\r\n extra = this.linkToExpression(node.get()) + this.outputNodes(node.getChildren());\r\n break;\r\n default:\r\n break;\r\n }\r\n ret = ret + \"<li>\" + node.constructor.name + \", \" + extra + \"</li>\";\r\n }\r\n return ret + \"</ul>\";\r\n }\r\n static tokens(file) {\r\n let inner = \"<table><tr><td><b>String</b></td><td><b>Type</b></td><td><b>Row</b></td><td><b>Column</b></td></tr>\";\r\n for (const token of file.getTokens()) {\r\n inner = inner + \"<tr><td><tt>\" +\r\n this.escape(token.getStr()) + \"</tt></td><td>\" +\r\n token.constructor.name + \"</td><td align=\\\"right\\\">\" +\r\n token.getRow() + \"</td><td align=\\\"right\\\">\" +\r\n token.getCol() + \"</td></tr>\";\r\n }\r\n inner = inner + \"</table>\";\r\n return inner;\r\n }\r\n static buildStatements(file) {\r\n let output = \"\";\r\n for (const statement of file.getStatements()) {\r\n const row = statement.getStart().getRow();\r\n // getting the class name only works if uglify does not mangle names\r\n output = output +\r\n row + \": \" +\r\n this.linkToStatement(statement.get()) +\r\n \"</div></b>\\n\" + this.outputNodes(statement.getChildren());\r\n }\r\n return output;\r\n }\r\n static buildStructure(nodes) {\r\n let output = \"<ul>\";\r\n for (const node of nodes) {\r\n if (node instanceof nodes_1.StructureNode) {\r\n output = output + \"<li>\" + this.linkToStructure(node.get()) + \", Structure \" + this.buildStructure(node.getChildren()) + \"</li>\";\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n output = output + \"<li>\" + this.linkToStatement(node.get()) + \", Statement</li>\";\r\n }\r\n }\r\n return output + \"</ul>\";\r\n }\r\n static dumpFiles(reg) {\r\n let output = `<h3 id=\"_files\">Files</h3><table>\\n`;\r\n for (const o of reg.getObjects()) {\r\n if (reg.isDependency(o) === true) {\r\n continue;\r\n }\r\n output = output + \"<tr><td valign=\\\"top\\\">\" + o.getType() + \" \" + o.getName() + \"</td><td>\";\r\n for (const f of o.getFiles()) {\r\n output = output + f.getFilename() + \"<br>\";\r\n }\r\n output = output + \"</td></tr>\\n\";\r\n }\r\n return output + \"</table>\\n\";\r\n }\r\n}\r\nexports.Help = Help;\r\n//# sourceMappingURL=help.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/lsp/help.js?");
9887
9887
 
9888
9888
  /***/ }),
9889
9889
 
@@ -11302,7 +11302,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11302
11302
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11303
11303
 
11304
11304
  "use strict";
11305
- eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\nconst skip_logic_1 = __webpack_require__(/*! ./skip_logic */ \"./node_modules/@abaplint/core/build/src/skip_logic.js\");\nconst _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst syntax_1 = __webpack_require__(/*! ./abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n /** object containing filenames of dependencies */\n this.dependencies = {};\n this.issues = [];\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.91.9\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n const globalNoIssues = this.conf.getGlobal().noIssues || [];\n const globalNoIssuesPatterns = globalNoIssues.map(x => new RegExp(x, \"i\"));\n if (globalNoIssuesPatterns.length > 0) {\n for (let i = ret.length - 1; i >= 0; i--) {\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, globalNoIssuesPatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = (_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : [];\n if (ruleExclude.length === 0) {\n continue;\n }\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
11305
+ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\nconst skip_logic_1 = __webpack_require__(/*! ./skip_logic */ \"./node_modules/@abaplint/core/build/src/skip_logic.js\");\nconst _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst syntax_1 = __webpack_require__(/*! ./abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n /** object containing filenames of dependencies */\n this.dependencies = {};\n this.issues = [];\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.91.10\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n const globalNoIssues = this.conf.getGlobal().noIssues || [];\n const globalNoIssuesPatterns = globalNoIssues.map(x => new RegExp(x, \"i\"));\n if (globalNoIssuesPatterns.length > 0) {\n for (let i = ret.length - 1; i >= 0; i--) {\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, globalNoIssuesPatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = (_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : [];\n if (ruleExclude.length === 0) {\n continue;\n }\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
11306
11306
 
11307
11307
  /***/ }),
11308
11308
 
@@ -11313,7 +11313,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
11313
11313
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11314
11314
 
11315
11315
  "use strict";
11316
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SevenBitAscii = exports.SevenBitAsciiConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass SevenBitAsciiConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SevenBitAsciiConf = SevenBitAsciiConf;\r\nclass SevenBitAscii {\r\n constructor() {\r\n this.conf = new SevenBitAsciiConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"7bit_ascii\",\r\n title: \"Check for 7bit ascii\",\r\n shortDescription: `Only allow characters from the 7bit ASCII set.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/05/\n\nCheckes files with extension \".abap\" and \".asddls\"`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const output = [];\r\n for (const file of obj.getFiles()) {\r\n const filename = file.getFilename();\r\n if (filename.endsWith(\".abap\") || filename.endsWith(\".asddls\")) {\r\n const rows = file.getRawRows();\r\n for (let i = 0; i < rows.length; i++) {\r\n const found = /[\\u007f-\\uffff]/.exec(rows[i]);\r\n if (found !== null) {\r\n const column = found.index + 1;\r\n const start = new position_1.Position(i + 1, column);\r\n const end = new position_1.Position(i + 1, column + 1);\r\n const message = \"Contains non 7 bit ascii character\";\r\n const issue = issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n // method getRawRows() splits by newline, so the carraige return\r\n // should always be last character if present\r\n const carriage = /\\r.+$/.exec(rows[i]);\r\n if (carriage !== null) {\r\n const column = carriage.index + 1;\r\n const start = new position_1.Position(i + 1, column);\r\n const end = new position_1.Position(i + 1, column + 1);\r\n const message = \"Dangling carriage return\";\r\n const issue = issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.SevenBitAscii = SevenBitAscii;\r\n//# sourceMappingURL=7bit_ascii.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/7bit_ascii.js?");
11316
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SevenBitAscii = exports.SevenBitAsciiConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass SevenBitAsciiConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SevenBitAsciiConf = SevenBitAsciiConf;\r\nclass SevenBitAscii {\r\n constructor() {\r\n this.conf = new SevenBitAsciiConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"7bit_ascii\",\r\n title: \"Check for 7bit ascii\",\r\n shortDescription: `Only allow characters from the 7bit ASCII set.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/05/\r\n\r\nCheckes files with extension \".abap\" and \".asddls\"`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const output = [];\r\n for (const file of obj.getFiles()) {\r\n const filename = file.getFilename();\r\n if (filename.endsWith(\".abap\") || filename.endsWith(\".asddls\")) {\r\n const rows = file.getRawRows();\r\n for (let i = 0; i < rows.length; i++) {\r\n const found = /[\\u007f-\\uffff]/.exec(rows[i]);\r\n if (found !== null) {\r\n const column = found.index + 1;\r\n const start = new position_1.Position(i + 1, column);\r\n const end = new position_1.Position(i + 1, column + 1);\r\n const message = \"Contains non 7 bit ascii character\";\r\n const issue = issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n // method getRawRows() splits by newline, so the carraige return\r\n // should always be last character if present\r\n const carriage = /\\r.+$/.exec(rows[i]);\r\n if (carriage !== null) {\r\n const column = carriage.index + 1;\r\n const start = new position_1.Position(i + 1, column);\r\n const end = new position_1.Position(i + 1, column + 1);\r\n const message = \"Dangling carriage return\";\r\n const issue = issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.SevenBitAscii = SevenBitAscii;\r\n//# sourceMappingURL=7bit_ascii.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/7bit_ascii.js?");
11317
11317
 
11318
11318
  /***/ }),
11319
11319
 
@@ -11368,7 +11368,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11368
11368
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11369
11369
 
11370
11370
  "use strict";
11371
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Abapdoc = exports.AbapdocConf = void 0;\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass AbapdocConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Check local classes and interfaces for abapdoc. */\r\n this.checkLocal = false;\r\n }\r\n}\r\nexports.AbapdocConf = AbapdocConf;\r\nclass Abapdoc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AbapdocConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"abapdoc\",\r\n title: \"Check abapdoc\",\r\n shortDescription: `Various checks regarding abapdoc.\nBase rule checks for existence of abapdoc for public class methods and all interface methods.`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const rows = file.getRawRows();\r\n let methods = [];\r\n for (const classDef of file.getInfo().listClassDefinitions()) {\r\n if (this.conf.checkLocal === false && classDef.isLocal === true) {\r\n continue;\r\n }\r\n methods = methods.concat(classDef.methods.filter(m => m.visibility === visibility_1.Visibility.Public));\r\n }\r\n for (const interfaceDef of file.getInfo().listInterfaceDefinitions()) {\r\n if (this.conf.checkLocal === false && interfaceDef.isLocal === true) {\r\n continue;\r\n }\r\n methods = methods.concat(interfaceDef.methods);\r\n }\r\n for (const method of methods) {\r\n if (method.isRedefinition === true) {\r\n continue;\r\n }\r\n const previousRow = method.identifier.getStart().getRow() - 2;\r\n if (!(rows[previousRow].trim().substring(0, 2) === \"\\\"!\")) {\r\n const message = \"Missing ABAP Doc for method \" + method.identifier.getToken().getStr();\r\n const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Abapdoc = Abapdoc;\r\n//# sourceMappingURL=abapdoc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/abapdoc.js?");
11371
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Abapdoc = exports.AbapdocConf = void 0;\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass AbapdocConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Check local classes and interfaces for abapdoc. */\r\n this.checkLocal = false;\r\n }\r\n}\r\nexports.AbapdocConf = AbapdocConf;\r\nclass Abapdoc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AbapdocConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"abapdoc\",\r\n title: \"Check abapdoc\",\r\n shortDescription: `Various checks regarding abapdoc.\r\nBase rule checks for existence of abapdoc for public class methods and all interface methods.`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const rows = file.getRawRows();\r\n let methods = [];\r\n for (const classDef of file.getInfo().listClassDefinitions()) {\r\n if (this.conf.checkLocal === false && classDef.isLocal === true) {\r\n continue;\r\n }\r\n methods = methods.concat(classDef.methods.filter(m => m.visibility === visibility_1.Visibility.Public));\r\n }\r\n for (const interfaceDef of file.getInfo().listInterfaceDefinitions()) {\r\n if (this.conf.checkLocal === false && interfaceDef.isLocal === true) {\r\n continue;\r\n }\r\n methods = methods.concat(interfaceDef.methods);\r\n }\r\n for (const method of methods) {\r\n if (method.isRedefinition === true) {\r\n continue;\r\n }\r\n const previousRow = method.identifier.getStart().getRow() - 2;\r\n if (!(rows[previousRow].trim().substring(0, 2) === \"\\\"!\")) {\r\n const message = \"Missing ABAP Doc for method \" + method.identifier.getToken().getStr();\r\n const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Abapdoc = Abapdoc;\r\n//# sourceMappingURL=abapdoc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/abapdoc.js?");
11372
11372
 
11373
11373
  /***/ }),
11374
11374
 
@@ -11379,7 +11379,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11379
11379
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11380
11380
 
11381
11381
  "use strict";
11382
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AlignParameters = exports.AlignParametersConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass AlignParametersConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.AlignParametersConf = AlignParametersConf;\r\nclass AlignParameters extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AlignParametersConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"align_parameters\",\r\n title: \"Align Parameters\",\r\n shortDescription: `Checks for vertially aligned parameters`,\r\n extendedInformation: `Checks:\n* function module calls\n* method calls\n* VALUE constructors\n* NEW constructors\n* RAISE EXCEPTION statements\n* CREATE OBJECT statements\n* RAISE EVENT statements\n\nhttps://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters\n\nDoes not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/\n\nAlso https://rules.abaplint.org/max_one_method_parameter_per_line/ can help aligning parameter syntax`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide],\r\n badExample: `CALL FUNCTION 'FOOBAR'\n EXPORTING\n foo = 2\n parameter = 3.\n\nfoobar( moo = 1\n param = 1 ).\n\nfoo = VALUE #(\n foo = bar\n moo = 2 ).`,\r\n goodExample: `CALL FUNCTION 'FOOBAR'\n EXPORTING\n foo = 2\n parameter = 3.\n\nfoobar( moo = 1\n param = 1 ).\n\nfoo = VALUE #(\n foo = bar\n moo = 2 ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues; // parser error\r\n }\r\n const candidates = [];\r\n candidates.push(...this.functionParameterCandidates(stru));\r\n candidates.push(...this.methodCallParamCandidates(stru));\r\n candidates.push(...this.valueBodyCandidates(stru));\r\n candidates.push(...this.raiseAndCreateCandidates(stru));\r\n candidates.push(...this.newCandidates(stru));\r\n for (const c of candidates) {\r\n const i = this.checkCandidate(c, file);\r\n if (i) {\r\n issues.push(i);\r\n }\r\n }\r\n return issues;\r\n }\r\n checkCandidate(candidate, file) {\r\n if (candidate.parameters.length === 0) {\r\n return undefined;\r\n }\r\n let expectedEqualsColumn = 0;\r\n for (const p of candidate.parameters) {\r\n const currentCol = p.left.getLastToken().getCol() + p.left.getLastToken().getStr().length + 1;\r\n if (currentCol > expectedEqualsColumn) {\r\n expectedEqualsColumn = currentCol;\r\n }\r\n }\r\n for (const p of candidate.parameters) {\r\n if (p.eq.getCol() !== expectedEqualsColumn) {\r\n const message = \"Align parameters to column \" + expectedEqualsColumn;\r\n return issue_1.Issue.atPosition(file, p.eq, message, this.getMetadata().key);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newCandidates(stru) {\r\n const candidates = [];\r\n for (const vb of stru.findAllExpressionsRecursive(Expressions.NewObject)) {\r\n const parameters = [];\r\n const fieldAssignments = vb.findDirectExpressions(Expressions.FieldAssignment);\r\n if (fieldAssignments.length >= 2) {\r\n for (const fs of fieldAssignments) {\r\n const children = fs.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n continue;\r\n }\r\n }\r\n const list = vb.findDirectExpression(Expressions.ParameterListS);\r\n if (list) {\r\n for (const c of list.getChildren()) {\r\n const children = c.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n }\r\n return candidates;\r\n }\r\n valueBodyCandidates(stru) {\r\n const candidates = [];\r\n for (const vb of stru.findAllExpressionsRecursive(Expressions.ValueBody)) {\r\n const parameters = [];\r\n const fieldAssignments = vb.findDirectExpressions(Expressions.FieldAssignment);\r\n if (fieldAssignments.length <= 1) {\r\n continue;\r\n }\r\n for (const fs of fieldAssignments) {\r\n const children = fs.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n raiseAndCreateCandidates(stru) {\r\n const candidates = [];\r\n const statements = stru.findAllStatements(__1.Statements.Raise);\r\n statements.push(...stru.findAllStatements(__1.Statements.CreateObject));\r\n statements.push(...stru.findAllStatements(__1.Statements.RaiseEvent));\r\n for (const raise of statements) {\r\n const parameters = [];\r\n const param = raise.findDirectExpression(Expressions.ParameterListS);\r\n for (const p of (param === null || param === void 0 ? void 0 : param.getChildren()) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n const ex = raise.findDirectExpression(Expressions.ParameterListExceptions);\r\n for (const e of (ex === null || ex === void 0 ? void 0 : ex.getChildren()) || []) {\r\n const children = e.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n methodCallParamCandidates(stru) {\r\n var _a, _b, _c;\r\n const candidates = [];\r\n for (const mcp of stru.findAllExpressionsRecursive(Expressions.MethodCallParam)) {\r\n const parameters = [];\r\n for (const param of ((_a = mcp.findDirectExpression(Expressions.ParameterListS)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n const children = param.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n const mp = mcp.findDirectExpression(Expressions.MethodParameters);\r\n if (mp) {\r\n for (const p of ((_b = mp.findDirectExpression(Expressions.ParameterListS)) === null || _b === void 0 ? void 0 : _b.getChildren()) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const l of mp.findDirectExpressions(Expressions.ParameterListT)) {\r\n for (const p of l.findDirectExpressions(Expressions.ParameterT) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n const rec = mp.findDirectExpression(Expressions.ParameterT);\r\n if (rec) {\r\n const children = rec.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const ex of ((_c = mp.findDirectExpression(Expressions.ParameterListExceptions)) === null || _c === void 0 ? void 0 : _c.getChildren()) || []) {\r\n const children = ex.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n functionParameterCandidates(stru) {\r\n const candidates = [];\r\n for (const fp of stru.findAllExpressionsRecursive(Expressions.FunctionParameters)) {\r\n const parameters = [];\r\n for (const p of fp.findAllExpressions(Expressions.FunctionExportingParameter)) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const list of fp.findDirectExpressions(Expressions.ParameterListT)) {\r\n for (const pt of list.findDirectExpressions(Expressions.ParameterT)) {\r\n const children = pt.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n const list = fp.findDirectExpression(Expressions.ParameterListExceptions);\r\n if (list) {\r\n for (const pt of list.findDirectExpressions(Expressions.ParameterException)) {\r\n const children = pt.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n}\r\nexports.AlignParameters = AlignParameters;\r\n//# sourceMappingURL=align_parameters.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/align_parameters.js?");
11382
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AlignParameters = exports.AlignParametersConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass AlignParametersConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.AlignParametersConf = AlignParametersConf;\r\nclass AlignParameters extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AlignParametersConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"align_parameters\",\r\n title: \"Align Parameters\",\r\n shortDescription: `Checks for vertially aligned parameters`,\r\n extendedInformation: `Checks:\r\n* function module calls\r\n* method calls\r\n* VALUE constructors\r\n* NEW constructors\r\n* RAISE EXCEPTION statements\r\n* CREATE OBJECT statements\r\n* RAISE EVENT statements\r\n\r\nhttps://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters\r\n\r\nDoes not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/\r\n\r\nAlso https://rules.abaplint.org/max_one_method_parameter_per_line/ can help aligning parameter syntax`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide],\r\n badExample: `CALL FUNCTION 'FOOBAR'\r\n EXPORTING\r\n foo = 2\r\n parameter = 3.\r\n\r\nfoobar( moo = 1\r\n param = 1 ).\r\n\r\nfoo = VALUE #(\r\n foo = bar\r\n moo = 2 ).`,\r\n goodExample: `CALL FUNCTION 'FOOBAR'\r\n EXPORTING\r\n foo = 2\r\n parameter = 3.\r\n\r\nfoobar( moo = 1\r\n param = 1 ).\r\n\r\nfoo = VALUE #(\r\n foo = bar\r\n moo = 2 ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues; // parser error\r\n }\r\n const candidates = [];\r\n candidates.push(...this.functionParameterCandidates(stru));\r\n candidates.push(...this.methodCallParamCandidates(stru));\r\n candidates.push(...this.valueBodyCandidates(stru));\r\n candidates.push(...this.raiseAndCreateCandidates(stru));\r\n candidates.push(...this.newCandidates(stru));\r\n for (const c of candidates) {\r\n const i = this.checkCandidate(c, file);\r\n if (i) {\r\n issues.push(i);\r\n }\r\n }\r\n return issues;\r\n }\r\n checkCandidate(candidate, file) {\r\n if (candidate.parameters.length === 0) {\r\n return undefined;\r\n }\r\n let expectedEqualsColumn = 0;\r\n for (const p of candidate.parameters) {\r\n const currentCol = p.left.getLastToken().getCol() + p.left.getLastToken().getStr().length + 1;\r\n if (currentCol > expectedEqualsColumn) {\r\n expectedEqualsColumn = currentCol;\r\n }\r\n }\r\n for (const p of candidate.parameters) {\r\n if (p.eq.getCol() !== expectedEqualsColumn) {\r\n const message = \"Align parameters to column \" + expectedEqualsColumn;\r\n return issue_1.Issue.atPosition(file, p.eq, message, this.getMetadata().key);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newCandidates(stru) {\r\n const candidates = [];\r\n for (const vb of stru.findAllExpressionsRecursive(Expressions.NewObject)) {\r\n const parameters = [];\r\n const fieldAssignments = vb.findDirectExpressions(Expressions.FieldAssignment);\r\n if (fieldAssignments.length >= 2) {\r\n for (const fs of fieldAssignments) {\r\n const children = fs.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n continue;\r\n }\r\n }\r\n const list = vb.findDirectExpression(Expressions.ParameterListS);\r\n if (list) {\r\n for (const c of list.getChildren()) {\r\n const children = c.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n }\r\n return candidates;\r\n }\r\n valueBodyCandidates(stru) {\r\n const candidates = [];\r\n for (const vb of stru.findAllExpressionsRecursive(Expressions.ValueBody)) {\r\n const parameters = [];\r\n const fieldAssignments = vb.findDirectExpressions(Expressions.FieldAssignment);\r\n if (fieldAssignments.length <= 1) {\r\n continue;\r\n }\r\n for (const fs of fieldAssignments) {\r\n const children = fs.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n raiseAndCreateCandidates(stru) {\r\n const candidates = [];\r\n const statements = stru.findAllStatements(__1.Statements.Raise);\r\n statements.push(...stru.findAllStatements(__1.Statements.CreateObject));\r\n statements.push(...stru.findAllStatements(__1.Statements.RaiseEvent));\r\n for (const raise of statements) {\r\n const parameters = [];\r\n const param = raise.findDirectExpression(Expressions.ParameterListS);\r\n for (const p of (param === null || param === void 0 ? void 0 : param.getChildren()) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n const ex = raise.findDirectExpression(Expressions.ParameterListExceptions);\r\n for (const e of (ex === null || ex === void 0 ? void 0 : ex.getChildren()) || []) {\r\n const children = e.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n methodCallParamCandidates(stru) {\r\n var _a, _b, _c;\r\n const candidates = [];\r\n for (const mcp of stru.findAllExpressionsRecursive(Expressions.MethodCallParam)) {\r\n const parameters = [];\r\n for (const param of ((_a = mcp.findDirectExpression(Expressions.ParameterListS)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n const children = param.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n const mp = mcp.findDirectExpression(Expressions.MethodParameters);\r\n if (mp) {\r\n for (const p of ((_b = mp.findDirectExpression(Expressions.ParameterListS)) === null || _b === void 0 ? void 0 : _b.getChildren()) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const l of mp.findDirectExpressions(Expressions.ParameterListT)) {\r\n for (const p of l.findDirectExpressions(Expressions.ParameterT) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n const rec = mp.findDirectExpression(Expressions.ParameterT);\r\n if (rec) {\r\n const children = rec.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const ex of ((_c = mp.findDirectExpression(Expressions.ParameterListExceptions)) === null || _c === void 0 ? void 0 : _c.getChildren()) || []) {\r\n const children = ex.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n functionParameterCandidates(stru) {\r\n const candidates = [];\r\n for (const fp of stru.findAllExpressionsRecursive(Expressions.FunctionParameters)) {\r\n const parameters = [];\r\n for (const p of fp.findAllExpressions(Expressions.FunctionExportingParameter)) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const list of fp.findDirectExpressions(Expressions.ParameterListT)) {\r\n for (const pt of list.findDirectExpressions(Expressions.ParameterT)) {\r\n const children = pt.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n const list = fp.findDirectExpression(Expressions.ParameterListExceptions);\r\n if (list) {\r\n for (const pt of list.findDirectExpressions(Expressions.ParameterException)) {\r\n const children = pt.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n}\r\nexports.AlignParameters = AlignParameters;\r\n//# sourceMappingURL=align_parameters.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/align_parameters.js?");
11383
11383
 
11384
11384
  /***/ }),
11385
11385
 
@@ -11412,7 +11412,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11412
11412
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11413
11413
 
11414
11414
  "use strict";
11415
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AmbiguousStatement = exports.AmbiguousStatementConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst combi_1 = __webpack_require__(/*! ../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass AmbiguousStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.AmbiguousStatementConf = AmbiguousStatementConf;\r\nclass AmbiguousStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AmbiguousStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"ambiguous_statement\",\r\n title: \"Check for ambigious statements\",\r\n shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table\nAdd \"TABLE\" keyword or \"@\" for escaping SQL variables\n\nOnly works if the target version is 740sp05 or above`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `DELETE foo FROM bar.\nMODIFY foo FROM bar.`,\r\n goodExample: `DELETE foo FROM @bar.\nMODIFY TABLE foo FROM bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Ambiguous statement. Use explicit syntax.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp05) {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n let match = false;\r\n if (statement.get() instanceof Statements.DeleteDatabase) {\r\n match = this.tryMatch(statement, this.reg, Statements.DeleteInternal);\r\n }\r\n else if (statement.get() instanceof Statements.DeleteInternal) {\r\n match = this.tryMatch(statement, this.reg, Statements.DeleteDatabase);\r\n }\r\n else if (statement.get() instanceof Statements.ModifyInternal) {\r\n match = this.tryMatch(statement, this.reg, Statements.ModifyDatabase);\r\n }\r\n else if (statement.get() instanceof Statements.ModifyDatabase) {\r\n match = this.tryMatch(statement, this.reg, Statements.ModifyInternal);\r\n }\r\n if (match) {\r\n const issue = issue_1.Issue.atStatement(file, statement, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n tryMatch(st, reg, type1) {\r\n const ver = reg.getConfig().getVersion();\r\n const tokens = st.getTokens().slice(0);\r\n tokens.pop();\r\n const match = combi_1.Combi.run(new type1().getMatcher(), tokens, ver);\r\n return match !== undefined;\r\n }\r\n}\r\nexports.AmbiguousStatement = AmbiguousStatement;\r\n//# sourceMappingURL=ambiguous_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/ambiguous_statement.js?");
11415
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AmbiguousStatement = exports.AmbiguousStatementConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst combi_1 = __webpack_require__(/*! ../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass AmbiguousStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.AmbiguousStatementConf = AmbiguousStatementConf;\r\nclass AmbiguousStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AmbiguousStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"ambiguous_statement\",\r\n title: \"Check for ambigious statements\",\r\n shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table\r\nAdd \"TABLE\" keyword or \"@\" for escaping SQL variables\r\n\r\nOnly works if the target version is 740sp05 or above`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `DELETE foo FROM bar.\r\nMODIFY foo FROM bar.`,\r\n goodExample: `DELETE foo FROM @bar.\r\nMODIFY TABLE foo FROM bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Ambiguous statement. Use explicit syntax.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp05) {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n let match = false;\r\n if (statement.get() instanceof Statements.DeleteDatabase) {\r\n match = this.tryMatch(statement, this.reg, Statements.DeleteInternal);\r\n }\r\n else if (statement.get() instanceof Statements.DeleteInternal) {\r\n match = this.tryMatch(statement, this.reg, Statements.DeleteDatabase);\r\n }\r\n else if (statement.get() instanceof Statements.ModifyInternal) {\r\n match = this.tryMatch(statement, this.reg, Statements.ModifyDatabase);\r\n }\r\n else if (statement.get() instanceof Statements.ModifyDatabase) {\r\n match = this.tryMatch(statement, this.reg, Statements.ModifyInternal);\r\n }\r\n if (match) {\r\n const issue = issue_1.Issue.atStatement(file, statement, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n tryMatch(st, reg, type1) {\r\n const ver = reg.getConfig().getVersion();\r\n const tokens = st.getTokens().slice(0);\r\n tokens.pop();\r\n const match = combi_1.Combi.run(new type1().getMatcher(), tokens, ver);\r\n return match !== undefined;\r\n }\r\n}\r\nexports.AmbiguousStatement = AmbiguousStatement;\r\n//# sourceMappingURL=ambiguous_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/ambiguous_statement.js?");
11416
11416
 
11417
11417
  /***/ }),
11418
11418
 
@@ -11423,7 +11423,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11423
11423
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11424
11424
 
11425
11425
  "use strict";
11426
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AvoidUse = exports.AvoidUseConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects DEFINE (macro definitions) */\r\n this.define = true;\r\n /** Detects statics */\r\n this.statics = true;\r\n /** Detects DEFAULT KEY definitions, from version v740sp02 and up */\r\n this.defaultKey = true;\r\n /** Detects BREAK and BREAK-POINTS */\r\n this.break = true;\r\n /** Detects TEST SEAMS */\r\n this.testSeams = true;\r\n /** Detects DESCRIBE TABLE LINES, use lines() instead */\r\n this.describeLines = true;\r\n }\r\n}\r\nexports.AvoidUseConf = AvoidUseConf;\r\nclass AvoidUse extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AvoidUseConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"avoid_use\",\r\n title: \"Avoid use of certain statements\",\r\n shortDescription: `Detects usage of certain statements.`,\r\n extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key\n\nMacros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm\n\nSTATICS: use CLASS-DATA instead\n\nDESCRIBE TABLE LINES: use lines() instead (quickfix exists)\n\nTEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(statement) {\r\n return \"Avoid use of \" + statement;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n let isStaticsBlock = false;\r\n for (const statementNode of file.getStatements()) {\r\n const statement = statementNode.get();\r\n let message = undefined;\r\n let fix = undefined;\r\n if (this.conf.define && statement instanceof Statements.Define) {\r\n message = \"DEFINE\";\r\n }\r\n else if (this.conf.describeLines && statement instanceof Statements.Describe) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 6 && children[3].getFirstToken().getStr().toUpperCase() === \"LINES\") {\r\n message = \"DESCRIBE LINES, use lines() instead\";\r\n fix = this.getDescribeLinesFix(file, statementNode);\r\n }\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticBegin) {\r\n isStaticsBlock = true;\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticEnd) {\r\n isStaticsBlock = false;\r\n }\r\n else if (this.conf.testSeams && statement instanceof Statements.TestSeam) {\r\n message = \"TEST-SEAM\";\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.Static && isStaticsBlock === false) {\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.break && statement instanceof Statements.Break) {\r\n message = \"BREAK/BREAK-POINT\";\r\n fix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n }\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n if (this.conf.defaultKey\r\n && (this.reg.getConfig().getVersion() >= version_1.Version.v740sp02\r\n || this.reg.getConfig().getVersion() === version_1.Version.Cloud)\r\n && (statement instanceof Statements.Data || statement instanceof Statements.Type)) {\r\n const tt = (_a = statementNode.findFirstExpression(expressions_1.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.TypeTableKey);\r\n const token = tt === null || tt === void 0 ? void 0 : tt.findDirectTokenByText(\"DEFAULT\");\r\n if (tt && token) {\r\n message = \"DEFAULT KEY\";\r\n issues.push(issue_1.Issue.atToken(file, token, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getDescribeLinesFix(file, statementNode) {\r\n const children = statementNode.getChildren();\r\n const target = children[4].concatTokens();\r\n const source = children[2].concatTokens();\r\n const startPosition = children[0].getFirstToken().getStart();\r\n const insertText = target + \" = lines( \" + source + \" ).\";\r\n const deleteFix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n const insertFix = edit_helper_1.EditHelper.insertAt(file, startPosition, insertText);\r\n const finalFix = edit_helper_1.EditHelper.merge(deleteFix, insertFix);\r\n return finalFix;\r\n }\r\n}\r\nexports.AvoidUse = AvoidUse;\r\n//# sourceMappingURL=avoid_use.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/avoid_use.js?");
11426
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AvoidUse = exports.AvoidUseConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects DEFINE (macro definitions) */\r\n this.define = true;\r\n /** Detects statics */\r\n this.statics = true;\r\n /** Detects DEFAULT KEY definitions, from version v740sp02 and up */\r\n this.defaultKey = true;\r\n /** Detects BREAK and BREAK-POINTS */\r\n this.break = true;\r\n /** Detects TEST SEAMS */\r\n this.testSeams = true;\r\n /** Detects DESCRIBE TABLE LINES, use lines() instead */\r\n this.describeLines = true;\r\n }\r\n}\r\nexports.AvoidUseConf = AvoidUseConf;\r\nclass AvoidUse extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AvoidUseConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"avoid_use\",\r\n title: \"Avoid use of certain statements\",\r\n shortDescription: `Detects usage of certain statements.`,\r\n extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key\r\n\r\nMacros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm\r\n\r\nSTATICS: use CLASS-DATA instead\r\n\r\nDESCRIBE TABLE LINES: use lines() instead (quickfix exists)\r\n\r\nTEST-SEAMS: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-test-seams-as-temporary-workaround`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(statement) {\r\n return \"Avoid use of \" + statement;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n let isStaticsBlock = false;\r\n for (const statementNode of file.getStatements()) {\r\n const statement = statementNode.get();\r\n let message = undefined;\r\n let fix = undefined;\r\n if (this.conf.define && statement instanceof Statements.Define) {\r\n message = \"DEFINE\";\r\n }\r\n else if (this.conf.describeLines && statement instanceof Statements.Describe) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 6 && children[3].getFirstToken().getStr().toUpperCase() === \"LINES\") {\r\n message = \"DESCRIBE LINES, use lines() instead\";\r\n fix = this.getDescribeLinesFix(file, statementNode);\r\n }\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticBegin) {\r\n isStaticsBlock = true;\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticEnd) {\r\n isStaticsBlock = false;\r\n }\r\n else if (this.conf.testSeams && statement instanceof Statements.TestSeam) {\r\n message = \"TEST-SEAM\";\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.Static && isStaticsBlock === false) {\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.break && statement instanceof Statements.Break) {\r\n message = \"BREAK/BREAK-POINT\";\r\n fix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n }\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n if (this.conf.defaultKey\r\n && (this.reg.getConfig().getVersion() >= version_1.Version.v740sp02\r\n || this.reg.getConfig().getVersion() === version_1.Version.Cloud)\r\n && (statement instanceof Statements.Data || statement instanceof Statements.Type)) {\r\n const tt = (_a = statementNode.findFirstExpression(expressions_1.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.TypeTableKey);\r\n const token = tt === null || tt === void 0 ? void 0 : tt.findDirectTokenByText(\"DEFAULT\");\r\n if (tt && token) {\r\n message = \"DEFAULT KEY\";\r\n issues.push(issue_1.Issue.atToken(file, token, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getDescribeLinesFix(file, statementNode) {\r\n const children = statementNode.getChildren();\r\n const target = children[4].concatTokens();\r\n const source = children[2].concatTokens();\r\n const startPosition = children[0].getFirstToken().getStart();\r\n const insertText = target + \" = lines( \" + source + \" ).\";\r\n const deleteFix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n const insertFix = edit_helper_1.EditHelper.insertAt(file, startPosition, insertText);\r\n const finalFix = edit_helper_1.EditHelper.merge(deleteFix, insertFix);\r\n return finalFix;\r\n }\r\n}\r\nexports.AvoidUse = AvoidUse;\r\n//# sourceMappingURL=avoid_use.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/avoid_use.js?");
11427
11427
 
11428
11428
  /***/ }),
11429
11429
 
@@ -11434,7 +11434,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11434
11434
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11435
11435
 
11436
11436
  "use strict";
11437
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BeginEndNames = exports.BeginEndNamesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass BeginEndNamesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.BeginEndNamesConf = BeginEndNamesConf;\r\nclass BeginEndNames extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new BeginEndNamesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"begin_end_names\",\r\n title: \"Check BEGIN END names\",\r\n shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA: BEGIN OF stru,\n field TYPE i,\n END OF structure_not_the_same.`,\r\n goodExample: `DATA: BEGIN OF stru,\n field TYPE i,\n END OF stru.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return [];\r\n }\r\n output.push(...this.test(struc, Structures.Data, Statements.DataBegin, Statements.DataEnd, file));\r\n output.push(...this.test(struc, Structures.ClassData, Statements.ClassDataBegin, Statements.ClassDataEnd, file));\r\n output.push(...this.test(struc, Structures.Constants, Statements.ConstantBegin, Statements.ConstantEnd, file));\r\n output.push(...this.test(struc, Structures.Statics, Statements.StaticBegin, Statements.StaticEnd, file));\r\n output.push(...this.test(struc, Structures.TypeEnum, Statements.TypeEnumBegin, Statements.TypeEnumEnd, file));\r\n output.push(...this.test(struc, Structures.Types, Statements.TypeBegin, Statements.TypeEnd, file));\r\n return output;\r\n }\r\n test(stru, type, b, e, file) {\r\n const output = [];\r\n for (const sub of stru.findAllStructuresRecursive(type)) {\r\n let begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (begin === undefined) {\r\n begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (begin === undefined) {\r\n continue;\r\n }\r\n const first = begin.getFirstToken();\r\n let end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (end === undefined) {\r\n end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (end === undefined) {\r\n continue;\r\n }\r\n const last = end.getFirstToken();\r\n if (first.getStr().toUpperCase() !== last.getStr().toUpperCase()) {\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, last.getStart(), last.getEnd(), first.getStr());\r\n const message = \"BEGIN END names must match\";\r\n const issue = issue_1.Issue.atToken(file, first, message, this.getMetadata().key, this.conf.severity, fix);\r\n output.push(issue);\r\n }\r\n if (sub.getChildren().length === 2) {\r\n const message = \"There must be statements between BEGIN and END\";\r\n const issue = issue_1.Issue.atToken(file, first, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.BeginEndNames = BeginEndNames;\r\n//# sourceMappingURL=begin_end_names.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/begin_end_names.js?");
11437
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BeginEndNames = exports.BeginEndNamesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass BeginEndNamesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.BeginEndNamesConf = BeginEndNamesConf;\r\nclass BeginEndNames extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new BeginEndNamesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"begin_end_names\",\r\n title: \"Check BEGIN END names\",\r\n shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA: BEGIN OF stru,\r\n field TYPE i,\r\n END OF structure_not_the_same.`,\r\n goodExample: `DATA: BEGIN OF stru,\r\n field TYPE i,\r\n END OF stru.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return [];\r\n }\r\n output.push(...this.test(struc, Structures.Data, Statements.DataBegin, Statements.DataEnd, file));\r\n output.push(...this.test(struc, Structures.ClassData, Statements.ClassDataBegin, Statements.ClassDataEnd, file));\r\n output.push(...this.test(struc, Structures.Constants, Statements.ConstantBegin, Statements.ConstantEnd, file));\r\n output.push(...this.test(struc, Structures.Statics, Statements.StaticBegin, Statements.StaticEnd, file));\r\n output.push(...this.test(struc, Structures.TypeEnum, Statements.TypeEnumBegin, Statements.TypeEnumEnd, file));\r\n output.push(...this.test(struc, Structures.Types, Statements.TypeBegin, Statements.TypeEnd, file));\r\n return output;\r\n }\r\n test(stru, type, b, e, file) {\r\n const output = [];\r\n for (const sub of stru.findAllStructuresRecursive(type)) {\r\n let begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (begin === undefined) {\r\n begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (begin === undefined) {\r\n continue;\r\n }\r\n const first = begin.getFirstToken();\r\n let end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (end === undefined) {\r\n end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (end === undefined) {\r\n continue;\r\n }\r\n const last = end.getFirstToken();\r\n if (first.getStr().toUpperCase() !== last.getStr().toUpperCase()) {\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, last.getStart(), last.getEnd(), first.getStr());\r\n const message = \"BEGIN END names must match\";\r\n const issue = issue_1.Issue.atToken(file, first, message, this.getMetadata().key, this.conf.severity, fix);\r\n output.push(issue);\r\n }\r\n if (sub.getChildren().length === 2) {\r\n const message = \"There must be statements between BEGIN and END\";\r\n const issue = issue_1.Issue.atToken(file, first, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.BeginEndNames = BeginEndNames;\r\n//# sourceMappingURL=begin_end_names.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/begin_end_names.js?");
11438
11438
 
11439
11439
  /***/ }),
11440
11440
 
@@ -11445,7 +11445,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11445
11445
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11446
11446
 
11447
11447
  "use strict";
11448
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BeginSingleInclude = exports.BeginSingleIncludeConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass BeginSingleIncludeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.BeginSingleIncludeConf = BeginSingleIncludeConf;\r\nclass BeginSingleInclude extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new BeginSingleIncludeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"begin_single_include\",\r\n title: \"BEGIN contains single INCLUDE\",\r\n shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `TYPES: BEGIN OF dummy1.\n INCLUDE TYPE dselc.\nTYPES: END OF dummy1.\n\nDATA BEGIN OF foo.\nINCLUDE STRUCTURE syst.\nDATA END OF foo.\n\nSTATICS BEGIN OF bar.\nINCLUDE STRUCTURE syst.\nSTATICS END OF bar.`,\r\n goodExample: `DATA BEGIN OF foo.\nINCLUDE STRUCTURE dselc.\nDATA END OF foo.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const t of stru.findAllStructures(Structures.Types)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"TYPE BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const t of stru.findAllStructures(Structures.Data)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"DATA BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const t of stru.findAllStructures(Structures.Statics)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"STATICS BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.BeginSingleInclude = BeginSingleInclude;\r\n//# sourceMappingURL=begin_single_include.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/begin_single_include.js?");
11448
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BeginSingleInclude = exports.BeginSingleIncludeConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass BeginSingleIncludeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.BeginSingleIncludeConf = BeginSingleIncludeConf;\r\nclass BeginSingleInclude extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new BeginSingleIncludeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"begin_single_include\",\r\n title: \"BEGIN contains single INCLUDE\",\r\n shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `TYPES: BEGIN OF dummy1.\r\n INCLUDE TYPE dselc.\r\nTYPES: END OF dummy1.\r\n\r\nDATA BEGIN OF foo.\r\nINCLUDE STRUCTURE syst.\r\nDATA END OF foo.\r\n\r\nSTATICS BEGIN OF bar.\r\nINCLUDE STRUCTURE syst.\r\nSTATICS END OF bar.`,\r\n goodExample: `DATA BEGIN OF foo.\r\nINCLUDE STRUCTURE dselc.\r\nDATA END OF foo.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const t of stru.findAllStructures(Structures.Types)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"TYPE BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const t of stru.findAllStructures(Structures.Data)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"DATA BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const t of stru.findAllStructures(Structures.Statics)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"STATICS BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.BeginSingleInclude = BeginSingleInclude;\r\n//# sourceMappingURL=begin_single_include.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/begin_single_include.js?");
11449
11449
 
11450
11450
  /***/ }),
11451
11451
 
@@ -11456,7 +11456,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11456
11456
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11457
11457
 
11458
11458
  "use strict";
11459
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallTransactionAuthorityCheck = exports.CallTransactionAuthorityCheckConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass CallTransactionAuthorityCheckConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CallTransactionAuthorityCheckConf = CallTransactionAuthorityCheckConf;\r\nclass CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CallTransactionAuthorityCheckConf();\r\n this.MINIMUM_VERSION = version_1.Version.v740sp02;\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"call_transaction_authority_check\",\r\n title: \"Call Transaction Authority-Check\",\r\n shortDescription: `Checks that usages of CALL TRANSACTION contain an authority-check.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],\r\n badExample: `CALL TRANSACTION 'FOO'.`,\r\n goodExample: `TRY.\n CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.\n CATCH cx_sy_authorization_error.\nENDTRY.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Add an authority check to CALL TRANSACTION\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const currentVersion = this.reg.getConfig().getVersion();\r\n // Cloud version does not support CALL TRANSACTION\r\n if (currentVersion < this.MINIMUM_VERSION || currentVersion === version_1.Version.Cloud) {\r\n return [];\r\n }\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const statNode of file.getStatements()) {\r\n const statement = statNode.get();\r\n if (statement instanceof Statements.CallTransaction && !statNode.concatTokensWithoutStringsAndComments().toUpperCase().includes(\"WITH AUTHORITY-CHECK\")) {\r\n issues.push(issue_1.Issue.atStatement(file, statNode, this.getMessage(), this.getMetadata().key));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CallTransactionAuthorityCheck = CallTransactionAuthorityCheck;\r\n//# sourceMappingURL=call_transaction_authority_check.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/call_transaction_authority_check.js?");
11459
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallTransactionAuthorityCheck = exports.CallTransactionAuthorityCheckConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass CallTransactionAuthorityCheckConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CallTransactionAuthorityCheckConf = CallTransactionAuthorityCheckConf;\r\nclass CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CallTransactionAuthorityCheckConf();\r\n this.MINIMUM_VERSION = version_1.Version.v740sp02;\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"call_transaction_authority_check\",\r\n title: \"Call Transaction Authority-Check\",\r\n shortDescription: `Checks that usages of CALL TRANSACTION contain an authority-check.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],\r\n badExample: `CALL TRANSACTION 'FOO'.`,\r\n goodExample: `TRY.\r\n CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.\r\n CATCH cx_sy_authorization_error.\r\nENDTRY.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Add an authority check to CALL TRANSACTION\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const currentVersion = this.reg.getConfig().getVersion();\r\n // Cloud version does not support CALL TRANSACTION\r\n if (currentVersion < this.MINIMUM_VERSION || currentVersion === version_1.Version.Cloud) {\r\n return [];\r\n }\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const statNode of file.getStatements()) {\r\n const statement = statNode.get();\r\n if (statement instanceof Statements.CallTransaction && !statNode.concatTokensWithoutStringsAndComments().toUpperCase().includes(\"WITH AUTHORITY-CHECK\")) {\r\n issues.push(issue_1.Issue.atStatement(file, statNode, this.getMessage(), this.getMetadata().key));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CallTransactionAuthorityCheck = CallTransactionAuthorityCheck;\r\n//# sourceMappingURL=call_transaction_authority_check.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/call_transaction_authority_check.js?");
11460
11460
 
11461
11461
  /***/ }),
11462
11462
 
@@ -11467,7 +11467,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11467
11467
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11468
11468
 
11469
11469
  "use strict";
11470
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSLegacyView = exports.CDSLegacyViewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nclass CDSLegacyViewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CDSLegacyViewConf = CDSLegacyViewConf;\r\nclass CDSLegacyView {\r\n constructor() {\r\n this.conf = new CDSLegacyViewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"cds_legacy_view\",\r\n title: \"CDS Legacy View\",\r\n shortDescription: `Identify CDS Legacy Views`,\r\n // eslint-disable-next-line max-len\r\n extendedInformation: `https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/\n\nv755 and up`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(o) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v755\r\n && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n if (o.getType() !== \"DDLS\") {\r\n return [];\r\n }\r\n if (o instanceof objects_1.DataDefinition) {\r\n const tree = o.getTree();\r\n if (tree === undefined) {\r\n return []; // parser error\r\n }\r\n if (tree.findDirectTokenByText(\"ENTITY\") === undefined) {\r\n const file = o.findSourceFile();\r\n if (file) {\r\n issues.push(issue_1.Issue.atRow(file, 1, \"CDS Legacy View\", this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CDSLegacyView = CDSLegacyView;\r\n//# sourceMappingURL=cds_legacy_view.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/cds_legacy_view.js?");
11470
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CDSLegacyView = exports.CDSLegacyViewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nclass CDSLegacyViewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CDSLegacyViewConf = CDSLegacyViewConf;\r\nclass CDSLegacyView {\r\n constructor() {\r\n this.conf = new CDSLegacyViewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"cds_legacy_view\",\r\n title: \"CDS Legacy View\",\r\n shortDescription: `Identify CDS Legacy Views`,\r\n // eslint-disable-next-line max-len\r\n extendedInformation: `https://blogs.sap.com/2021/10/16/a-new-generation-of-cds-views-how-to-migrate-your-cds-views-to-cds-view-entities/\r\n\r\nv755 and up`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(o) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v755\r\n && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n if (o.getType() !== \"DDLS\") {\r\n return [];\r\n }\r\n if (o instanceof objects_1.DataDefinition) {\r\n const tree = o.getTree();\r\n if (tree === undefined) {\r\n return []; // parser error\r\n }\r\n if (tree.findDirectTokenByText(\"ENTITY\") === undefined) {\r\n const file = o.findSourceFile();\r\n if (file) {\r\n issues.push(issue_1.Issue.atRow(file, 1, \"CDS Legacy View\", this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CDSLegacyView = CDSLegacyView;\r\n//# sourceMappingURL=cds_legacy_view.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/cds_legacy_view.js?");
11471
11471
 
11472
11472
  /***/ }),
11473
11473
 
@@ -11489,7 +11489,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11489
11489
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11490
11490
 
11491
11491
  "use strict";
11492
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ChainMainlyDeclarations = exports.ChainMainlyDeclarationsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ChainMainlyDeclarationsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allow definition statements to be chained */\r\n this.definitions = true;\r\n /** Allow WRITE statements to be chained */\r\n this.write = true;\r\n /** Allow MOVE statements to be chained */\r\n this.move = true;\r\n /** Allow REFRESH statements to be chained */\r\n this.refresh = true;\r\n /** Allow UNASSIGN statements to be chained */\r\n this.unassign = true;\r\n /** Allow CLEAR statements to be chained */\r\n this.clear = true;\r\n /** Allow HIDE statements to be chained */\r\n this.hide = true;\r\n /** Allow FREE statements to be chained */\r\n this.free = true;\r\n /** Allow INCLUDE statements to be chained */\r\n this.include = true;\r\n /** Allow CHECK statements to be chained */\r\n this.check = true;\r\n /** Allow SORT statements to be chained */\r\n this.sort = true;\r\n }\r\n}\r\nexports.ChainMainlyDeclarationsConf = ChainMainlyDeclarationsConf;\r\nclass ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ChainMainlyDeclarationsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"chain_mainly_declarations\",\r\n title: \"Chain mainly declarations\",\r\n shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,\r\n extendedInformation: `\nhttps://docs.abapopenchecks.org/checks/23/\n\nhttps://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm\n`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n badExample: `CALL METHOD: bar.`,\r\n goodExample: `CALL METHOD bar.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n let previousRow;\r\n for (const statementNode of structure.findAllStatementNodes()) {\r\n const colon = statementNode.getColon();\r\n if (colon === undefined) {\r\n continue;\r\n }\r\n const statement = statementNode.get();\r\n if (this.conf.definitions === true\r\n && (statement instanceof Statements.ClassData\r\n || statement instanceof Statements.ClassDataBegin\r\n || statement instanceof Statements.ClassDataEnd\r\n || statement instanceof Statements.Static\r\n || statement instanceof Statements.StaticBegin\r\n || statement instanceof Statements.StaticEnd\r\n || statement instanceof Statements.Local\r\n || statement instanceof Statements.Constant\r\n || statement instanceof Statements.ConstantBegin\r\n || statement instanceof Statements.ConstantEnd\r\n || statement instanceof Statements.Controls\r\n || statement instanceof Statements.Parameter\r\n || statement instanceof Statements.SelectOption\r\n || statement instanceof Statements.SelectionScreen\r\n || statement instanceof Statements.Aliases\r\n || statement instanceof Statements.Tables\r\n || statement instanceof Statements.MethodDef\r\n || statement instanceof Statements.InterfaceDef\r\n || statement instanceof Statements.Type\r\n || statement instanceof Statements.TypeBegin\r\n || statement instanceof Statements.TypeEnd\r\n || statement instanceof Statements.TypeEnumBegin\r\n || statement instanceof Statements.TypeEnumEnd\r\n || statement instanceof Statements.TypeEnum\r\n || statement instanceof Statements.Events\r\n || statement instanceof Statements.Ranges\r\n || statement instanceof Statements.TypePools\r\n || statement instanceof Statements.FieldSymbol\r\n || statement instanceof Statements.Data\r\n || statement instanceof Statements.DataBegin\r\n || statement instanceof Statements.DataEnd)) {\r\n continue;\r\n }\r\n else if (this.conf.write === true && statement instanceof Statements.Write) {\r\n continue;\r\n }\r\n else if (this.conf.move === true && statement instanceof Statements.Move) {\r\n continue;\r\n }\r\n else if (this.conf.refresh === true && statement instanceof Statements.Refresh) {\r\n continue;\r\n }\r\n else if (this.conf.unassign === true && statement instanceof Statements.Unassign) {\r\n continue;\r\n }\r\n else if (this.conf.clear === true && statement instanceof Statements.Clear) {\r\n continue;\r\n }\r\n else if (this.conf.hide === true && statement instanceof Statements.Hide) {\r\n continue;\r\n }\r\n else if (this.conf.free === true && statement instanceof Statements.Free) {\r\n continue;\r\n }\r\n else if (this.conf.include === true && statement instanceof Statements.Include) {\r\n continue;\r\n }\r\n else if (this.conf.check === true && statement instanceof Statements.Check) {\r\n continue;\r\n }\r\n else if (this.conf.sort === true && statement instanceof Statements.Sort) {\r\n continue;\r\n }\r\n let prevFix;\r\n if (previousRow === colon.getStart().getRow()) {\r\n prevFix = (_a = issues.pop()) === null || _a === void 0 ? void 0 : _a.getFix();\r\n }\r\n const fix = this.getFix(file, statement, statementNode, prevFix);\r\n const message = \"Chain mainly declarations\";\r\n issues.push(issue_1.Issue.atToken(file, statementNode.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix));\r\n previousRow = statementNode.getColon().getStart().getRow();\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, statementNode, prevFix) {\r\n if (statement instanceof Statements.ClassDataBegin ||\r\n statement instanceof Statements.ClassDataEnd ||\r\n statement instanceof Statements.StaticBegin ||\r\n statement instanceof Statements.StaticEnd ||\r\n statement instanceof Statements.ConstantBegin ||\r\n statement instanceof Statements.ConstantEnd ||\r\n statement instanceof Statements.TypeBegin ||\r\n statement instanceof Statements.TypeEnd ||\r\n statement instanceof Statements.TypeEnumBegin ||\r\n statement instanceof Statements.TypeEnumEnd ||\r\n statement instanceof Statements.DataBegin ||\r\n statement instanceof Statements.DataEnd) {\r\n return undefined;\r\n }\r\n let replacement = statementNode.concatTokens();\r\n replacement = replacement.replace(\",\", \".\");\r\n let start;\r\n if (prevFix === undefined) {\r\n start = statementNode.getStart();\r\n }\r\n else {\r\n start = statementNode.getTokens()[1].getStart();\r\n }\r\n let fix = edit_helper_1.EditHelper.replaceRange(file, start, statementNode.getEnd(), replacement);\r\n if (prevFix !== undefined) {\r\n fix = edit_helper_1.EditHelper.merge(fix, prevFix);\r\n }\r\n return fix;\r\n }\r\n}\r\nexports.ChainMainlyDeclarations = ChainMainlyDeclarations;\r\n//# sourceMappingURL=chain_mainly_declarations.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/chain_mainly_declarations.js?");
11492
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ChainMainlyDeclarations = exports.ChainMainlyDeclarationsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ChainMainlyDeclarationsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allow definition statements to be chained */\r\n this.definitions = true;\r\n /** Allow WRITE statements to be chained */\r\n this.write = true;\r\n /** Allow MOVE statements to be chained */\r\n this.move = true;\r\n /** Allow REFRESH statements to be chained */\r\n this.refresh = true;\r\n /** Allow UNASSIGN statements to be chained */\r\n this.unassign = true;\r\n /** Allow CLEAR statements to be chained */\r\n this.clear = true;\r\n /** Allow HIDE statements to be chained */\r\n this.hide = true;\r\n /** Allow FREE statements to be chained */\r\n this.free = true;\r\n /** Allow INCLUDE statements to be chained */\r\n this.include = true;\r\n /** Allow CHECK statements to be chained */\r\n this.check = true;\r\n /** Allow SORT statements to be chained */\r\n this.sort = true;\r\n }\r\n}\r\nexports.ChainMainlyDeclarationsConf = ChainMainlyDeclarationsConf;\r\nclass ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ChainMainlyDeclarationsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"chain_mainly_declarations\",\r\n title: \"Chain mainly declarations\",\r\n shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,\r\n extendedInformation: `\r\nhttps://docs.abapopenchecks.org/checks/23/\r\n\r\nhttps://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm\r\n`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n badExample: `CALL METHOD: bar.`,\r\n goodExample: `CALL METHOD bar.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n let previousRow;\r\n for (const statementNode of structure.findAllStatementNodes()) {\r\n const colon = statementNode.getColon();\r\n if (colon === undefined) {\r\n continue;\r\n }\r\n const statement = statementNode.get();\r\n if (this.conf.definitions === true\r\n && (statement instanceof Statements.ClassData\r\n || statement instanceof Statements.ClassDataBegin\r\n || statement instanceof Statements.ClassDataEnd\r\n || statement instanceof Statements.Static\r\n || statement instanceof Statements.StaticBegin\r\n || statement instanceof Statements.StaticEnd\r\n || statement instanceof Statements.Local\r\n || statement instanceof Statements.Constant\r\n || statement instanceof Statements.ConstantBegin\r\n || statement instanceof Statements.ConstantEnd\r\n || statement instanceof Statements.Controls\r\n || statement instanceof Statements.Parameter\r\n || statement instanceof Statements.SelectOption\r\n || statement instanceof Statements.SelectionScreen\r\n || statement instanceof Statements.Aliases\r\n || statement instanceof Statements.Tables\r\n || statement instanceof Statements.MethodDef\r\n || statement instanceof Statements.InterfaceDef\r\n || statement instanceof Statements.Type\r\n || statement instanceof Statements.TypeBegin\r\n || statement instanceof Statements.TypeEnd\r\n || statement instanceof Statements.TypeEnumBegin\r\n || statement instanceof Statements.TypeEnumEnd\r\n || statement instanceof Statements.TypeEnum\r\n || statement instanceof Statements.Events\r\n || statement instanceof Statements.Ranges\r\n || statement instanceof Statements.TypePools\r\n || statement instanceof Statements.FieldSymbol\r\n || statement instanceof Statements.Data\r\n || statement instanceof Statements.DataBegin\r\n || statement instanceof Statements.DataEnd)) {\r\n continue;\r\n }\r\n else if (this.conf.write === true && statement instanceof Statements.Write) {\r\n continue;\r\n }\r\n else if (this.conf.move === true && statement instanceof Statements.Move) {\r\n continue;\r\n }\r\n else if (this.conf.refresh === true && statement instanceof Statements.Refresh) {\r\n continue;\r\n }\r\n else if (this.conf.unassign === true && statement instanceof Statements.Unassign) {\r\n continue;\r\n }\r\n else if (this.conf.clear === true && statement instanceof Statements.Clear) {\r\n continue;\r\n }\r\n else if (this.conf.hide === true && statement instanceof Statements.Hide) {\r\n continue;\r\n }\r\n else if (this.conf.free === true && statement instanceof Statements.Free) {\r\n continue;\r\n }\r\n else if (this.conf.include === true && statement instanceof Statements.Include) {\r\n continue;\r\n }\r\n else if (this.conf.check === true && statement instanceof Statements.Check) {\r\n continue;\r\n }\r\n else if (this.conf.sort === true && statement instanceof Statements.Sort) {\r\n continue;\r\n }\r\n let prevFix;\r\n if (previousRow === colon.getStart().getRow()) {\r\n prevFix = (_a = issues.pop()) === null || _a === void 0 ? void 0 : _a.getFix();\r\n }\r\n const fix = this.getFix(file, statement, statementNode, prevFix);\r\n const message = \"Chain mainly declarations\";\r\n issues.push(issue_1.Issue.atToken(file, statementNode.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix));\r\n previousRow = statementNode.getColon().getStart().getRow();\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, statementNode, prevFix) {\r\n if (statement instanceof Statements.ClassDataBegin ||\r\n statement instanceof Statements.ClassDataEnd ||\r\n statement instanceof Statements.StaticBegin ||\r\n statement instanceof Statements.StaticEnd ||\r\n statement instanceof Statements.ConstantBegin ||\r\n statement instanceof Statements.ConstantEnd ||\r\n statement instanceof Statements.TypeBegin ||\r\n statement instanceof Statements.TypeEnd ||\r\n statement instanceof Statements.TypeEnumBegin ||\r\n statement instanceof Statements.TypeEnumEnd ||\r\n statement instanceof Statements.DataBegin ||\r\n statement instanceof Statements.DataEnd) {\r\n return undefined;\r\n }\r\n let replacement = statementNode.concatTokens();\r\n replacement = replacement.replace(\",\", \".\");\r\n let start;\r\n if (prevFix === undefined) {\r\n start = statementNode.getStart();\r\n }\r\n else {\r\n start = statementNode.getTokens()[1].getStart();\r\n }\r\n let fix = edit_helper_1.EditHelper.replaceRange(file, start, statementNode.getEnd(), replacement);\r\n if (prevFix !== undefined) {\r\n fix = edit_helper_1.EditHelper.merge(fix, prevFix);\r\n }\r\n return fix;\r\n }\r\n}\r\nexports.ChainMainlyDeclarations = ChainMainlyDeclarations;\r\n//# sourceMappingURL=chain_mainly_declarations.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/chain_mainly_declarations.js?");
11493
11493
 
11494
11494
  /***/ }),
11495
11495
 
@@ -11500,7 +11500,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11500
11500
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11501
11501
 
11502
11502
  "use strict";
11503
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckAbstract = exports.CheckAbstractConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckAbstractConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CheckAbstractConf = CheckAbstractConf;\r\nvar IssueType;\r\n(function (IssueType) {\r\n /** Abstract method defined in non-abstract class */\r\n IssueType[IssueType[\"NotAbstractClass\"] = 0] = \"NotAbstractClass\";\r\n IssueType[IssueType[\"AbstractAndFinal\"] = 1] = \"AbstractAndFinal\";\r\n})(IssueType || (IssueType = {}));\r\nclass CheckAbstract extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckAbstractConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_abstract\",\r\n title: \"Check abstract methods and classes\",\r\n shortDescription: `Checks abstract methods and classes:\n- class defined as abstract and final,\n- non-abstract class contains abstract methods`,\r\n extendedInformation: `If a class defines only constants, use an interface instead`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(issueType, name) {\r\n switch (issueType) {\r\n case IssueType.AbstractAndFinal:\r\n return \"Classes should not be ABSTRACT and FINAL: \" + name;\r\n case IssueType.NotAbstractClass:\r\n return \"Abstract methods require abstract classes: \" + name;\r\n default:\r\n return \"\";\r\n }\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const classDef of file.getInfo().listClassDefinitions()) {\r\n if (classDef.isAbstract === true) {\r\n if (classDef.isFinal === true && classDef.isForTesting === false) {\r\n issues.push(issue_1.Issue.atIdentifier(classDef.identifier, this.getDescription(IssueType.AbstractAndFinal, classDef.name), this.getMetadata().key, this.conf.severity));\r\n }\r\n continue;\r\n }\r\n for (const methodDef of classDef.methods) {\r\n if (methodDef.isAbstract === true) {\r\n issues.push(issue_1.Issue.atIdentifier(methodDef.identifier, this.getDescription(IssueType.NotAbstractClass, methodDef.name), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CheckAbstract = CheckAbstract;\r\n//# sourceMappingURL=check_abstract.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_abstract.js?");
11503
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckAbstract = exports.CheckAbstractConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckAbstractConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CheckAbstractConf = CheckAbstractConf;\r\nvar IssueType;\r\n(function (IssueType) {\r\n /** Abstract method defined in non-abstract class */\r\n IssueType[IssueType[\"NotAbstractClass\"] = 0] = \"NotAbstractClass\";\r\n IssueType[IssueType[\"AbstractAndFinal\"] = 1] = \"AbstractAndFinal\";\r\n})(IssueType || (IssueType = {}));\r\nclass CheckAbstract extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckAbstractConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_abstract\",\r\n title: \"Check abstract methods and classes\",\r\n shortDescription: `Checks abstract methods and classes:\r\n- class defined as abstract and final,\r\n- non-abstract class contains abstract methods`,\r\n extendedInformation: `If a class defines only constants, use an interface instead`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(issueType, name) {\r\n switch (issueType) {\r\n case IssueType.AbstractAndFinal:\r\n return \"Classes should not be ABSTRACT and FINAL: \" + name;\r\n case IssueType.NotAbstractClass:\r\n return \"Abstract methods require abstract classes: \" + name;\r\n default:\r\n return \"\";\r\n }\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const classDef of file.getInfo().listClassDefinitions()) {\r\n if (classDef.isAbstract === true) {\r\n if (classDef.isFinal === true && classDef.isForTesting === false) {\r\n issues.push(issue_1.Issue.atIdentifier(classDef.identifier, this.getDescription(IssueType.AbstractAndFinal, classDef.name), this.getMetadata().key, this.conf.severity));\r\n }\r\n continue;\r\n }\r\n for (const methodDef of classDef.methods) {\r\n if (methodDef.isAbstract === true) {\r\n issues.push(issue_1.Issue.atIdentifier(methodDef.identifier, this.getDescription(IssueType.NotAbstractClass, methodDef.name), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CheckAbstract = CheckAbstract;\r\n//# sourceMappingURL=check_abstract.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_abstract.js?");
11504
11504
 
11505
11505
  /***/ }),
11506
11506
 
@@ -11511,7 +11511,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11511
11511
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11512
11512
 
11513
11513
  "use strict";
11514
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckComments = exports.CheckCommentsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckCommentsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allows the use of end-of-line comments. */\r\n this.allowEndOfLine = false;\r\n }\r\n}\r\nexports.CheckCommentsConf = CheckCommentsConf;\r\nvar IssueType;\r\n(function (IssueType) {\r\n IssueType[IssueType[\"EndOfLine\"] = 0] = \"EndOfLine\";\r\n})(IssueType || (IssueType = {}));\r\nclass CheckComments extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckCommentsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_comments\",\r\n title: \"Check Comments\",\r\n shortDescription: `\nVarious checks for comment usage.`,\r\n extendedInformation: `\n* End of line comments. Comments starting with \"#EC\" or \"##\" are ignored\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(issueType) {\r\n switch (issueType) {\r\n case IssueType.EndOfLine: return `Do not use end of line comments - move comment to previous row instead`;\r\n default: return \"\";\r\n }\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const rows = file.getRawRows();\r\n if (this.conf.allowEndOfLine === true) {\r\n return [];\r\n }\r\n const commentRows = [];\r\n for (let i = 0; i < rows.length; i++) {\r\n const row = rows[i];\r\n if (row.trim().startsWith(\"*\") || row.trim().startsWith(`\"`)) {\r\n commentRows.push(i);\r\n }\r\n }\r\n const statements = file.getStatements();\r\n for (let i = statements.length - 1; i >= 0; i--) {\r\n const statement = statements[i];\r\n if (statement.get() instanceof _statement_1.Comment && !commentRows.includes(statement.getStart().getRow() - 1)) {\r\n if (statement.getFirstToken().getStr().startsWith(`\"#EC`)\r\n || statement.getFirstToken().getStr().startsWith(`\"##`)) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, statement, this.getDescription(IssueType.EndOfLine), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CheckComments = CheckComments;\r\n//# sourceMappingURL=check_comments.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_comments.js?");
11514
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckComments = exports.CheckCommentsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckCommentsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allows the use of end-of-line comments. */\r\n this.allowEndOfLine = false;\r\n }\r\n}\r\nexports.CheckCommentsConf = CheckCommentsConf;\r\nvar IssueType;\r\n(function (IssueType) {\r\n IssueType[IssueType[\"EndOfLine\"] = 0] = \"EndOfLine\";\r\n})(IssueType || (IssueType = {}));\r\nclass CheckComments extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckCommentsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_comments\",\r\n title: \"Check Comments\",\r\n shortDescription: `\r\nVarious checks for comment usage.`,\r\n extendedInformation: `\r\n* End of line comments. Comments starting with \"#EC\" or \"##\" are ignored\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(issueType) {\r\n switch (issueType) {\r\n case IssueType.EndOfLine: return `Do not use end of line comments - move comment to previous row instead`;\r\n default: return \"\";\r\n }\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const rows = file.getRawRows();\r\n if (this.conf.allowEndOfLine === true) {\r\n return [];\r\n }\r\n const commentRows = [];\r\n for (let i = 0; i < rows.length; i++) {\r\n const row = rows[i];\r\n if (row.trim().startsWith(\"*\") || row.trim().startsWith(`\"`)) {\r\n commentRows.push(i);\r\n }\r\n }\r\n const statements = file.getStatements();\r\n for (let i = statements.length - 1; i >= 0; i--) {\r\n const statement = statements[i];\r\n if (statement.get() instanceof _statement_1.Comment && !commentRows.includes(statement.getStart().getRow() - 1)) {\r\n if (statement.getFirstToken().getStr().startsWith(`\"#EC`)\r\n || statement.getFirstToken().getStr().startsWith(`\"##`)) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, statement, this.getDescription(IssueType.EndOfLine), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CheckComments = CheckComments;\r\n//# sourceMappingURL=check_comments.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_comments.js?");
11515
11515
 
11516
11516
  /***/ }),
11517
11517
 
@@ -11533,7 +11533,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11533
11533
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11534
11534
 
11535
11535
  "use strict";
11536
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckInclude = exports.CheckIncludeConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckIncludeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CheckIncludeConf = CheckIncludeConf;\r\nclass CheckInclude {\r\n constructor() {\r\n this.conf = new CheckIncludeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_include\",\r\n title: \"Check INCLUDEs\",\r\n shortDescription: `Checks INCLUDE statements`,\r\n extendedInformation: `\n* Reports unused includes\n* Errors if the includes are not found\n* Error if including a main program`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n this.graph = new include_graph_1.IncludeGraph(this.reg);\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n let ret = [];\r\n for (const file of obj.getABAPFiles()) {\r\n ret = ret.concat(this.graph.getIssuesFile(file));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.CheckInclude = CheckInclude;\r\n//# sourceMappingURL=check_include.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_include.js?");
11536
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckInclude = exports.CheckIncludeConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckIncludeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CheckIncludeConf = CheckIncludeConf;\r\nclass CheckInclude {\r\n constructor() {\r\n this.conf = new CheckIncludeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_include\",\r\n title: \"Check INCLUDEs\",\r\n shortDescription: `Checks INCLUDE statements`,\r\n extendedInformation: `\r\n* Reports unused includes\r\n* Errors if the includes are not found\r\n* Error if including a main program`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n this.graph = new include_graph_1.IncludeGraph(this.reg);\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n let ret = [];\r\n for (const file of obj.getABAPFiles()) {\r\n ret = ret.concat(this.graph.getIssuesFile(file));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.CheckInclude = CheckInclude;\r\n//# sourceMappingURL=check_include.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_include.js?");
11537
11537
 
11538
11538
  /***/ }),
11539
11539
 
@@ -11544,7 +11544,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11544
11544
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11545
11545
 
11546
11546
  "use strict";
11547
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckSubrc = exports.CheckSubrcConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass CheckSubrcConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.openDataset = true;\r\n this.authorityCheck = true;\r\n this.selectSingle = true;\r\n this.selectTable = true;\r\n this.updateDatabase = true;\r\n this.insertDatabase = true;\r\n this.modifyDatabase = true;\r\n this.readTable = true;\r\n this.assign = true;\r\n this.find = true;\r\n }\r\n}\r\nexports.CheckSubrcConf = CheckSubrcConf;\r\nclass CheckSubrc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckSubrcConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_subrc\",\r\n title: \"Check sy-subrc\",\r\n shortDescription: `Check sy-subrc`,\r\n extendedInformation: `Pseudo comment \"#EC CI_SUBRC can be added to suppress findings\n\nIf sy-dbcnt is checked after database statements, it is considered okay.\n\n\"SELECT SINGLE @abap_true FROM \" is considered as an existence check\n\nIf IS ASSIGNED is checked after assigning, it is considered okay.\n\nFIND statement with MATCH COUNT is considered okay if subrc is not checked`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n pseudoComment: \"EC CI_SUBRC\",\r\n pragma: \"##SUBRC_OK\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const statements = file.getStatements();\r\n const message = \"Check sy-subrc\";\r\n const config = this.getConfig();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n // todo: CALL FUNCTION\r\n if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {\r\n continue;\r\n }\r\n if (config.openDataset === true\r\n && statement.get() instanceof Statements.OpenDataset\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.authorityCheck === true\r\n && statement.get() instanceof Statements.AuthorityCheck\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.selectSingle === true\r\n && statement.get() instanceof Statements.Select\r\n && statement.concatTokens().toUpperCase().startsWith(\"SELECT SINGLE \")\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.startsWith(\"SELECT SINGLE @ABAP_TRUE FROM \")) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.selectTable === true\r\n && statement.get() instanceof Statements.Select\r\n && statement.concatTokens().toUpperCase().startsWith(\"SELECT SINGLE \") === false\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.updateDatabase === true\r\n && statement.get() instanceof Statements.UpdateDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.insertDatabase === true\r\n && statement.get() instanceof Statements.InsertDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.modifyDatabase === true\r\n && statement.get() instanceof Statements.ModifyDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.readTable === true\r\n && statement.get() instanceof Statements.ReadTable\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.assign === true\r\n && statement.get() instanceof Statements.Assign\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.find === true\r\n && statement.get() instanceof Statements.Find\r\n && this.isExemptedFind(statement) === false\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n isExemptedFind(s) {\r\n // see https://github.com/abaplint/abaplint/issues/2130\r\n return s.concatTokens().toUpperCase().includes(\" MATCH COUNT \") === true;\r\n }\r\n checksDbcnt(index, statements) {\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.get() instanceof Statements.EndIf) {\r\n continue;\r\n }\r\n else {\r\n return concat.includes(\"SY-DBCNT\");\r\n }\r\n }\r\n return false;\r\n }\r\n isChecked(index, statements) {\r\n var _a, _b;\r\n let assigned = undefined;\r\n let assignedn = undefined;\r\n if (statements[index].get() instanceof Statements.Assign\r\n || statements[index].get() instanceof Statements.ReadTable) {\r\n const fs = (_b = (_a = statements[index].findFirstExpression(Expressions.FSTarget)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.FieldSymbol)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n assigned = (fs === null || fs === void 0 ? void 0 : fs.toUpperCase()) + \" IS ASSIGNED\";\r\n assignedn = (fs === null || fs === void 0 ? void 0 : fs.toUpperCase()) + \" IS NOT ASSIGNED\";\r\n }\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n if (concat.includes(\"\" + this.getMetadata().pseudoComment)) {\r\n return true;\r\n }\r\n }\r\n else if (statement.get() instanceof Statements.EndIf) {\r\n continue;\r\n }\r\n else {\r\n if (assigned && concat.includes(assigned)) {\r\n return true;\r\n }\r\n if (assignedn && concat.includes(assignedn)) {\r\n return true;\r\n }\r\n return concat.includes(\" SY-SUBRC\")\r\n || concat.includes(\"CL_ABAP_UNIT_ASSERT=>ASSERT_SUBRC\");\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.CheckSubrc = CheckSubrc;\r\n//# sourceMappingURL=check_subrc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_subrc.js?");
11547
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckSubrc = exports.CheckSubrcConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass CheckSubrcConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.openDataset = true;\r\n this.authorityCheck = true;\r\n this.selectSingle = true;\r\n this.selectTable = true;\r\n this.updateDatabase = true;\r\n this.insertDatabase = true;\r\n this.modifyDatabase = true;\r\n this.readTable = true;\r\n this.assign = true;\r\n this.find = true;\r\n }\r\n}\r\nexports.CheckSubrcConf = CheckSubrcConf;\r\nclass CheckSubrc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckSubrcConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_subrc\",\r\n title: \"Check sy-subrc\",\r\n shortDescription: `Check sy-subrc`,\r\n extendedInformation: `Pseudo comment \"#EC CI_SUBRC can be added to suppress findings\r\n\r\nIf sy-dbcnt is checked after database statements, it is considered okay.\r\n\r\n\"SELECT SINGLE @abap_true FROM \" is considered as an existence check\r\n\r\nIf IS ASSIGNED is checked after assigning, it is considered okay.\r\n\r\nFIND statement with MATCH COUNT is considered okay if subrc is not checked`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n pseudoComment: \"EC CI_SUBRC\",\r\n pragma: \"##SUBRC_OK\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const statements = file.getStatements();\r\n const message = \"Check sy-subrc\";\r\n const config = this.getConfig();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n // todo: CALL FUNCTION\r\n if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {\r\n continue;\r\n }\r\n if (config.openDataset === true\r\n && statement.get() instanceof Statements.OpenDataset\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.authorityCheck === true\r\n && statement.get() instanceof Statements.AuthorityCheck\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.selectSingle === true\r\n && statement.get() instanceof Statements.Select\r\n && statement.concatTokens().toUpperCase().startsWith(\"SELECT SINGLE \")\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.startsWith(\"SELECT SINGLE @ABAP_TRUE FROM \")) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.selectTable === true\r\n && statement.get() instanceof Statements.Select\r\n && statement.concatTokens().toUpperCase().startsWith(\"SELECT SINGLE \") === false\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.updateDatabase === true\r\n && statement.get() instanceof Statements.UpdateDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.insertDatabase === true\r\n && statement.get() instanceof Statements.InsertDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.modifyDatabase === true\r\n && statement.get() instanceof Statements.ModifyDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.readTable === true\r\n && statement.get() instanceof Statements.ReadTable\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.assign === true\r\n && statement.get() instanceof Statements.Assign\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.find === true\r\n && statement.get() instanceof Statements.Find\r\n && this.isExemptedFind(statement) === false\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n isExemptedFind(s) {\r\n // see https://github.com/abaplint/abaplint/issues/2130\r\n return s.concatTokens().toUpperCase().includes(\" MATCH COUNT \") === true;\r\n }\r\n checksDbcnt(index, statements) {\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.get() instanceof Statements.EndIf) {\r\n continue;\r\n }\r\n else {\r\n return concat.includes(\"SY-DBCNT\");\r\n }\r\n }\r\n return false;\r\n }\r\n isChecked(index, statements) {\r\n var _a, _b;\r\n let assigned = undefined;\r\n let assignedn = undefined;\r\n if (statements[index].get() instanceof Statements.Assign\r\n || statements[index].get() instanceof Statements.ReadTable) {\r\n const fs = (_b = (_a = statements[index].findFirstExpression(Expressions.FSTarget)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.FieldSymbol)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n assigned = (fs === null || fs === void 0 ? void 0 : fs.toUpperCase()) + \" IS ASSIGNED\";\r\n assignedn = (fs === null || fs === void 0 ? void 0 : fs.toUpperCase()) + \" IS NOT ASSIGNED\";\r\n }\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n if (concat.includes(\"\" + this.getMetadata().pseudoComment)) {\r\n return true;\r\n }\r\n }\r\n else if (statement.get() instanceof Statements.EndIf) {\r\n continue;\r\n }\r\n else {\r\n if (assigned && concat.includes(assigned)) {\r\n return true;\r\n }\r\n if (assignedn && concat.includes(assignedn)) {\r\n return true;\r\n }\r\n return concat.includes(\" SY-SUBRC\")\r\n || concat.includes(\"CL_ABAP_UNIT_ASSERT=>ASSERT_SUBRC\");\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.CheckSubrc = CheckSubrc;\r\n//# sourceMappingURL=check_subrc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_subrc.js?");
11548
11548
 
11549
11549
  /***/ }),
11550
11550
 
@@ -11599,7 +11599,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11599
11599
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11600
11600
 
11601
11601
  "use strict";
11602
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassicExceptionsOverlap = exports.ClassicExceptionsOverlapConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass ClassicExceptionsOverlapConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ClassicExceptionsOverlapConf = ClassicExceptionsOverlapConf;\r\nclass ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ClassicExceptionsOverlapConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"classic_exceptions_overlap\",\r\n title: \"Classic exceptions overlap when catching\",\r\n shortDescription: `Find overlapping classic exceptions`,\r\n extendedInformation: `When debugging its typically good to know exactly which exception is caught`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: ` EXCEPTIONS\n system_failure = 1 MESSAGE lv_message\n communication_failure = 1 MESSAGE lv_message\n resource_failure = 1\n OTHERS = 1.`,\r\n goodExample: ` EXCEPTIONS\n system_failure = 1 MESSAGE lv_message\n communication_failure = 2 MESSAGE lv_message\n resource_failure = 3\n OTHERS = 4.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const output = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return []; // syntax error\r\n }\r\n for (const p of struc.findAllExpressions(Expressions.ParameterListExceptions)) {\r\n const set = new Set();\r\n for (const e of p.findAllExpressions(Expressions.ParameterException)) {\r\n const text = (_a = e.findDirectExpression(Expressions.SimpleName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (text === undefined) {\r\n continue;\r\n }\r\n if (set.has(text)) {\r\n const message = \"Exception overlap, \" + text;\r\n const issue = issue_1.Issue.atToken(file, e.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity);\r\n output.push(issue);\r\n break;\r\n }\r\n set.add(text);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.ClassicExceptionsOverlap = ClassicExceptionsOverlap;\r\n//# sourceMappingURL=classic_exceptions_overlap.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/classic_exceptions_overlap.js?");
11602
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassicExceptionsOverlap = exports.ClassicExceptionsOverlapConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass ClassicExceptionsOverlapConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ClassicExceptionsOverlapConf = ClassicExceptionsOverlapConf;\r\nclass ClassicExceptionsOverlap extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ClassicExceptionsOverlapConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"classic_exceptions_overlap\",\r\n title: \"Classic exceptions overlap when catching\",\r\n shortDescription: `Find overlapping classic exceptions`,\r\n extendedInformation: `When debugging its typically good to know exactly which exception is caught`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: ` EXCEPTIONS\r\n system_failure = 1 MESSAGE lv_message\r\n communication_failure = 1 MESSAGE lv_message\r\n resource_failure = 1\r\n OTHERS = 1.`,\r\n goodExample: ` EXCEPTIONS\r\n system_failure = 1 MESSAGE lv_message\r\n communication_failure = 2 MESSAGE lv_message\r\n resource_failure = 3\r\n OTHERS = 4.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const output = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return []; // syntax error\r\n }\r\n for (const p of struc.findAllExpressions(Expressions.ParameterListExceptions)) {\r\n const set = new Set();\r\n for (const e of p.findAllExpressions(Expressions.ParameterException)) {\r\n const text = (_a = e.findDirectExpression(Expressions.SimpleName)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (text === undefined) {\r\n continue;\r\n }\r\n if (set.has(text)) {\r\n const message = \"Exception overlap, \" + text;\r\n const issue = issue_1.Issue.atToken(file, e.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity);\r\n output.push(issue);\r\n break;\r\n }\r\n set.add(text);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.ClassicExceptionsOverlap = ClassicExceptionsOverlap;\r\n//# sourceMappingURL=classic_exceptions_overlap.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/classic_exceptions_overlap.js?");
11603
11603
 
11604
11604
  /***/ }),
11605
11605
 
@@ -11632,7 +11632,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11632
11632
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11633
11633
 
11634
11634
  "use strict";
11635
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CommentedCode = exports.CommentedCodeConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst abap_parser_1 = __webpack_require__(/*! ../abap/abap_parser */ \"./node_modules/@abaplint/core/build/src/abap/abap_parser.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst memory_file_1 = __webpack_require__(/*! ../files/memory_file */ \"./node_modules/@abaplint/core/build/src/files/memory_file.js\");\r\nclass CommentedCodeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allow INCLUDEs in function groups */\r\n this.allowIncludeInFugr = true;\r\n }\r\n}\r\nexports.CommentedCodeConf = CommentedCodeConf;\r\nclass CommentedCode extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CommentedCodeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"commented_code\",\r\n title: \"Find commented code\",\r\n shortDescription: `Detects usage of commented out code.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it\nhttps://docs.abapopenchecks.org/checks/14/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Commented code\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n let issues = [];\r\n const rows = file.getRawRows();\r\n let code = \"\";\r\n let posEnd = undefined;\r\n let posStart = undefined;\r\n for (let i = 0; i < rows.length; i++) {\r\n if (this.isCommentLine(rows[i])) {\r\n if (code === \"\") {\r\n posStart = new position_1.Position(i + 1, 1);\r\n }\r\n code = code + rows[i].trim().substr(1) + \"\\n\";\r\n posEnd = new position_1.Position(i + 1, rows[i].length + 1);\r\n }\r\n else if (code !== \"\" && posStart && posEnd) {\r\n issues = issues.concat(this.check(code.trim(), file, posStart, posEnd, obj));\r\n code = \"\";\r\n }\r\n }\r\n if (posStart && posEnd) {\r\n issues = issues.concat(this.check(code.trim(), file, posStart, posEnd, obj));\r\n }\r\n return issues;\r\n }\r\n check(code, file, posStart, posEnd, obj) {\r\n // assumption: code must end with \".\" in order to be valid ABAP\r\n if (code === \"\" || code.charAt(code.length - 1) !== \".\") {\r\n return [];\r\n }\r\n const commented = new memory_file_1.MemoryFile(\"_foobar.prog.abap\", code);\r\n const abapFile = new abap_parser_1.ABAPParser().parse([commented]).output[0];\r\n const statementNodes = abapFile.getStatements();\r\n if (statementNodes.length === 0) {\r\n return [];\r\n }\r\n let containsStatement = false;\r\n for (const statementNode of statementNodes) {\r\n const statement = statementNode.get();\r\n if (this.getConfig().allowIncludeInFugr === true\r\n && obj instanceof objects_1.FunctionGroup\r\n && statement instanceof statements_1.Include) {\r\n continue;\r\n }\r\n if (!(statement instanceof _statement_1.Unknown\r\n || statement instanceof _statement_1.Empty\r\n || statement instanceof _statement_1.Comment)) {\r\n containsStatement = true;\r\n break;\r\n }\r\n }\r\n if (!containsStatement) {\r\n return [];\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, posStart, posEnd);\r\n const issue = issue_1.Issue.atRange(file, posStart, posEnd, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n return [issue];\r\n }\r\n isCommentLine(text) {\r\n return (text.substr(0, 1) === \"*\")\r\n || (text.trim().substr(0, 1) === \"\\\"\" && text.trim().substr(1, 1) !== \"!\");\r\n }\r\n}\r\nexports.CommentedCode = CommentedCode;\r\n//# sourceMappingURL=commented_code.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/commented_code.js?");
11635
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CommentedCode = exports.CommentedCodeConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst abap_parser_1 = __webpack_require__(/*! ../abap/abap_parser */ \"./node_modules/@abaplint/core/build/src/abap/abap_parser.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst memory_file_1 = __webpack_require__(/*! ../files/memory_file */ \"./node_modules/@abaplint/core/build/src/files/memory_file.js\");\r\nclass CommentedCodeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allow INCLUDEs in function groups */\r\n this.allowIncludeInFugr = true;\r\n }\r\n}\r\nexports.CommentedCodeConf = CommentedCodeConf;\r\nclass CommentedCode extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CommentedCodeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"commented_code\",\r\n title: \"Find commented code\",\r\n shortDescription: `Detects usage of commented out code.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it\r\nhttps://docs.abapopenchecks.org/checks/14/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Commented code\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n let issues = [];\r\n const rows = file.getRawRows();\r\n let code = \"\";\r\n let posEnd = undefined;\r\n let posStart = undefined;\r\n for (let i = 0; i < rows.length; i++) {\r\n if (this.isCommentLine(rows[i])) {\r\n if (code === \"\") {\r\n posStart = new position_1.Position(i + 1, 1);\r\n }\r\n code = code + rows[i].trim().substr(1) + \"\\n\";\r\n posEnd = new position_1.Position(i + 1, rows[i].length + 1);\r\n }\r\n else if (code !== \"\" && posStart && posEnd) {\r\n issues = issues.concat(this.check(code.trim(), file, posStart, posEnd, obj));\r\n code = \"\";\r\n }\r\n }\r\n if (posStart && posEnd) {\r\n issues = issues.concat(this.check(code.trim(), file, posStart, posEnd, obj));\r\n }\r\n return issues;\r\n }\r\n check(code, file, posStart, posEnd, obj) {\r\n // assumption: code must end with \".\" in order to be valid ABAP\r\n if (code === \"\" || code.charAt(code.length - 1) !== \".\") {\r\n return [];\r\n }\r\n const commented = new memory_file_1.MemoryFile(\"_foobar.prog.abap\", code);\r\n const abapFile = new abap_parser_1.ABAPParser().parse([commented]).output[0];\r\n const statementNodes = abapFile.getStatements();\r\n if (statementNodes.length === 0) {\r\n return [];\r\n }\r\n let containsStatement = false;\r\n for (const statementNode of statementNodes) {\r\n const statement = statementNode.get();\r\n if (this.getConfig().allowIncludeInFugr === true\r\n && obj instanceof objects_1.FunctionGroup\r\n && statement instanceof statements_1.Include) {\r\n continue;\r\n }\r\n if (!(statement instanceof _statement_1.Unknown\r\n || statement instanceof _statement_1.Empty\r\n || statement instanceof _statement_1.Comment)) {\r\n containsStatement = true;\r\n break;\r\n }\r\n }\r\n if (!containsStatement) {\r\n return [];\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, posStart, posEnd);\r\n const issue = issue_1.Issue.atRange(file, posStart, posEnd, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n return [issue];\r\n }\r\n isCommentLine(text) {\r\n return (text.substr(0, 1) === \"*\")\r\n || (text.trim().substr(0, 1) === \"\\\"\" && text.trim().substr(1, 1) !== \"!\");\r\n }\r\n}\r\nexports.CommentedCode = CommentedCode;\r\n//# sourceMappingURL=commented_code.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/commented_code.js?");
11636
11636
 
11637
11637
  /***/ }),
11638
11638
 
@@ -11654,7 +11654,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11654
11654
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11655
11655
 
11656
11656
  "use strict";
11657
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstructorVisibilityPublic = exports.ConstructorVisibilityPublicConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nclass ConstructorVisibilityPublicConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ConstructorVisibilityPublicConf = ConstructorVisibilityPublicConf;\r\nclass ConstructorVisibilityPublic {\r\n constructor() {\r\n this.conf = new ConstructorVisibilityPublicConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"constructor_visibility_public\",\r\n title: \"Check constructor visibility is public\",\r\n shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,\r\n extendedInformation: `\nThis only applies to global classes.\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public\nhttps://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Constructor visibility should be public\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const issues = [];\r\n if (!(obj instanceof objects_1.Class)) {\r\n return [];\r\n }\r\n const def = obj.getClassDefinition();\r\n if (def === undefined) {\r\n return [];\r\n }\r\n for (const method of def.methods) {\r\n if (method.name.toUpperCase() === \"CONSTRUCTOR\"\r\n && method.visibility !== visibility_1.Visibility.Public) {\r\n const issue = issue_1.Issue.atIdentifier(method.identifier, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ConstructorVisibilityPublic = ConstructorVisibilityPublic;\r\n//# sourceMappingURL=constructor_visibility_public.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/constructor_visibility_public.js?");
11657
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstructorVisibilityPublic = exports.ConstructorVisibilityPublicConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nclass ConstructorVisibilityPublicConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ConstructorVisibilityPublicConf = ConstructorVisibilityPublicConf;\r\nclass ConstructorVisibilityPublic {\r\n constructor() {\r\n this.conf = new ConstructorVisibilityPublicConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"constructor_visibility_public\",\r\n title: \"Check constructor visibility is public\",\r\n shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,\r\n extendedInformation: `\r\nThis only applies to global classes.\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public\r\nhttps://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Constructor visibility should be public\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const issues = [];\r\n if (!(obj instanceof objects_1.Class)) {\r\n return [];\r\n }\r\n const def = obj.getClassDefinition();\r\n if (def === undefined) {\r\n return [];\r\n }\r\n for (const method of def.methods) {\r\n if (method.name.toUpperCase() === \"CONSTRUCTOR\"\r\n && method.visibility !== visibility_1.Visibility.Public) {\r\n const issue = issue_1.Issue.atIdentifier(method.identifier, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ConstructorVisibilityPublic = ConstructorVisibilityPublic;\r\n//# sourceMappingURL=constructor_visibility_public.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/constructor_visibility_public.js?");
11658
11658
 
11659
11659
  /***/ }),
11660
11660
 
@@ -11665,7 +11665,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11665
11665
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11666
11666
 
11667
11667
  "use strict";
11668
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ContainsTab = exports.ContainsTabConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ContainsTabConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** quick fix replace with number of spaces */\r\n this.spaces = 1;\r\n }\r\n}\r\nexports.ContainsTabConf = ContainsTabConf;\r\nclass ContainsTab extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ContainsTabConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"contains_tab\",\r\n title: \"Code contains tab\",\r\n shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,\r\n extendedInformation: `\nhttps://docs.abapopenchecks.org/checks/09/\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Code should not contain tabs\";\r\n }\r\n getConfig() {\r\n if (this.conf.spaces === undefined) {\r\n this.conf.spaces = 1;\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const lines = file.getRaw().split(\"\\n\");\r\n lines.forEach((_, i) => {\r\n const tabCol = lines[i].indexOf(\"\\t\");\r\n if (tabCol >= 0) {\r\n let tabAmount = 1;\r\n while (lines[i].indexOf(\"\\t\", tabCol + tabAmount - 1) >= 0) {\r\n tabAmount++;\r\n }\r\n issues.push(this.createIssue(i, tabCol, tabAmount, file));\r\n }\r\n });\r\n return issues;\r\n }\r\n createIssue(line, tabCol, tabAmount, file) {\r\n const tabStartPos = new position_1.Position(line + 1, tabCol + 1);\r\n const tabEndPos = new position_1.Position(line + 1, tabCol + tabAmount);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, tabStartPos, tabEndPos, \" \".repeat(this.getConfig().spaces));\r\n return issue_1.Issue.atRange(file, tabStartPos, tabEndPos, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n}\r\nexports.ContainsTab = ContainsTab;\r\n//# sourceMappingURL=contains_tab.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/contains_tab.js?");
11668
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ContainsTab = exports.ContainsTabConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ContainsTabConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** quick fix replace with number of spaces */\r\n this.spaces = 1;\r\n }\r\n}\r\nexports.ContainsTabConf = ContainsTabConf;\r\nclass ContainsTab extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ContainsTabConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"contains_tab\",\r\n title: \"Code contains tab\",\r\n shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,\r\n extendedInformation: `\r\nhttps://docs.abapopenchecks.org/checks/09/\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Code should not contain tabs\";\r\n }\r\n getConfig() {\r\n if (this.conf.spaces === undefined) {\r\n this.conf.spaces = 1;\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const lines = file.getRaw().split(\"\\n\");\r\n lines.forEach((_, i) => {\r\n const tabCol = lines[i].indexOf(\"\\t\");\r\n if (tabCol >= 0) {\r\n let tabAmount = 1;\r\n while (lines[i].indexOf(\"\\t\", tabCol + tabAmount - 1) >= 0) {\r\n tabAmount++;\r\n }\r\n issues.push(this.createIssue(i, tabCol, tabAmount, file));\r\n }\r\n });\r\n return issues;\r\n }\r\n createIssue(line, tabCol, tabAmount, file) {\r\n const tabStartPos = new position_1.Position(line + 1, tabCol + 1);\r\n const tabEndPos = new position_1.Position(line + 1, tabCol + tabAmount);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, tabStartPos, tabEndPos, \" \".repeat(this.getConfig().spaces));\r\n return issue_1.Issue.atRange(file, tabStartPos, tabEndPos, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n}\r\nexports.ContainsTab = ContainsTab;\r\n//# sourceMappingURL=contains_tab.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/contains_tab.js?");
11669
11669
 
11670
11670
  /***/ }),
11671
11671
 
@@ -11698,7 +11698,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11698
11698
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11699
11699
 
11700
11700
  "use strict";
11701
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DangerousStatement = exports.DangerousStatementConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass DangerousStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects execSQL (dynamic SQL) */\r\n this.execSQL = true;\r\n /** Detects kernel calls */\r\n this.kernelCall = true;\r\n /** Detects SYSTEM-CALL */\r\n this.systemCall = true;\r\n /** Detects INSERT REPORT */\r\n this.insertReport = true;\r\n this.generateDynpro = true;\r\n this.generateReport = true;\r\n this.generateSubroutine = true;\r\n this.deleteReport = true;\r\n this.deleteTextpool = true;\r\n this.deleteDynpro = true;\r\n this.exportDynpro = true;\r\n /** Finds instances of dynamic SQL: SELECT, UPDATE, DELETE, INSERT, MODIFY */\r\n this.dynamicSQL = true;\r\n }\r\n}\r\nexports.DangerousStatementConf = DangerousStatementConf;\r\nclass DangerousStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new DangerousStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"dangerous_statement\",\r\n title: \"Dangerous statement\",\r\n shortDescription: `Detects potentially dangerous statements`,\r\n extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,\ndynamic SQL can potentially create SQL injection problems`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],\r\n };\r\n }\r\n getDescription(statement) {\r\n return \"Potential dangerous statement \" + statement;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const statementNode of file.getStatements()) {\r\n const statement = statementNode.get();\r\n let message = undefined;\r\n if (this.conf.execSQL && statement instanceof Statements.ExecSQL) {\r\n message = \"EXEC SQL\";\r\n }\r\n else if (this.conf.kernelCall && statement instanceof Statements.CallKernel) {\r\n message = \"KERNEL CALL\";\r\n }\r\n else if (this.conf.systemCall && statement instanceof Statements.SystemCall) {\r\n message = \"SYSTEM-CALL\";\r\n }\r\n else if (this.conf.insertReport && statement instanceof Statements.InsertReport) {\r\n message = \"INSERT REPORT\";\r\n }\r\n else if (this.conf.generateDynpro && statement instanceof Statements.GenerateDynpro) {\r\n message = \"GENERATE DYNPRO\";\r\n }\r\n else if (this.conf.generateReport && statement instanceof Statements.GenerateReport) {\r\n message = \"GENERATE REPORT\";\r\n }\r\n else if (this.conf.generateSubroutine && statement instanceof Statements.GenerateSubroutine) {\r\n message = \"GENERATE SUBROUTINE\";\r\n }\r\n else if (this.conf.deleteReport && statement instanceof Statements.DeleteReport) {\r\n message = \"DELETE REPORT\";\r\n }\r\n else if (this.conf.deleteTextpool && statement instanceof Statements.DeleteTextpool) {\r\n message = \"DELETE TEXTPOOL\";\r\n }\r\n else if (this.conf.deleteDynpro && statement instanceof Statements.DeleteDynpro) {\r\n message = \"DELETE DYNPRO\";\r\n }\r\n else if (this.conf.exportDynpro && statement instanceof Statements.ExportDynpro) {\r\n message = \"EXPORT DYNPRO\";\r\n }\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n if (this.conf.dynamicSQL) {\r\n message = this.findDynamicSQL(statementNode);\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n findDynamicSQL(statementNode) {\r\n const statement = statementNode.get();\r\n if (statement instanceof Statements.UpdateDatabase\r\n || statement instanceof Statements.Select\r\n || statement instanceof Statements.SelectLoop\r\n || statement instanceof Statements.InsertDatabase\r\n || statement instanceof Statements.ModifyDatabase\r\n || statement instanceof Statements.DeleteDatabase) {\r\n const dyn = statementNode.findFirstExpression(Expressions.Dynamic);\r\n if (dyn && dyn.findDirectExpression(Expressions.Constant) === undefined) {\r\n return \"Dynamic SQL\";\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.DangerousStatement = DangerousStatement;\r\n//# sourceMappingURL=dangerous_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/dangerous_statement.js?");
11701
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DangerousStatement = exports.DangerousStatementConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass DangerousStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects execSQL (dynamic SQL) */\r\n this.execSQL = true;\r\n /** Detects kernel calls */\r\n this.kernelCall = true;\r\n /** Detects SYSTEM-CALL */\r\n this.systemCall = true;\r\n /** Detects INSERT REPORT */\r\n this.insertReport = true;\r\n this.generateDynpro = true;\r\n this.generateReport = true;\r\n this.generateSubroutine = true;\r\n this.deleteReport = true;\r\n this.deleteTextpool = true;\r\n this.deleteDynpro = true;\r\n this.exportDynpro = true;\r\n /** Finds instances of dynamic SQL: SELECT, UPDATE, DELETE, INSERT, MODIFY */\r\n this.dynamicSQL = true;\r\n }\r\n}\r\nexports.DangerousStatementConf = DangerousStatementConf;\r\nclass DangerousStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new DangerousStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"dangerous_statement\",\r\n title: \"Dangerous statement\",\r\n shortDescription: `Detects potentially dangerous statements`,\r\n extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,\r\ndynamic SQL can potentially create SQL injection problems`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],\r\n };\r\n }\r\n getDescription(statement) {\r\n return \"Potential dangerous statement \" + statement;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const statementNode of file.getStatements()) {\r\n const statement = statementNode.get();\r\n let message = undefined;\r\n if (this.conf.execSQL && statement instanceof Statements.ExecSQL) {\r\n message = \"EXEC SQL\";\r\n }\r\n else if (this.conf.kernelCall && statement instanceof Statements.CallKernel) {\r\n message = \"KERNEL CALL\";\r\n }\r\n else if (this.conf.systemCall && statement instanceof Statements.SystemCall) {\r\n message = \"SYSTEM-CALL\";\r\n }\r\n else if (this.conf.insertReport && statement instanceof Statements.InsertReport) {\r\n message = \"INSERT REPORT\";\r\n }\r\n else if (this.conf.generateDynpro && statement instanceof Statements.GenerateDynpro) {\r\n message = \"GENERATE DYNPRO\";\r\n }\r\n else if (this.conf.generateReport && statement instanceof Statements.GenerateReport) {\r\n message = \"GENERATE REPORT\";\r\n }\r\n else if (this.conf.generateSubroutine && statement instanceof Statements.GenerateSubroutine) {\r\n message = \"GENERATE SUBROUTINE\";\r\n }\r\n else if (this.conf.deleteReport && statement instanceof Statements.DeleteReport) {\r\n message = \"DELETE REPORT\";\r\n }\r\n else if (this.conf.deleteTextpool && statement instanceof Statements.DeleteTextpool) {\r\n message = \"DELETE TEXTPOOL\";\r\n }\r\n else if (this.conf.deleteDynpro && statement instanceof Statements.DeleteDynpro) {\r\n message = \"DELETE DYNPRO\";\r\n }\r\n else if (this.conf.exportDynpro && statement instanceof Statements.ExportDynpro) {\r\n message = \"EXPORT DYNPRO\";\r\n }\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n if (this.conf.dynamicSQL) {\r\n message = this.findDynamicSQL(statementNode);\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n findDynamicSQL(statementNode) {\r\n const statement = statementNode.get();\r\n if (statement instanceof Statements.UpdateDatabase\r\n || statement instanceof Statements.Select\r\n || statement instanceof Statements.SelectLoop\r\n || statement instanceof Statements.InsertDatabase\r\n || statement instanceof Statements.ModifyDatabase\r\n || statement instanceof Statements.DeleteDatabase) {\r\n const dyn = statementNode.findFirstExpression(Expressions.Dynamic);\r\n if (dyn && dyn.findDirectExpression(Expressions.Constant) === undefined) {\r\n return \"Dynamic SQL\";\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.DangerousStatement = DangerousStatement;\r\n//# sourceMappingURL=dangerous_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/dangerous_statement.js?");
11702
11702
 
11703
11703
  /***/ }),
11704
11704
 
@@ -11753,7 +11753,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11753
11753
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11754
11754
 
11755
11755
  "use strict";
11756
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Downport = exports.DownportConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst registry_1 = __webpack_require__(/*! ../registry */ \"./node_modules/@abaplint/core/build/src/registry.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst config_1 = __webpack_require__(/*! ../config */ \"./node_modules/@abaplint/core/build/src/config.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\n// todo: refactor each sub-rule to new classes?\r\n// todo: add configuration\r\nclass DownportConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.DownportConf = DownportConf;\r\nclass Downport {\r\n constructor() {\r\n this.conf = new DownportConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"downport\",\r\n title: \"Downport statement\",\r\n shortDescription: `Experimental downport functionality`,\r\n extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with\na higher level language version. If successful, various rules are applied to downport the statement.\nTarget downport version is always v702, thus rule is only enabled if target version is v702.\n\nCurrent rules:\n* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/\n* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/\n* FIELD-SYMBOL() definitions are outlined\n* CONV is outlined\n* COND is outlined\n* REDUCE is outlined\n* SWITCH is outlined\n* APPEND expression is outlined\n* INSERT expression is outlined\n* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/\n* CAST changed to ?=\n* LOOP AT method_call( ) is outlined\n* VALUE # with structure fields\n* VALUE # with internal table lines\n* Table Expressions are outlined\n* SELECT INTO @DATA definitions are outlined\n* Some occurrences of string template formatting option ALPHA changed to function module call\n* SELECT/INSERT/MODIFY/DELETE/UPDATE \",\" in field list removed, \"@\" in source/targets removed\n* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods\n* RAISE EXCEPTION ... MESSAGE\n* Moving with +=, -=, /=, *=, &&= is expanded\n* line_exists and line_index is downported to READ TABLE\n* ENUMs, but does not nessesarily give the correct type and value\n* MESSAGE with non simple source\n\nOnly one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.`,\r\n tags: [_irule_1.RuleTag.Experimental, _irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.lowReg = reg;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version === version_1.Version.v702 || version === version_1.Version.OpenABAP) {\r\n this.initHighReg();\r\n this.graph = new include_graph_1.IncludeGraph(reg);\r\n }\r\n return this;\r\n }\r\n run(lowObj) {\r\n var _a;\r\n const ret = [];\r\n this.counter = 1;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version !== version_1.Version.v702 && version !== version_1.Version.OpenABAP) {\r\n return ret;\r\n }\r\n else if (!(lowObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n const highObj = this.highReg.getObject(lowObj.getType(), lowObj.getName());\r\n if (highObj === undefined || !(highObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n let highSyntaxObj = highObj;\r\n // for includes do the syntax check via a main program\r\n if (lowObj instanceof objects_1.Program && lowObj.isInclude()) {\r\n const mains = this.graph.listMainForInclude((_a = lowObj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename());\r\n if (mains.length <= 0) {\r\n return [];\r\n }\r\n const f = this.highReg.getFileByName(mains[0]);\r\n if (f === undefined) {\r\n return [];\r\n }\r\n highSyntaxObj = this.highReg.findObjectForFile(f);\r\n }\r\n const highSyntax = new syntax_1.SyntaxLogic(this.highReg, highSyntaxObj).run();\r\n for (const lowFile of lowObj.getABAPFiles()) {\r\n const highFile = highObj.getABAPFileByName(lowFile.getFilename());\r\n if (highFile === undefined) {\r\n continue;\r\n }\r\n const lowStatements = lowFile.getStatements();\r\n const highStatements = highFile.getStatements();\r\n if (lowStatements.length !== highStatements.length) {\r\n // after applying a fix, there might be more statements in lowFile\r\n // should highReg be initialized again?\r\n /*\r\n const message = \"Internal Error: Statement lengths does not match\";\r\n ret.push(Issue.atStatement(lowFile, lowStatements[0], message, this.getMetadata().key));\r\n */\r\n continue;\r\n }\r\n for (let i = 0; i < lowStatements.length; i++) {\r\n const low = lowStatements[i];\r\n const high = highStatements[i];\r\n if ((low.get() instanceof _statement_1.Unknown && !(high.get() instanceof _statement_1.Unknown))\r\n || high.findFirstExpression(Expressions.InlineData)) {\r\n const issue = this.checkStatement(low, high, lowFile, highSyntax, highFile);\r\n if (issue) {\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n ////////////////////\r\n /** clones the orginal repository into highReg, and parses it with higher language version */\r\n initHighReg() {\r\n // use default configuration, ie. default target version\r\n const highConfig = config_1.Config.getDefault().get();\r\n const lowConfig = this.lowReg.getConfig().get();\r\n highConfig.syntax.errorNamespace = lowConfig.syntax.errorNamespace;\r\n highConfig.syntax.globalConstants = lowConfig.syntax.globalConstants;\r\n highConfig.syntax.globalMacros = lowConfig.syntax.globalMacros;\r\n this.highReg = new registry_1.Registry();\r\n for (const o of this.lowReg.getObjects()) {\r\n for (const f of o.getFiles()) {\r\n if (this.lowReg.isDependency(o) === true) {\r\n this.highReg.addDependency(f);\r\n }\r\n else {\r\n this.highReg.addFile(f);\r\n }\r\n }\r\n }\r\n this.highReg.parse();\r\n }\r\n /** applies one rule at a time, multiple iterations are required to transform complex statements */\r\n checkStatement(low, high, lowFile, highSyntax, highFile) {\r\n if (low.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n return undefined;\r\n }\r\n let found = this.downportEnum(low, high, lowFile, highSyntax, highFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.partiallyImplemented(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.raiseException(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.emptyKey(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.stringTemplateAlpha(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithOperator(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithSimpleValue(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithTableTarget(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSQLExtras(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopInput(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopTarget(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineValue(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineReduce(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineSwitch(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCast(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineConv(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCond(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCatchSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineDataSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineData(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineFS(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.newToCreateObject(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceXsdBool(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceLineFunctions(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceContains(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceMethodConditional(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceTableExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceAppendExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceInsertExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportMessage(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n //////////////////////////////////////////\r\n downportSQLExtras(low, high, lowFile, _highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Select)\r\n && !(high.get() instanceof Statements.SelectLoop)\r\n && !(high.get() instanceof Statements.UpdateDatabase)\r\n && !(high.get() instanceof Statements.ModifyDatabase)\r\n && !(high.get() instanceof Statements.DeleteDatabase)\r\n && !(high.get() instanceof Statements.InsertDatabase)) {\r\n return undefined;\r\n }\r\n let fix = undefined;\r\n const addFix = (token) => {\r\n const add = edit_helper_1.EditHelper.deleteToken(lowFile, token);\r\n if (fix === undefined) {\r\n fix = add;\r\n }\r\n else {\r\n fix = edit_helper_1.EditHelper.merge(fix, add);\r\n }\r\n };\r\n const candidates = [high.findAllExpressionsRecursive(Expressions.SQLTarget),\r\n high.findAllExpressionsRecursive(Expressions.SQLSource),\r\n high.findAllExpressionsRecursive(Expressions.SQLSourceSimple)].flat();\r\n for (const c of candidates) {\r\n if (c.getFirstToken() instanceof tokens_1.WAt) {\r\n addFix(c.getFirstToken());\r\n }\r\n }\r\n for (const fieldList of high.findAllExpressionsMulti([Expressions.SQLFieldList, Expressions.SQLFieldListLoop], true)) {\r\n for (const token of fieldList.getDirectTokens()) {\r\n if (token.getStr() === \",\") {\r\n addFix(token);\r\n }\r\n }\r\n }\r\n if (fix === undefined) {\r\n return undefined;\r\n }\r\n else {\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove \\\" and ,\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n downportSelectInline(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Select) && !(high.get() instanceof Statements.SelectLoop)) {\r\n return undefined;\r\n }\r\n // as first step outline the @DATA, note that void types are okay, as long the field names are specified\r\n let found = this.downportSelectSingleInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectTableInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n downportSelectSingleInline(_low, high, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoStructure)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length !== 1) {\r\n return undefined;\r\n }\r\n const tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n fieldList = high.findFirstExpression(Expressions.SQLFieldListLoop);\r\n }\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinition = \"\";\r\n const fields = fieldList.findDirectExpressions(Expressions.SQLFieldName);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n if (fields.length === 1) {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${fields[0].concatTokens()}.`;\r\n }\r\n else if (fieldList.concatTokens() === \"*\") {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}.`;\r\n }\r\n else if (fieldList.concatTokens().toUpperCase() === \"COUNT( * )\") {\r\n fieldDefinition = `DATA ${name} TYPE i.`;\r\n }\r\n else if (fieldList.getChildren().length === 1 && fieldList.getChildren()[0].get() instanceof Expressions.SQLAggregation) {\r\n const c = fieldList.getChildren()[0];\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n const concat = (_d = c.findFirstExpression(Expressions.SQLArithmetics)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${concat}.`;\r\n }\r\n }\r\n else {\r\n for (const f of fields) {\r\n const fieldName = f.concatTokens();\r\n fieldDefinition += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n fieldDefinition = `DATA: BEGIN OF ${name},\n${fieldDefinition}${indentation} END OF ${name}.`;\r\n }\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportSelectTableInline(_low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length === 0) {\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Error outlining, sqlFrom not found\", this.getMetadata().key, this.conf.severity);\r\n }\r\n let tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinitions = \"\";\r\n for (const f of fieldList.findDirectExpressions(Expressions.SQLFieldName)) {\r\n let fieldName = f.concatTokens();\r\n if (fieldName.includes(\"~\")) {\r\n const split = fieldName.split(\"~\");\r\n tableName = split[0];\r\n fieldName = split[1];\r\n }\r\n fieldDefinitions += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},\n${fieldDefinitions}${indentation} END OF ${uniqueName}.\n${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.\n${indentation}`);\r\n if (fieldDefinitions === \"\") {\r\n fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.\n${indentation}`);\r\n }\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportMessage(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Message)) {\r\n return undefined;\r\n }\r\n const foundWith = high.findExpressionAfterToken(\"WITH\");\r\n if (foundWith === undefined) {\r\n return undefined;\r\n }\r\n const likeSource = high.findExpressionAfterToken(\"LIKE\");\r\n for (const s of high.findAllExpressions(Expressions.Source)) {\r\n if (s === likeSource) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Refactor MESSAGE WITH source\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceAppendExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Append)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline APPEND source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceInsertExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.InsertInternal)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline INSERT source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceTableExpression(node, lowFile, highSyntax) {\r\n for (const fieldChain of node.findAllExpressionsRecursive(Expressions.FieldChain)) {\r\n const tableExpression = fieldChain.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n continue;\r\n }\r\n const concat = node.concatTokens().toUpperCase();\r\n if (concat.includes(\" LINE_EXISTS( \") || concat.includes(\" LINE_INDEX( \")) {\r\n // note: line_exists() must be replaced before handling table expressions\r\n continue;\r\n }\r\n let pre = \"\";\r\n let startToken = undefined;\r\n for (const child of fieldChain.getChildren()) {\r\n if (startToken === undefined) {\r\n startToken = child.getFirstToken();\r\n }\r\n else if (child === tableExpression) {\r\n break;\r\n }\r\n pre += child.concatTokens();\r\n }\r\n if (startToken === undefined) {\r\n continue;\r\n }\r\n const condition = this.tableCondition(tableExpression);\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const tabixBackup = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n // note that the tabix restore should be done before throwing the exception\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\n${indentation}${tabixBackup} = sy-tabix.\n${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.\n${indentation}sy-tabix = ${tabixBackup}.\n${indentation}IF sy-subrc <> 0.\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\n${indentation}ENDIF.\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline table expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n tableCondition(tableExpression) {\r\n let condition = \"\";\r\n let keyName = \"\";\r\n for (const c of tableExpression.getChildren() || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n if (keyName === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else {\r\n condition = \"WITH TABLE KEY \" + keyName + \" COMPONENTS \";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.getFirstToken().getStr().toUpperCase() === \"KEY\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.SimpleName) {\r\n keyName = c.concatTokens();\r\n continue;\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n return condition;\r\n }\r\n outlineCatchSimple(node, lowFile) {\r\n // outlines \"CATCH cx_bcs INTO DATA(lx_bcs_excep).\", note that this does not need to look at types\r\n var _a, _b;\r\n if (!(node.get() instanceof Statements.Catch)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n const classNames = node.findDirectExpressions(Expressions.ClassName);\r\n if (classNames.length !== 1) {\r\n return undefined;\r\n }\r\n const className = classNames[0].concatTokens();\r\n const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const code = ` DATA ${targetName} TYPE REF TO ${className}.\n${indentation}CATCH ${className} INTO ${targetName}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineDataSimple(node, lowFile) {\r\n // outlines \"DATA(ls_msg) = temp1.\", note that this does not need to look at types\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n let type = \"\";\r\n const source = node.findFirstExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n else if (source.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n else if (!(((_b = source.getFirstChild()) === null || _b === void 0 ? void 0 : _b.get()) instanceof Expressions.FieldChain)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldOffset)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldLength)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.TableExpression)) {\r\n const chain = source.findDirectExpression(Expressions.FieldChain);\r\n if (chain !== undefined\r\n && chain.getChildren().length === 2\r\n && chain.getChildren()[0].get() instanceof Expressions.SourceField\r\n && chain.getChildren()[1].get() instanceof Expressions.TableExpression) {\r\n type = \"LINE OF \" + chain.getChildren()[0].concatTokens();\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n type = source.concatTokens();\r\n }\r\n const targetName = (_c = target.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const lastToken = node.getLastToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${targetName} LIKE ${type}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), lastToken.getEnd(), `${targetName} = ${source.concatTokens()}.`);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n partiallyImplemented(node, lowFile) {\r\n if (node.get() instanceof Statements.InterfaceDef) {\r\n const partially = node.findDirectTokenByText(\"PARTIALLY\");\r\n if (partially === undefined) {\r\n return undefined;\r\n }\r\n const implemented = node.findDirectTokenByText(\"IMPLEMENTED\");\r\n if (implemented === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(lowFile, partially.getStart(), implemented.getEnd());\r\n return issue_1.Issue.atToken(lowFile, partially, \"Downport PARTIALLY IMPLEMENTED\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n raiseException(node, lowFile, highSyntax) {\r\n /*\r\n Note: IF_T100_DYN_MSG does not exist in 702, so this rule is mostly relevant for the transpiler\r\n \r\n DATA foo LIKE if_t100_message=>t100key.\r\n foo-msgid = 'ZHVAM'.\r\n foo-msgno = '001'.\r\n foo-attr1 = 'IF_T100_DYN_MSG~MSGV1'.\r\n foo-attr2 = 'IF_T100_DYN_MSG~MSGV2'.\r\n foo-attr3 = 'IF_T100_DYN_MSG~MSGV3'.\r\n foo-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\r\n DATA bar TYPE REF TO zcl_hvam_exception.\r\n CREATE OBJECT bar EXPORTING textid = foo.\r\n bar->if_t100_dyn_msg~msgty = 'E'.\r\n bar->if_t100_dyn_msg~msgv1 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv2 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv3 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv4 = 'abc'.\r\n RAISE EXCEPTION bar.\r\n */\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Raise)) {\r\n return undefined;\r\n }\r\n let id = undefined;\r\n let number = undefined;\r\n let startToken = node.findDirectTokenByText(\"ID\");\r\n if (startToken) {\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n id = sources[0].concatTokens();\r\n const numberExpression = node.findExpressionAfterToken(\"NUMBER\");\r\n if (numberExpression === undefined) {\r\n throw \"downport raiseException, could not find number\";\r\n }\r\n number = numberExpression.concatTokens();\r\n if (numberExpression.get() instanceof Expressions.MessageNumber) {\r\n number = \"'\" + number + \"'\";\r\n }\r\n }\r\n else {\r\n const s = node.findDirectExpression(Expressions.MessageSource);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n id = \"'\" + ((_a = s.findDirectExpression(Expressions.MessageClass)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + \"'\";\r\n number = \"'\" + ((_b = s.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens().substring(1)) + \"'\";\r\n startToken = node.getFirstToken();\r\n }\r\n const className = ((_c = node.findDirectExpression(Expressions.ClassName)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"ERROR\";\r\n const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.\n${indentation}${uniqueName1}-msgid = ${id === null || id === void 0 ? void 0 : id.toUpperCase()}.\n${indentation}${uniqueName1}-msgno = ${number}.\n${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.\n${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n${indentation}RAISE EXCEPTION ${uniqueName2}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), abap);\r\n return issue_1.Issue.atToken(lowFile, startToken, \"Downport RAISE MESSAGE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n emptyKey(node, lowFile) {\r\n for (let i of node.findAllExpressions(Expressions.TypeTable)) {\r\n const key = i.findDirectExpression(Expressions.TypeTableKey);\r\n if (key === undefined) {\r\n continue;\r\n }\r\n i = key;\r\n const concat = i.concatTokens();\r\n if (concat.toUpperCase().includes(\"WITH EMPTY KEY\") === false) {\r\n continue;\r\n }\r\n const token = i.findDirectTokenByText(\"EMPTY\");\r\n if (token === undefined) {\r\n continue;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceToken(lowFile, token, \"DEFAULT\");\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport EMPTY KEY\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n moveWithSimpleValue(high, lowFile) {\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n const field = target.findDirectExpression(Expressions.TargetField);\r\n if (field === undefined) {\r\n return;\r\n }\r\n const valueBody = source.findDirectExpression(Expressions.ValueBody);\r\n if (valueBody === undefined || valueBody.getChildren().length !== 1) {\r\n return;\r\n }\r\n const fieldAssignment = valueBody.findDirectExpression(Expressions.FieldAssignment);\r\n if (fieldAssignment === undefined) {\r\n return;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const code = `CLEAR ${target.concatTokens()}.\\n` + indentation + target.concatTokens() + \"-\" + fieldAssignment.concatTokens();\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, simple move\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // note, downporting ENUM does not give the correct types, but it will work in most cases?\r\n downportEnum(_low, high, lowFile, _highSyntax, highFile) {\r\n var _a, _b, _c, _d, _e;\r\n if (!(high.get() instanceof Statements.TypeEnumBegin)) {\r\n return undefined;\r\n }\r\n const enumStructure = (_a = highFile.getStructure()) === null || _a === void 0 ? void 0 : _a.findFirstStructure(Structures.TypeEnum);\r\n if (enumStructure === undefined) {\r\n return undefined;\r\n }\r\n if (enumStructure.getFirstStatement() !== high) {\r\n return undefined;\r\n }\r\n const enumName = (_b = high.findExpressionAfterToken(\"ENUM\")) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const structureName = (_c = high.findExpressionAfterToken(\"STRUCTURE\")) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n let code = `TYPES ${enumName} TYPE i.\nCONSTANTS: BEGIN OF ${structureName},\\n`;\r\n let count = 1;\r\n for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {\r\n const name = (_d = e.findFirstExpression(Expressions.NamespaceSimpleName)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n let value = (_e = e.findFirstExpression(Expressions.Value)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n if (value === undefined) {\r\n value = \"VALUE \" + count++;\r\n }\r\n code += ` ${name} TYPE ${enumName} ${value},\\n`;\r\n }\r\n code += ` END OF ${structureName}.`;\r\n const start = enumStructure.getFirstToken().getStart();\r\n const end = enumStructure.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ENUM\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithTableTarget(node, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const tableExpression = target.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n return undefined;\r\n }\r\n const index = tableExpression.findDirectExpression(Expressions.Source);\r\n if (index === undefined) {\r\n return undefined;\r\n }\r\n let uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n uniqueName = `<${uniqueName}>`;\r\n const tName = target.concatTokens().split(\"[\")[0];\r\n const condition = this.tableCondition(tableExpression);\r\n const tabixBackup = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n // restore tabix before exeption\r\n const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\n${indentation}${tabixBackup} = sy-tabix.\n${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.\n${indentation}sy-tabix = ${tabixBackup}.\n${indentation}IF sy-subrc <> 0.\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\n${indentation}ENDIF.\n${indentation}${uniqueName}`;\r\n const start = target.getFirstToken().getStart();\r\n const end = (_a = tableExpression.findDirectTokenByText(\"]\")) === null || _a === void 0 ? void 0 : _a.getEnd();\r\n if (end === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, move with table target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithOperator(high, lowFile) {\r\n var _a, _b, _c;\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n const secondChild = children[1];\r\n if (secondChild === undefined) {\r\n return undefined;\r\n }\r\n const op = secondChild.getFirstToken();\r\n let operator = \"\";\r\n switch (op.getStr()) {\r\n case \"+\":\r\n operator = \" + \";\r\n break;\r\n case \"-\":\r\n operator = \" - \";\r\n break;\r\n case \"/=\":\r\n operator = \" / \";\r\n break;\r\n case \"*=\":\r\n operator = \" * \";\r\n break;\r\n case \"&&=\":\r\n operator = \" && \";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const target = (_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return;\r\n }\r\n const sourceStart = (_c = (_b = high.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstChild()) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStart();\r\n if (sourceStart === undefined) {\r\n return;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, op.getStart(), sourceStart, \"= \" + target + operator);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Expand operator\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // must be very simple string templates, like \"|{ ls_line-no ALPHA = IN }|\"\r\n stringTemplateAlpha(node, lowFile) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const topSource = node.findDirectExpression(Expressions.Source);\r\n if (topSource === undefined || topSource.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n const child = topSource.getFirstChild();\r\n if (!(child.get() instanceof Expressions.StringTemplate)) {\r\n return undefined;\r\n }\r\n const templateTokens = child.getChildren();\r\n if (templateTokens.length !== 3\r\n || templateTokens[0].getFirstToken().getStr() !== \"|{\"\r\n || templateTokens[2].getFirstToken().getStr() !== \"}|\") {\r\n return undefined;\r\n }\r\n const templateSource = child.findDirectExpression(Expressions.StringTemplateSource);\r\n const formatting = (_a = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n let functionName = \"\";\r\n switch (formatting) {\r\n case \"ALPHA = IN\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_INPUT\";\r\n break;\r\n case \"ALPHA = OUT\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_OUTPUT\";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const topTarget = (_c = node.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const code = `CALL FUNCTION '${functionName}'\n${indentation} EXPORTING\n${indentation} input = ${source}\n${indentation} IMPORTING\n${indentation} output = ${topTarget}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopInput(node, lowFile, highSyntax) {\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n else if (node.findDirectExpression(Expressions.SimpleSource2)) {\r\n return undefined;\r\n }\r\n // the first Source must be outlined\r\n const s = node.findDirectExpression(Expressions.Source);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP input\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopTarget(node, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d, _e;\r\n // also allows outlining of voided types\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const sourceName = (_a = node.findDirectExpression(Expressions.SimpleSource2)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (sourceName === undefined) {\r\n return undefined;\r\n }\r\n const concat = node.concatTokens();\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const dataTarget = (_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.InlineData);\r\n if (dataTarget) {\r\n const targetName = ((_c = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, dataTarget.getFirstToken().getStart(), dataTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP data target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n const fsTarget = (_d = node.findDirectExpression(Expressions.FSTarget)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(Expressions.InlineFS);\r\n if (fsTarget) {\r\n const targetName = ((_e = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `FIELD-SYMBOLS ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP fs target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineFor(forLoop, indentation, lowFile, highSyntax) {\r\n var _a, _b, _c, _d, _e;\r\n let body = \"\";\r\n let end = \"\";\r\n const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const loopTargetField = (_b = forLoop.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n let cond = ((_c = forLoop.findDirectExpression(Expressions.ComponentCond)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"\";\r\n if (cond !== \"\") {\r\n cond = \" WHERE \" + cond;\r\n }\r\n if (forLoop.findDirectTokenByText(\"UNTIL\")\r\n || forLoop.findDirectTokenByText(\"WHILE\")) {\r\n const fieldDef = forLoop.findDirectExpression(Expressions.InlineFieldDefinition);\r\n const field = (_d = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n const indexBackup = this.uniqueName(forLoop.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n body += indentation + \"DATA \" + field + \" TYPE i.\\n\";\r\n const second = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.getChildren()[2];\r\n if ((second === null || second === void 0 ? void 0 : second.get()) instanceof Expressions.Source) {\r\n body += indentation + field + \" = \" + second.concatTokens() + \".\\n\";\r\n }\r\n const not = forLoop.findDirectTokenByText(\"UNTIL\") ? \" NOT\" : \"\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `DATA ${indexBackup} LIKE sy-index.\\n`;\r\n body += indentation + `${indexBackup} = sy-index.\\n`;\r\n body += indentation + `WHILE${not} ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n body += indentation + ` sy-index = ${indexBackup}.\\n`;\r\n const then = forLoop.findExpressionAfterToken(\"THEN\");\r\n if (then) {\r\n end += ` ${field} = ${then.concatTokens()}.\\n`;\r\n }\r\n else {\r\n end += ` ${field} = ${field} + 1.\\n`;\r\n }\r\n end += indentation + \"ENDWHILE\";\r\n }\r\n else if (loopTargetField) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n else if (loopTargetField === undefined) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n const loopTargetFieldSymbol = (_e = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n const l = forLoop.findDirectExpression(Expressions.Let);\r\n if (l) {\r\n body += this.outlineLet(l, indentation, highSyntax, lowFile);\r\n }\r\n return { body, end };\r\n }\r\n outlineSwitch(node, lowFile, highSyntax) {\r\n var _a, _b, _c, _d;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"SWITCH\") {\r\n continue;\r\n }\r\n let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move\r\n && node.findDirectExpression(Expressions.Source) === i\r\n && ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const switchBody = i.findDirectExpression(Expressions.SwitchBody);\r\n if (switchBody === undefined) {\r\n continue;\r\n }\r\n for (const l of ((_c = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _c === void 0 ? void 0 : _c.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {\r\n name = l.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_d = switchBody.findFirstExpression(Expressions.Source)) === null || _d === void 0 ? void 0 : _d.concatTokens()}.\\n`;\r\n }\r\n body += `DATA ${uniqueName} ${type}.\\n`;\r\n let firstSource = false;\r\n let inWhen = false;\r\n for (const c of switchBody.getChildren()) {\r\n if (c.get() instanceof Expressions.Source && firstSource === false) {\r\n body += indentation + `CASE ${c.concatTokens()}.`;\r\n firstSource = true;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"THEN\") {\r\n inWhen = true;\r\n body += \".\\n\";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"WHEN\") {\r\n inWhen = false;\r\n body += `\\n${indentation} WHEN `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"OR\") {\r\n body += ` OR `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"ELSE\") {\r\n inWhen = true;\r\n body += `\\n${indentation} WHEN OTHERS.\\n`;\r\n }\r\n else if (inWhen === false) {\r\n body += c.concatTokens();\r\n }\r\n else {\r\n body += indentation + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\";\r\n }\r\n }\r\n body += \"\\n\" + indentation + \"ENDCASE.\\n\" + indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), body);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport SWITCH\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineReduce(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"REDUCE\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const reduceBody = i.findDirectExpression(Expressions.ReduceBody);\r\n if (reduceBody === undefined) {\r\n continue;\r\n }\r\n const letNode = reduceBody.findDirectExpression(Expressions.Let);\r\n if (letNode) {\r\n body += this.outlineLet(letNode, indentation, highSyntax, lowFile);\r\n }\r\n let firstName = \"\";\r\n for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n name = init.getFirstToken().getStr();\r\n if (firstName === \"\") {\r\n firstName = name;\r\n }\r\n const s = (_a = init.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const t = (_b = init.findFirstExpression(Expressions.TypeName)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (s) {\r\n body += indentation + `DATA(${name}) = ${s}.\\n`;\r\n }\r\n else {\r\n body += indentation + `DATA ${name} TYPE ${t}.\\n`;\r\n }\r\n }\r\n let end = \"\";\r\n for (const forLoop of (reduceBody === null || reduceBody === void 0 ? void 0 : reduceBody.findDirectExpressions(Expressions.For)) || []) {\r\n const outlineFor = this.outlineFor(forLoop, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n }\r\n const next = reduceBody.findDirectExpression(Expressions.ReduceNext);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n for (const n of next.getChildren()) {\r\n const concat = n.concatTokens();\r\n if (concat.toUpperCase() === \"NEXT\") {\r\n continue;\r\n }\r\n else if (n.get() instanceof Expressions.Field) {\r\n body += indentation + \" \" + concat + \" \";\r\n }\r\n else if (n.get() instanceof Expressions.Source) {\r\n body += \" \" + concat + \".\\n\";\r\n }\r\n else {\r\n body += concat;\r\n }\r\n }\r\n body += indentation + end;\r\n body += indentation + `${uniqueName} = ${firstName}.\\n`;\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport REDUCE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineValue(node, lowFile, highSyntax) {\r\n var _a;\r\n const allSources = node.findAllExpressionsRecursive(Expressions.Source);\r\n for (const s of allSources) {\r\n const firstToken = s.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"VALUE\") {\r\n continue;\r\n }\r\n let type = this.findType(s, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move && node.findDirectExpression(Expressions.Source) === s) {\r\n type = \"LIKE \" + ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const valueBody = s.findDirectExpression(Expressions.ValueBody);\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n const base = valueBody === null || valueBody === void 0 ? void 0 : valueBody.findExpressionAfterToken(\"BASE\");\r\n if (base) {\r\n body += indentation + uniqueName + \" = \" + base.concatTokens() + \".\\n\";\r\n }\r\n let end = \"\";\r\n let structureName = uniqueName;\r\n let added = false;\r\n let skip = false;\r\n let data = \"\";\r\n let previous = undefined;\r\n for (const b of (valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren()) || []) {\r\n if (b.concatTokens() === \"(\" && added === false) {\r\n structureName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n data = indentation + `DATA ${structureName} LIKE LINE OF ${uniqueName}.\\n`;\r\n }\r\n if (b.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + b.concatTokens() + \".\\n\";\r\n }\r\n else if (b instanceof nodes_1.ExpressionNode && b.get() instanceof Expressions.For) {\r\n const outlineFor = this.outlineFor(b, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n indentation += \" \";\r\n }\r\n else if (b.get() instanceof Expressions.Source) {\r\n if ((valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren().length) === 1) {\r\n body += indentation + uniqueName + \" = \" + b.concatTokens() + `.\\n`;\r\n }\r\n structureName = b.concatTokens();\r\n if (base && (valueBody === null || valueBody === void 0 ? void 0 : valueBody.findDirectTokenByText(\"(\")) === undefined) {\r\n structureName = uniqueName;\r\n }\r\n }\r\n else if (b.get() instanceof Expressions.ValueBodyLines) {\r\n body += indentation + \"APPEND \" + b.concatTokens() + ` TO ${uniqueName}.\\n`;\r\n skip = true;\r\n }\r\n else if (b instanceof nodes_1.ExpressionNode && b.get() instanceof Expressions.Let) {\r\n body += this.outlineLet(b, indentation, highSyntax, lowFile);\r\n }\r\n else if (b.concatTokens() === \")\") {\r\n if (added === false && (previous === null || previous === void 0 ? void 0 : previous.concatTokens()) === \"(\") {\r\n body += data;\r\n added = true;\r\n }\r\n if (skip === false) {\r\n body += indentation + `APPEND ${structureName} TO ${uniqueName}.\\n`;\r\n }\r\n skip = false;\r\n }\r\n previous = b;\r\n }\r\n if (end !== \"\") {\r\n indentation = indentation.substring(2);\r\n body += indentation + end;\r\n }\r\n const abap = `DATA ${uniqueName} ${type}.\\n` +\r\n indentation + `CLEAR ${uniqueName}.\\n` + // might be called inside a loop\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport VALUE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineLet(node, indentation, highSyntax, lowFile) {\r\n var _a;\r\n let ret = \"\";\r\n for (const f of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n const c = f.getFirstChild();\r\n if (c === undefined) {\r\n continue;\r\n }\r\n const name = c.concatTokens().toLowerCase();\r\n const spag = highSyntax.spaghetti.lookupPosition(c.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + \"DATA(\" + name + `) = ${source.concatTokens()}.\\n`;\r\n }\r\n continue;\r\n }\r\n const type = found.getType().getQualifiedName() ? (_a = found.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase() : found.getType().toABAP();\r\n ret += indentation + \"DATA \" + name + ` TYPE ${type}.\\n`;\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + name + ` = ${source.concatTokens()}.\\n`;\r\n }\r\n }\r\n return ret;\r\n }\r\n findType(i, lowFile, highSyntax, ref = false) {\r\n var _a;\r\n const expr = i.findDirectExpression(Expressions.TypeNameOrInfer);\r\n if (expr === undefined) {\r\n return undefined;\r\n }\r\n const firstToken = expr.getFirstToken();\r\n const concat = expr.concatTokens().toLowerCase();\r\n if (concat !== \"#\") {\r\n return ref ? \"REF TO \" + concat : concat;\r\n }\r\n const spag = highSyntax.spaghetti.lookupPosition(firstToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n return undefined;\r\n }\r\n let inferred = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.InferredType\r\n && r.resolved\r\n && r.position.getStart().equals(firstToken.getStart())\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier) {\r\n inferred = r.resolved;\r\n break;\r\n }\r\n }\r\n if (inferred === undefined) {\r\n return undefined;\r\n }\r\n if (inferred.getType() instanceof basic_1.ObjectReferenceType) {\r\n return inferred.getType().toABAP();\r\n }\r\n else {\r\n return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n }\r\n }\r\n outlineFS(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineFS)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n let type = \"\";\r\n if (node.concatTokens().toUpperCase().startsWith(\"APPEND INITIAL LINE TO \")) {\r\n type = \"LIKE LINE OF \" + ((_b = node.findFirstExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n else {\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType) {\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Error outlining voided type\", this.getMetadata().key, this.conf.severity);\r\n }\r\n type = \"TYPE \";\r\n type += found.getType().getQualifiedName() ? found.getType().getQualifiedName().toLowerCase() : found.getType().toABAP();\r\n }\r\n const code = `FIELD-SYMBOLS ${name} ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline FIELD-SYMBOL\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineData(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineData)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType && found.getType().getQualifiedName() === undefined) {\r\n continue;\r\n }\r\n let type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n if (found.getType() instanceof basic_1.ObjectReferenceType) {\r\n type = found.getType().toABAP();\r\n }\r\n const code = `DATA ${name} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineCond(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"COND\") {\r\n continue;\r\n }\r\n const body = i.findDirectExpression(Expressions.CondBody);\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move\r\n && node.findDirectExpression(Expressions.Source) === i\r\n && ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);\r\n const abap = `DATA ${uniqueName} ${type}.\\n` + bodyCode;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport COND\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n buildCondBody(body, uniqueName, indent, lowFile, highSyntax) {\r\n let code = \"\";\r\n let first = true;\r\n let addElse = true;\r\n for (const c of body.getChildren()) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n switch (c.getFirstToken().getStr().toUpperCase()) {\r\n case \"WHEN\":\r\n if (first === true) {\r\n code += indent + \"IF \";\r\n first = false;\r\n }\r\n else {\r\n code += indent + \"ELSEIF \";\r\n }\r\n break;\r\n case \"THEN\":\r\n code += \".\\n\";\r\n break;\r\n case \"ELSE\":\r\n code += indent + \"ELSE.\\n\";\r\n addElse = false;\r\n break;\r\n default:\r\n throw \"buildCondBody, unexpected token\";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Cond) {\r\n code += c.concatTokens();\r\n }\r\n else if (c.get() instanceof Expressions.Let) {\r\n code += this.outlineLet(c, indent, highSyntax, lowFile);\r\n }\r\n else if (c.get() instanceof Expressions.Source) {\r\n code += indent + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\\n\";\r\n }\r\n else {\r\n throw \"buildCondBody, unexpected expression, \" + c.get().constructor.name;\r\n }\r\n }\r\n if (addElse) {\r\n // COND might be called inside a loop\r\n code += indent + \"ELSE.\\n\";\r\n code += indent + ` CLEAR ${uniqueName}.\\n`;\r\n }\r\n code += indent + \"ENDIF.\\n\";\r\n code += indent;\r\n return code;\r\n }\r\n outlineConv(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"CONV\") {\r\n continue;\r\n }\r\n const end = i.findDirectTokenByText(\")\");\r\n if (end === undefined) {\r\n continue;\r\n }\r\n const body = (_a = i.findDirectExpression(Expressions.ConvBody)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n indent + `${uniqueName} = ${body}.\\n` +\r\n indent;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), end.getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CONV\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n // \"CAST\" to \"?=\"\r\n outlineCast(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Cast)) {\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax, true);\r\n const body = (_a = i.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1) +\r\n `${uniqueName} ?= ${body}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CAST\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n uniqueName(position, filename, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(position, filename);\r\n if (spag === undefined) {\r\n const name = \"temprr\" + this.counter;\r\n this.counter++;\r\n return name;\r\n }\r\n while (true) {\r\n const name = \"temp\" + this.counter;\r\n const found = spag.findVariable(name);\r\n this.counter++;\r\n if (found === undefined) {\r\n return name;\r\n }\r\n }\r\n }\r\n replaceXsdBool(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference\r\n && r.position.getName().toUpperCase() === \"XSDBOOL\") {\r\n const token = r.position.getToken();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, token.getStart(), token.getEnd(), \"boolc\");\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n findMethodCallExpression(node, token) {\r\n var _a;\r\n for (const m of node.findAllExpressions(Expressions.MethodCall)) {\r\n if ((_a = m.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStart().equals(token.getStart())) {\r\n return m;\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceMethodConditional(node, lowFile, highSyntax) {\r\n for (const c of node.findAllExpressionsRecursive(Expressions.Compare)) {\r\n const chain = c.findDirectExpression(Expressions.MethodCallChain);\r\n if (chain === undefined) {\r\n continue;\r\n }\r\n let predicate = false;\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference &&\r\n new _builtin_1.BuiltIn().isPredicate(chain.getFirstToken().getStr().toUpperCase())) {\r\n predicate = true;\r\n break;\r\n }\r\n }\r\n const end = chain.getLastToken().getEnd();\r\n let fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" IS NOT INITIAL\");\r\n if (predicate === true) {\r\n fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" ) = abap_true\");\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, chain.getFirstToken().getStart(), \"boolc( \");\r\n fix = edit_helper_1.EditHelper.merge(fix, fix1);\r\n }\r\n return issue_1.Issue.atToken(lowFile, chain.getFirstToken(), \"Downport method conditional\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceContains(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n // only downport if its an single method call condition\r\n let found = false;\r\n for (const c of node.findAllExpressionsRecursive(Expressions.Compare)) {\r\n found = c.findDirectExpression(Expressions.MethodCallChain) !== undefined;\r\n if (found === true) {\r\n break;\r\n }\r\n }\r\n if (found === false) {\r\n return undefined;\r\n }\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"CONTAINS\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n const sList = expression.findAllExpressions(Expressions.Source).map(e => e.concatTokens());\r\n if (sList.length !== 2) {\r\n continue;\r\n }\r\n const code = sList[0] + \" CS \" + sList[1];\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, token, \"Downport contains()\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceLineFunctions(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"LINE_EXISTS\" || func === \"LINE_INDEX\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n let condition = \"\";\r\n for (const c of ((_a = expression === null || expression === void 0 ? void 0 : expression.findFirstExpression(Expressions.TableExpression)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n const tableName = (_b = expression.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens().split(\"[\")[0];\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const sy = func === \"LINE_EXISTS\" ? \"sy-subrc\" : \"sy-tabix\";\r\n const code = `DATA ${uniqueName} LIKE sy-subrc.\\n` +\r\n indentation + `READ TABLE ${tableName} ${condition}TRANSPORTING NO FIELDS.\\n` +\r\n indentation + uniqueName + ` = ${sy}.\\n` +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, uniqueName + (func === \"LINE_EXISTS\" ? \" = 0\" : \"\"));\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newToCreateObject(node, lowFile, highSyntax) {\r\n const source = node.findDirectExpression(Expressions.Source);\r\n let fix = undefined;\r\n if (node.get() instanceof Statements.Move\r\n && source\r\n && source.getFirstToken().getStr().toUpperCase() === \"NEW\") {\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const found = source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.NewObject);\r\n // must be at top level of the source for quickfix to work(todo: handle more scenarios)\r\n // todo, assumption: the target is not an inline definition\r\n if (target && found && source.concatTokens() === found.concatTokens()) {\r\n const abap = this.newParameters(found, target.concatTokens(), highSyntax, lowFile);\r\n if (abap !== undefined) {\r\n fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), abap);\r\n }\r\n }\r\n }\r\n if (fix === undefined && node.findAllExpressions(Expressions.NewObject)) {\r\n const found = node.findFirstExpression(Expressions.NewObject);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const name = this.uniqueName(found.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const abap = this.newParameters(found, name, highSyntax, lowFile);\r\n if (abap === undefined) {\r\n return undefined;\r\n }\r\n const type = this.findType(found, lowFile, highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const data = `DATA ${name} TYPE REF TO ${type}.\\n` +\r\n indentation + abap + \"\\n\" +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), data);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), name);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n }\r\n if (fix) {\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Use CREATE OBJECT instead of NEW\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n newParameters(found, name, highSyntax, lowFile) {\r\n var _a, _b, _c;\r\n const typeToken = (_a = found.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n let extra = (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr()) === \"#\" ? \"\" : \" TYPE \" + (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr());\r\n const parameters = found.findFirstExpression(Expressions.ParameterListS);\r\n if (parameters) {\r\n extra = parameters ? extra + \" EXPORTING \" + parameters.concatTokens() : extra;\r\n }\r\n else if (typeToken) {\r\n const source = (_b = found.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (source) {\r\n // find the default parameter name for the constructor\r\n const spag = highSyntax.spaghetti.lookupPosition(typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStart(), lowFile.getFilename());\r\n let cdef = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if ((r.referenceType === _reference_1.ReferenceType.InferredType\r\n || r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference)\r\n && r.resolved && r.position.getStart().equals(typeToken.getStart())) {\r\n cdef = r.resolved;\r\n }\r\n }\r\n if (cdef && cdef.getMethodDefinitions === undefined) {\r\n return undefined; // something wrong\r\n }\r\n const importing = (_c = cdef === null || cdef === void 0 ? void 0 : cdef.getMethodDefinitions().getByName(\"CONSTRUCTOR\")) === null || _c === void 0 ? void 0 : _c.getParameters().getDefaultImporting();\r\n if (importing) {\r\n extra += \" EXPORTING \" + importing + \" = \" + source;\r\n }\r\n else if (spag === undefined) {\r\n extra += \" SpagUndefined\";\r\n }\r\n else if (cdef === undefined) {\r\n extra += \" ClassDefinitionNotFound\";\r\n }\r\n else {\r\n extra += \" SomeError\";\r\n }\r\n }\r\n }\r\n const abap = `CREATE OBJECT ${name}${extra}.`;\r\n return abap;\r\n }\r\n}\r\nexports.Downport = Downport;\r\n//# sourceMappingURL=downport.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/downport.js?");
11756
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Downport = exports.DownportConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst registry_1 = __webpack_require__(/*! ../registry */ \"./node_modules/@abaplint/core/build/src/registry.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst config_1 = __webpack_require__(/*! ../config */ \"./node_modules/@abaplint/core/build/src/config.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\n// todo: refactor each sub-rule to new classes?\r\n// todo: add configuration\r\nclass DownportConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.DownportConf = DownportConf;\r\nclass Downport {\r\n constructor() {\r\n this.conf = new DownportConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"downport\",\r\n title: \"Downport statement\",\r\n shortDescription: `Experimental downport functionality`,\r\n extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with\r\na higher level language version. If successful, various rules are applied to downport the statement.\r\nTarget downport version is always v702, thus rule is only enabled if target version is v702.\r\n\r\nCurrent rules:\r\n* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/\r\n* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/\r\n* FIELD-SYMBOL() definitions are outlined\r\n* CONV is outlined\r\n* COND is outlined\r\n* REDUCE is outlined\r\n* SWITCH is outlined\r\n* APPEND expression is outlined\r\n* INSERT expression is outlined\r\n* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/\r\n* CAST changed to ?=\r\n* LOOP AT method_call( ) is outlined\r\n* VALUE # with structure fields\r\n* VALUE # with internal table lines\r\n* Table Expressions are outlined\r\n* SELECT INTO @DATA definitions are outlined\r\n* Some occurrences of string template formatting option ALPHA changed to function module call\r\n* SELECT/INSERT/MODIFY/DELETE/UPDATE \",\" in field list removed, \"@\" in source/targets removed\r\n* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods\r\n* RAISE EXCEPTION ... MESSAGE\r\n* Moving with +=, -=, /=, *=, &&= is expanded\r\n* line_exists and line_index is downported to READ TABLE\r\n* ENUMs, but does not nessesarily give the correct type and value\r\n* MESSAGE with non simple source\r\n\r\nOnly one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.`,\r\n tags: [_irule_1.RuleTag.Experimental, _irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.lowReg = reg;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version === version_1.Version.v702 || version === version_1.Version.OpenABAP) {\r\n this.initHighReg();\r\n this.graph = new include_graph_1.IncludeGraph(reg);\r\n }\r\n return this;\r\n }\r\n run(lowObj) {\r\n var _a;\r\n const ret = [];\r\n this.counter = 1;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version !== version_1.Version.v702 && version !== version_1.Version.OpenABAP) {\r\n return ret;\r\n }\r\n else if (!(lowObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n const highObj = this.highReg.getObject(lowObj.getType(), lowObj.getName());\r\n if (highObj === undefined || !(highObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n let highSyntaxObj = highObj;\r\n // for includes do the syntax check via a main program\r\n if (lowObj instanceof objects_1.Program && lowObj.isInclude()) {\r\n const mains = this.graph.listMainForInclude((_a = lowObj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename());\r\n if (mains.length <= 0) {\r\n return [];\r\n }\r\n const f = this.highReg.getFileByName(mains[0]);\r\n if (f === undefined) {\r\n return [];\r\n }\r\n highSyntaxObj = this.highReg.findObjectForFile(f);\r\n }\r\n const highSyntax = new syntax_1.SyntaxLogic(this.highReg, highSyntaxObj).run();\r\n for (const lowFile of lowObj.getABAPFiles()) {\r\n const highFile = highObj.getABAPFileByName(lowFile.getFilename());\r\n if (highFile === undefined) {\r\n continue;\r\n }\r\n const lowStatements = lowFile.getStatements();\r\n const highStatements = highFile.getStatements();\r\n if (lowStatements.length !== highStatements.length) {\r\n // after applying a fix, there might be more statements in lowFile\r\n // should highReg be initialized again?\r\n /*\r\n const message = \"Internal Error: Statement lengths does not match\";\r\n ret.push(Issue.atStatement(lowFile, lowStatements[0], message, this.getMetadata().key));\r\n */\r\n continue;\r\n }\r\n for (let i = 0; i < lowStatements.length; i++) {\r\n const low = lowStatements[i];\r\n const high = highStatements[i];\r\n if ((low.get() instanceof _statement_1.Unknown && !(high.get() instanceof _statement_1.Unknown))\r\n || high.findFirstExpression(Expressions.InlineData)) {\r\n const issue = this.checkStatement(low, high, lowFile, highSyntax, highFile);\r\n if (issue) {\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n ////////////////////\r\n /** clones the orginal repository into highReg, and parses it with higher language version */\r\n initHighReg() {\r\n // use default configuration, ie. default target version\r\n const highConfig = config_1.Config.getDefault().get();\r\n const lowConfig = this.lowReg.getConfig().get();\r\n highConfig.syntax.errorNamespace = lowConfig.syntax.errorNamespace;\r\n highConfig.syntax.globalConstants = lowConfig.syntax.globalConstants;\r\n highConfig.syntax.globalMacros = lowConfig.syntax.globalMacros;\r\n this.highReg = new registry_1.Registry();\r\n for (const o of this.lowReg.getObjects()) {\r\n for (const f of o.getFiles()) {\r\n if (this.lowReg.isDependency(o) === true) {\r\n this.highReg.addDependency(f);\r\n }\r\n else {\r\n this.highReg.addFile(f);\r\n }\r\n }\r\n }\r\n this.highReg.parse();\r\n }\r\n /** applies one rule at a time, multiple iterations are required to transform complex statements */\r\n checkStatement(low, high, lowFile, highSyntax, highFile) {\r\n if (low.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n return undefined;\r\n }\r\n let found = this.downportEnum(low, high, lowFile, highSyntax, highFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.partiallyImplemented(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.raiseException(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.emptyKey(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.stringTemplateAlpha(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithOperator(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithSimpleValue(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithTableTarget(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSQLExtras(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopInput(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopTarget(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineValue(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineReduce(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineSwitch(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCast(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineConv(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCond(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCatchSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineDataSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineData(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineFS(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.newToCreateObject(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceXsdBool(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceLineFunctions(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceContains(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceMethodConditional(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceTableExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceAppendExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceInsertExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportMessage(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n //////////////////////////////////////////\r\n downportSQLExtras(low, high, lowFile, _highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Select)\r\n && !(high.get() instanceof Statements.SelectLoop)\r\n && !(high.get() instanceof Statements.UpdateDatabase)\r\n && !(high.get() instanceof Statements.ModifyDatabase)\r\n && !(high.get() instanceof Statements.DeleteDatabase)\r\n && !(high.get() instanceof Statements.InsertDatabase)) {\r\n return undefined;\r\n }\r\n let fix = undefined;\r\n const addFix = (token) => {\r\n const add = edit_helper_1.EditHelper.deleteToken(lowFile, token);\r\n if (fix === undefined) {\r\n fix = add;\r\n }\r\n else {\r\n fix = edit_helper_1.EditHelper.merge(fix, add);\r\n }\r\n };\r\n const candidates = [high.findAllExpressionsRecursive(Expressions.SQLTarget),\r\n high.findAllExpressionsRecursive(Expressions.SQLSource),\r\n high.findAllExpressionsRecursive(Expressions.SQLSourceSimple)].flat();\r\n for (const c of candidates) {\r\n if (c.getFirstToken() instanceof tokens_1.WAt) {\r\n addFix(c.getFirstToken());\r\n }\r\n }\r\n for (const fieldList of high.findAllExpressionsMulti([Expressions.SQLFieldList, Expressions.SQLFieldListLoop], true)) {\r\n for (const token of fieldList.getDirectTokens()) {\r\n if (token.getStr() === \",\") {\r\n addFix(token);\r\n }\r\n }\r\n }\r\n if (fix === undefined) {\r\n return undefined;\r\n }\r\n else {\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove \\\" and ,\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n downportSelectInline(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Select) && !(high.get() instanceof Statements.SelectLoop)) {\r\n return undefined;\r\n }\r\n // as first step outline the @DATA, note that void types are okay, as long the field names are specified\r\n let found = this.downportSelectSingleInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectTableInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n downportSelectSingleInline(_low, high, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoStructure)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length !== 1) {\r\n return undefined;\r\n }\r\n const tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n fieldList = high.findFirstExpression(Expressions.SQLFieldListLoop);\r\n }\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinition = \"\";\r\n const fields = fieldList.findDirectExpressions(Expressions.SQLFieldName);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n if (fields.length === 1) {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${fields[0].concatTokens()}.`;\r\n }\r\n else if (fieldList.concatTokens() === \"*\") {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}.`;\r\n }\r\n else if (fieldList.concatTokens().toUpperCase() === \"COUNT( * )\") {\r\n fieldDefinition = `DATA ${name} TYPE i.`;\r\n }\r\n else if (fieldList.getChildren().length === 1 && fieldList.getChildren()[0].get() instanceof Expressions.SQLAggregation) {\r\n const c = fieldList.getChildren()[0];\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n const concat = (_d = c.findFirstExpression(Expressions.SQLArithmetics)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${concat}.`;\r\n }\r\n }\r\n else {\r\n for (const f of fields) {\r\n const fieldName = f.concatTokens();\r\n fieldDefinition += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n fieldDefinition = `DATA: BEGIN OF ${name},\r\n${fieldDefinition}${indentation} END OF ${name}.`;\r\n }\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportSelectTableInline(_low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length === 0) {\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Error outlining, sqlFrom not found\", this.getMetadata().key, this.conf.severity);\r\n }\r\n let tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinitions = \"\";\r\n for (const f of fieldList.findDirectExpressions(Expressions.SQLFieldName)) {\r\n let fieldName = f.concatTokens();\r\n if (fieldName.includes(\"~\")) {\r\n const split = fieldName.split(\"~\");\r\n tableName = split[0];\r\n fieldName = split[1];\r\n }\r\n fieldDefinitions += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},\r\n${fieldDefinitions}${indentation} END OF ${uniqueName}.\r\n${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n if (fieldDefinitions === \"\") {\r\n fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n }\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportMessage(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Message)) {\r\n return undefined;\r\n }\r\n const foundWith = high.findExpressionAfterToken(\"WITH\");\r\n if (foundWith === undefined) {\r\n return undefined;\r\n }\r\n const likeSource = high.findExpressionAfterToken(\"LIKE\");\r\n for (const s of high.findAllExpressions(Expressions.Source)) {\r\n if (s === likeSource) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Refactor MESSAGE WITH source\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceAppendExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Append)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\r\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline APPEND source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceInsertExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.InsertInternal)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\r\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline INSERT source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceTableExpression(node, lowFile, highSyntax) {\r\n for (const fieldChain of node.findAllExpressionsRecursive(Expressions.FieldChain)) {\r\n const tableExpression = fieldChain.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n continue;\r\n }\r\n const concat = node.concatTokens().toUpperCase();\r\n if (concat.includes(\" LINE_EXISTS( \") || concat.includes(\" LINE_INDEX( \")) {\r\n // note: line_exists() must be replaced before handling table expressions\r\n continue;\r\n }\r\n let pre = \"\";\r\n let startToken = undefined;\r\n for (const child of fieldChain.getChildren()) {\r\n if (startToken === undefined) {\r\n startToken = child.getFirstToken();\r\n }\r\n else if (child === tableExpression) {\r\n break;\r\n }\r\n pre += child.concatTokens();\r\n }\r\n if (startToken === undefined) {\r\n continue;\r\n }\r\n const condition = this.tableCondition(tableExpression);\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const tabixBackup = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n // note that the tabix restore should be done before throwing the exception\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.\r\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\r\n${indentation}${tabixBackup} = sy-tabix.\r\n${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.\r\n${indentation}sy-tabix = ${tabixBackup}.\r\n${indentation}IF sy-subrc <> 0.\r\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\r\n${indentation}ENDIF.\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline table expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n tableCondition(tableExpression) {\r\n let condition = \"\";\r\n let keyName = \"\";\r\n for (const c of tableExpression.getChildren() || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n if (keyName === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else {\r\n condition = \"WITH TABLE KEY \" + keyName + \" COMPONENTS \";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.getFirstToken().getStr().toUpperCase() === \"KEY\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.SimpleName) {\r\n keyName = c.concatTokens();\r\n continue;\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n return condition;\r\n }\r\n outlineCatchSimple(node, lowFile) {\r\n // outlines \"CATCH cx_bcs INTO DATA(lx_bcs_excep).\", note that this does not need to look at types\r\n var _a, _b;\r\n if (!(node.get() instanceof Statements.Catch)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n const classNames = node.findDirectExpressions(Expressions.ClassName);\r\n if (classNames.length !== 1) {\r\n return undefined;\r\n }\r\n const className = classNames[0].concatTokens();\r\n const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const code = ` DATA ${targetName} TYPE REF TO ${className}.\r\n${indentation}CATCH ${className} INTO ${targetName}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineDataSimple(node, lowFile) {\r\n // outlines \"DATA(ls_msg) = temp1.\", note that this does not need to look at types\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n let type = \"\";\r\n const source = node.findFirstExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n else if (source.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n else if (!(((_b = source.getFirstChild()) === null || _b === void 0 ? void 0 : _b.get()) instanceof Expressions.FieldChain)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldOffset)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldLength)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.TableExpression)) {\r\n const chain = source.findDirectExpression(Expressions.FieldChain);\r\n if (chain !== undefined\r\n && chain.getChildren().length === 2\r\n && chain.getChildren()[0].get() instanceof Expressions.SourceField\r\n && chain.getChildren()[1].get() instanceof Expressions.TableExpression) {\r\n type = \"LINE OF \" + chain.getChildren()[0].concatTokens();\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n type = source.concatTokens();\r\n }\r\n const targetName = (_c = target.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const lastToken = node.getLastToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${targetName} LIKE ${type}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), lastToken.getEnd(), `${targetName} = ${source.concatTokens()}.`);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n partiallyImplemented(node, lowFile) {\r\n if (node.get() instanceof Statements.InterfaceDef) {\r\n const partially = node.findDirectTokenByText(\"PARTIALLY\");\r\n if (partially === undefined) {\r\n return undefined;\r\n }\r\n const implemented = node.findDirectTokenByText(\"IMPLEMENTED\");\r\n if (implemented === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(lowFile, partially.getStart(), implemented.getEnd());\r\n return issue_1.Issue.atToken(lowFile, partially, \"Downport PARTIALLY IMPLEMENTED\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n raiseException(node, lowFile, highSyntax) {\r\n /*\r\n Note: IF_T100_DYN_MSG does not exist in 702, so this rule is mostly relevant for the transpiler\r\n \r\n DATA foo LIKE if_t100_message=>t100key.\r\n foo-msgid = 'ZHVAM'.\r\n foo-msgno = '001'.\r\n foo-attr1 = 'IF_T100_DYN_MSG~MSGV1'.\r\n foo-attr2 = 'IF_T100_DYN_MSG~MSGV2'.\r\n foo-attr3 = 'IF_T100_DYN_MSG~MSGV3'.\r\n foo-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\r\n DATA bar TYPE REF TO zcl_hvam_exception.\r\n CREATE OBJECT bar EXPORTING textid = foo.\r\n bar->if_t100_dyn_msg~msgty = 'E'.\r\n bar->if_t100_dyn_msg~msgv1 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv2 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv3 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv4 = 'abc'.\r\n RAISE EXCEPTION bar.\r\n */\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Raise)) {\r\n return undefined;\r\n }\r\n let id = undefined;\r\n let number = undefined;\r\n let startToken = node.findDirectTokenByText(\"ID\");\r\n if (startToken) {\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n id = sources[0].concatTokens();\r\n const numberExpression = node.findExpressionAfterToken(\"NUMBER\");\r\n if (numberExpression === undefined) {\r\n throw \"downport raiseException, could not find number\";\r\n }\r\n number = numberExpression.concatTokens();\r\n if (numberExpression.get() instanceof Expressions.MessageNumber) {\r\n number = \"'\" + number + \"'\";\r\n }\r\n }\r\n else {\r\n const s = node.findDirectExpression(Expressions.MessageSource);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n id = \"'\" + ((_a = s.findDirectExpression(Expressions.MessageClass)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + \"'\";\r\n number = \"'\" + ((_b = s.findDirectExpression(Expressions.MessageTypeAndNumber)) === null || _b === void 0 ? void 0 : _b.concatTokens().substring(1)) + \"'\";\r\n startToken = node.getFirstToken();\r\n }\r\n const className = ((_c = node.findDirectExpression(Expressions.ClassName)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"ERROR\";\r\n const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.\r\n${indentation}${uniqueName1}-msgid = ${id === null || id === void 0 ? void 0 : id.toUpperCase()}.\r\n${indentation}${uniqueName1}-msgno = ${number}.\r\n${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.\r\n${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\r\n${indentation}RAISE EXCEPTION ${uniqueName2}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), abap);\r\n return issue_1.Issue.atToken(lowFile, startToken, \"Downport RAISE MESSAGE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n emptyKey(node, lowFile) {\r\n for (let i of node.findAllExpressions(Expressions.TypeTable)) {\r\n const key = i.findDirectExpression(Expressions.TypeTableKey);\r\n if (key === undefined) {\r\n continue;\r\n }\r\n i = key;\r\n const concat = i.concatTokens();\r\n if (concat.toUpperCase().includes(\"WITH EMPTY KEY\") === false) {\r\n continue;\r\n }\r\n const token = i.findDirectTokenByText(\"EMPTY\");\r\n if (token === undefined) {\r\n continue;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceToken(lowFile, token, \"DEFAULT\");\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport EMPTY KEY\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n moveWithSimpleValue(high, lowFile) {\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n const field = target.findDirectExpression(Expressions.TargetField);\r\n if (field === undefined) {\r\n return;\r\n }\r\n const valueBody = source.findDirectExpression(Expressions.ValueBody);\r\n if (valueBody === undefined || valueBody.getChildren().length !== 1) {\r\n return;\r\n }\r\n const fieldAssignment = valueBody.findDirectExpression(Expressions.FieldAssignment);\r\n if (fieldAssignment === undefined) {\r\n return;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const code = `CLEAR ${target.concatTokens()}.\\n` + indentation + target.concatTokens() + \"-\" + fieldAssignment.concatTokens();\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, simple move\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // note, downporting ENUM does not give the correct types, but it will work in most cases?\r\n downportEnum(_low, high, lowFile, _highSyntax, highFile) {\r\n var _a, _b, _c, _d, _e;\r\n if (!(high.get() instanceof Statements.TypeEnumBegin)) {\r\n return undefined;\r\n }\r\n const enumStructure = (_a = highFile.getStructure()) === null || _a === void 0 ? void 0 : _a.findFirstStructure(Structures.TypeEnum);\r\n if (enumStructure === undefined) {\r\n return undefined;\r\n }\r\n if (enumStructure.getFirstStatement() !== high) {\r\n return undefined;\r\n }\r\n const enumName = (_b = high.findExpressionAfterToken(\"ENUM\")) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const structureName = (_c = high.findExpressionAfterToken(\"STRUCTURE\")) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n let code = `TYPES ${enumName} TYPE i.\r\nCONSTANTS: BEGIN OF ${structureName},\\n`;\r\n let count = 1;\r\n for (const e of enumStructure.findDirectStatements(Statements.TypeEnum).concat(enumStructure.findDirectStatements(Statements.Type))) {\r\n const name = (_d = e.findFirstExpression(Expressions.NamespaceSimpleName)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n let value = (_e = e.findFirstExpression(Expressions.Value)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n if (value === undefined) {\r\n value = \"VALUE \" + count++;\r\n }\r\n code += ` ${name} TYPE ${enumName} ${value},\\n`;\r\n }\r\n code += ` END OF ${structureName}.`;\r\n const start = enumStructure.getFirstToken().getStart();\r\n const end = enumStructure.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport ENUM\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithTableTarget(node, high, lowFile, highSyntax) {\r\n var _a;\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const tableExpression = target.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n return undefined;\r\n }\r\n const index = tableExpression.findDirectExpression(Expressions.Source);\r\n if (index === undefined) {\r\n return undefined;\r\n }\r\n let uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n uniqueName = `<${uniqueName}>`;\r\n const tName = target.concatTokens().split(\"[\")[0];\r\n const condition = this.tableCondition(tableExpression);\r\n const tabixBackup = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n // restore tabix before exeption\r\n const code = `FIELD-SYMBOLS ${uniqueName} LIKE LINE OF ${tName}.\r\n${indentation}DATA ${tabixBackup} LIKE sy-tabix.\r\n${indentation}${tabixBackup} = sy-tabix.\r\n${indentation}READ TABLE ${tName} ${condition}ASSIGNING ${uniqueName}.\r\n${indentation}sy-tabix = ${tabixBackup}.\r\n${indentation}IF sy-subrc <> 0.\r\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\r\n${indentation}ENDIF.\r\n${indentation}${uniqueName}`;\r\n const start = target.getFirstToken().getStart();\r\n const end = (_a = tableExpression.findDirectTokenByText(\"]\")) === null || _a === void 0 ? void 0 : _a.getEnd();\r\n if (end === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, move with table target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithOperator(high, lowFile) {\r\n var _a, _b, _c;\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n const secondChild = children[1];\r\n if (secondChild === undefined) {\r\n return undefined;\r\n }\r\n const op = secondChild.getFirstToken();\r\n let operator = \"\";\r\n switch (op.getStr()) {\r\n case \"+\":\r\n operator = \" + \";\r\n break;\r\n case \"-\":\r\n operator = \" - \";\r\n break;\r\n case \"/=\":\r\n operator = \" / \";\r\n break;\r\n case \"*=\":\r\n operator = \" * \";\r\n break;\r\n case \"&&=\":\r\n operator = \" && \";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const target = (_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return;\r\n }\r\n const sourceStart = (_c = (_b = high.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstChild()) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStart();\r\n if (sourceStart === undefined) {\r\n return;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, op.getStart(), sourceStart, \"= \" + target + operator);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Expand operator\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // must be very simple string templates, like \"|{ ls_line-no ALPHA = IN }|\"\r\n stringTemplateAlpha(node, lowFile) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const topSource = node.findDirectExpression(Expressions.Source);\r\n if (topSource === undefined || topSource.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n const child = topSource.getFirstChild();\r\n if (!(child.get() instanceof Expressions.StringTemplate)) {\r\n return undefined;\r\n }\r\n const templateTokens = child.getChildren();\r\n if (templateTokens.length !== 3\r\n || templateTokens[0].getFirstToken().getStr() !== \"|{\"\r\n || templateTokens[2].getFirstToken().getStr() !== \"}|\") {\r\n return undefined;\r\n }\r\n const templateSource = child.findDirectExpression(Expressions.StringTemplateSource);\r\n const formatting = (_a = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n let functionName = \"\";\r\n switch (formatting) {\r\n case \"ALPHA = IN\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_INPUT\";\r\n break;\r\n case \"ALPHA = OUT\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_OUTPUT\";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const topTarget = (_c = node.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const code = `CALL FUNCTION '${functionName}'\r\n${indentation} EXPORTING\r\n${indentation} input = ${source}\r\n${indentation} IMPORTING\r\n${indentation} output = ${topTarget}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopInput(node, lowFile, highSyntax) {\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n else if (node.findDirectExpression(Expressions.SimpleSource2)) {\r\n return undefined;\r\n }\r\n // the first Source must be outlined\r\n const s = node.findDirectExpression(Expressions.Source);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP input\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopTarget(node, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d, _e;\r\n // also allows outlining of voided types\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const sourceName = (_a = node.findDirectExpression(Expressions.SimpleSource2)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (sourceName === undefined) {\r\n return undefined;\r\n }\r\n const concat = node.concatTokens();\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const dataTarget = (_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.InlineData);\r\n if (dataTarget) {\r\n const targetName = ((_c = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, dataTarget.getFirstToken().getStart(), dataTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP data target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n const fsTarget = (_d = node.findDirectExpression(Expressions.FSTarget)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(Expressions.InlineFS);\r\n if (fsTarget) {\r\n const targetName = ((_e = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `FIELD-SYMBOLS ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP fs target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineFor(forLoop, indentation, lowFile, highSyntax) {\r\n var _a, _b, _c, _d, _e;\r\n let body = \"\";\r\n let end = \"\";\r\n const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const loopTargetField = (_b = forLoop.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n let cond = ((_c = forLoop.findDirectExpression(Expressions.ComponentCond)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"\";\r\n if (cond !== \"\") {\r\n cond = \" WHERE \" + cond;\r\n }\r\n if (forLoop.findDirectTokenByText(\"UNTIL\")\r\n || forLoop.findDirectTokenByText(\"WHILE\")) {\r\n const fieldDef = forLoop.findDirectExpression(Expressions.InlineFieldDefinition);\r\n const field = (_d = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.findFirstExpression(Expressions.Field)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n const indexBackup = this.uniqueName(forLoop.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n body += indentation + \"DATA \" + field + \" TYPE i.\\n\";\r\n const second = fieldDef === null || fieldDef === void 0 ? void 0 : fieldDef.getChildren()[2];\r\n if ((second === null || second === void 0 ? void 0 : second.get()) instanceof Expressions.Source) {\r\n body += indentation + field + \" = \" + second.concatTokens() + \".\\n\";\r\n }\r\n const not = forLoop.findDirectTokenByText(\"UNTIL\") ? \" NOT\" : \"\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `DATA ${indexBackup} LIKE sy-index.\\n`;\r\n body += indentation + `${indexBackup} = sy-index.\\n`;\r\n body += indentation + `WHILE${not} ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n body += indentation + ` sy-index = ${indexBackup}.\\n`;\r\n const then = forLoop.findExpressionAfterToken(\"THEN\");\r\n if (then) {\r\n end += ` ${field} = ${then.concatTokens()}.\\n`;\r\n }\r\n else {\r\n end += ` ${field} = ${field} + 1.\\n`;\r\n }\r\n end += indentation + \"ENDWHILE\";\r\n }\r\n else if (loopTargetField) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n else if (loopTargetField === undefined) {\r\n // todo, also backup sy-index / sy-tabix here?\r\n const loopTargetFieldSymbol = (_e = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol})${cond}.\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n const l = forLoop.findDirectExpression(Expressions.Let);\r\n if (l) {\r\n body += this.outlineLet(l, indentation, highSyntax, lowFile);\r\n }\r\n return { body, end };\r\n }\r\n outlineSwitch(node, lowFile, highSyntax) {\r\n var _a, _b, _c, _d;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"SWITCH\") {\r\n continue;\r\n }\r\n let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move\r\n && node.findDirectExpression(Expressions.Source) === i\r\n && ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const switchBody = i.findDirectExpression(Expressions.SwitchBody);\r\n if (switchBody === undefined) {\r\n continue;\r\n }\r\n for (const l of ((_c = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _c === void 0 ? void 0 : _c.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {\r\n name = l.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_d = switchBody.findFirstExpression(Expressions.Source)) === null || _d === void 0 ? void 0 : _d.concatTokens()}.\\n`;\r\n }\r\n body += `DATA ${uniqueName} ${type}.\\n`;\r\n let firstSource = false;\r\n let inWhen = false;\r\n for (const c of switchBody.getChildren()) {\r\n if (c.get() instanceof Expressions.Source && firstSource === false) {\r\n body += indentation + `CASE ${c.concatTokens()}.`;\r\n firstSource = true;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"THEN\") {\r\n inWhen = true;\r\n body += \".\\n\";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"WHEN\") {\r\n inWhen = false;\r\n body += `\\n${indentation} WHEN `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"OR\") {\r\n body += ` OR `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"ELSE\") {\r\n inWhen = true;\r\n body += `\\n${indentation} WHEN OTHERS.\\n`;\r\n }\r\n else if (inWhen === false) {\r\n body += c.concatTokens();\r\n }\r\n else {\r\n body += indentation + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\";\r\n }\r\n }\r\n body += \"\\n\" + indentation + \"ENDCASE.\\n\" + indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), body);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport SWITCH\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineReduce(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"REDUCE\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const reduceBody = i.findDirectExpression(Expressions.ReduceBody);\r\n if (reduceBody === undefined) {\r\n continue;\r\n }\r\n const letNode = reduceBody.findDirectExpression(Expressions.Let);\r\n if (letNode) {\r\n body += this.outlineLet(letNode, indentation, highSyntax, lowFile);\r\n }\r\n let firstName = \"\";\r\n for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n name = init.getFirstToken().getStr();\r\n if (firstName === \"\") {\r\n firstName = name;\r\n }\r\n const s = (_a = init.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const t = (_b = init.findFirstExpression(Expressions.TypeName)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (s) {\r\n body += indentation + `DATA(${name}) = ${s}.\\n`;\r\n }\r\n else {\r\n body += indentation + `DATA ${name} TYPE ${t}.\\n`;\r\n }\r\n }\r\n let end = \"\";\r\n for (const forLoop of (reduceBody === null || reduceBody === void 0 ? void 0 : reduceBody.findDirectExpressions(Expressions.For)) || []) {\r\n const outlineFor = this.outlineFor(forLoop, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n }\r\n const next = reduceBody.findDirectExpression(Expressions.ReduceNext);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n for (const n of next.getChildren()) {\r\n const concat = n.concatTokens();\r\n if (concat.toUpperCase() === \"NEXT\") {\r\n continue;\r\n }\r\n else if (n.get() instanceof Expressions.Field) {\r\n body += indentation + \" \" + concat + \" \";\r\n }\r\n else if (n.get() instanceof Expressions.Source) {\r\n body += \" \" + concat + \".\\n\";\r\n }\r\n else {\r\n body += concat;\r\n }\r\n }\r\n body += indentation + end;\r\n body += indentation + `${uniqueName} = ${firstName}.\\n`;\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport REDUCE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineValue(node, lowFile, highSyntax) {\r\n var _a;\r\n const allSources = node.findAllExpressionsRecursive(Expressions.Source);\r\n for (const s of allSources) {\r\n const firstToken = s.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"VALUE\") {\r\n continue;\r\n }\r\n let type = this.findType(s, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move && node.findDirectExpression(Expressions.Source) === s) {\r\n type = \"LIKE \" + ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const valueBody = s.findDirectExpression(Expressions.ValueBody);\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n const base = valueBody === null || valueBody === void 0 ? void 0 : valueBody.findExpressionAfterToken(\"BASE\");\r\n if (base) {\r\n body += indentation + uniqueName + \" = \" + base.concatTokens() + \".\\n\";\r\n }\r\n let end = \"\";\r\n let structureName = uniqueName;\r\n let added = false;\r\n let skip = false;\r\n let data = \"\";\r\n let previous = undefined;\r\n for (const b of (valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren()) || []) {\r\n if (b.concatTokens() === \"(\" && added === false) {\r\n structureName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n data = indentation + `DATA ${structureName} LIKE LINE OF ${uniqueName}.\\n`;\r\n }\r\n if (b.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + b.concatTokens() + \".\\n\";\r\n }\r\n else if (b instanceof nodes_1.ExpressionNode && b.get() instanceof Expressions.For) {\r\n const outlineFor = this.outlineFor(b, indentation, lowFile, highSyntax);\r\n body += outlineFor.body;\r\n end = outlineFor.end + `.\\n` + end;\r\n indentation += \" \";\r\n }\r\n else if (b.get() instanceof Expressions.Source) {\r\n if ((valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren().length) === 1) {\r\n body += indentation + uniqueName + \" = \" + b.concatTokens() + `.\\n`;\r\n }\r\n structureName = b.concatTokens();\r\n if (base && (valueBody === null || valueBody === void 0 ? void 0 : valueBody.findDirectTokenByText(\"(\")) === undefined) {\r\n structureName = uniqueName;\r\n }\r\n }\r\n else if (b.get() instanceof Expressions.ValueBodyLines) {\r\n body += indentation + \"APPEND \" + b.concatTokens() + ` TO ${uniqueName}.\\n`;\r\n skip = true;\r\n }\r\n else if (b instanceof nodes_1.ExpressionNode && b.get() instanceof Expressions.Let) {\r\n body += this.outlineLet(b, indentation, highSyntax, lowFile);\r\n }\r\n else if (b.concatTokens() === \")\") {\r\n if (added === false && (previous === null || previous === void 0 ? void 0 : previous.concatTokens()) === \"(\") {\r\n body += data;\r\n added = true;\r\n }\r\n if (skip === false) {\r\n body += indentation + `APPEND ${structureName} TO ${uniqueName}.\\n`;\r\n }\r\n skip = false;\r\n }\r\n previous = b;\r\n }\r\n if (end !== \"\") {\r\n indentation = indentation.substring(2);\r\n body += indentation + end;\r\n }\r\n const abap = `DATA ${uniqueName} ${type}.\\n` +\r\n indentation + `CLEAR ${uniqueName}.\\n` + // might be called inside a loop\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport VALUE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineLet(node, indentation, highSyntax, lowFile) {\r\n var _a;\r\n let ret = \"\";\r\n for (const f of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n const c = f.getFirstChild();\r\n if (c === undefined) {\r\n continue;\r\n }\r\n const name = c.concatTokens().toLowerCase();\r\n const spag = highSyntax.spaghetti.lookupPosition(c.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + \"DATA(\" + name + `) = ${source.concatTokens()}.\\n`;\r\n }\r\n continue;\r\n }\r\n const type = found.getType().getQualifiedName() ? (_a = found.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase() : found.getType().toABAP();\r\n ret += indentation + \"DATA \" + name + ` TYPE ${type}.\\n`;\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + name + ` = ${source.concatTokens()}.\\n`;\r\n }\r\n }\r\n return ret;\r\n }\r\n findType(i, lowFile, highSyntax, ref = false) {\r\n var _a;\r\n const expr = i.findDirectExpression(Expressions.TypeNameOrInfer);\r\n if (expr === undefined) {\r\n return undefined;\r\n }\r\n const firstToken = expr.getFirstToken();\r\n const concat = expr.concatTokens().toLowerCase();\r\n if (concat !== \"#\") {\r\n return ref ? \"REF TO \" + concat : concat;\r\n }\r\n const spag = highSyntax.spaghetti.lookupPosition(firstToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n return undefined;\r\n }\r\n let inferred = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.InferredType\r\n && r.resolved\r\n && r.position.getStart().equals(firstToken.getStart())\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier) {\r\n inferred = r.resolved;\r\n break;\r\n }\r\n }\r\n if (inferred === undefined) {\r\n return undefined;\r\n }\r\n if (inferred.getType() instanceof basic_1.ObjectReferenceType) {\r\n return inferred.getType().toABAP();\r\n }\r\n else {\r\n return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n }\r\n }\r\n outlineFS(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineFS)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n let type = \"\";\r\n if (node.concatTokens().toUpperCase().startsWith(\"APPEND INITIAL LINE TO \")) {\r\n type = \"LIKE LINE OF \" + ((_b = node.findFirstExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n else {\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType) {\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Error outlining voided type\", this.getMetadata().key, this.conf.severity);\r\n }\r\n type = \"TYPE \";\r\n type += found.getType().getQualifiedName() ? found.getType().getQualifiedName().toLowerCase() : found.getType().toABAP();\r\n }\r\n const code = `FIELD-SYMBOLS ${name} ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline FIELD-SYMBOL\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineData(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineData)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType && found.getType().getQualifiedName() === undefined) {\r\n continue;\r\n }\r\n let type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n if (found.getType() instanceof basic_1.ObjectReferenceType) {\r\n type = found.getType().toABAP();\r\n }\r\n const code = `DATA ${name} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineCond(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"COND\") {\r\n continue;\r\n }\r\n const body = i.findDirectExpression(Expressions.CondBody);\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n let type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move\r\n && node.findDirectExpression(Expressions.Source) === i\r\n && ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.TargetField)) !== undefined) {\r\n type = \"LIKE \" + ((_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);\r\n const abap = `DATA ${uniqueName} ${type}.\\n` + bodyCode;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport COND\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n buildCondBody(body, uniqueName, indent, lowFile, highSyntax) {\r\n let code = \"\";\r\n let first = true;\r\n let addElse = true;\r\n for (const c of body.getChildren()) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n switch (c.getFirstToken().getStr().toUpperCase()) {\r\n case \"WHEN\":\r\n if (first === true) {\r\n code += indent + \"IF \";\r\n first = false;\r\n }\r\n else {\r\n code += indent + \"ELSEIF \";\r\n }\r\n break;\r\n case \"THEN\":\r\n code += \".\\n\";\r\n break;\r\n case \"ELSE\":\r\n code += indent + \"ELSE.\\n\";\r\n addElse = false;\r\n break;\r\n default:\r\n throw \"buildCondBody, unexpected token\";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Cond) {\r\n code += c.concatTokens();\r\n }\r\n else if (c.get() instanceof Expressions.Let) {\r\n code += this.outlineLet(c, indent, highSyntax, lowFile);\r\n }\r\n else if (c.get() instanceof Expressions.Source) {\r\n code += indent + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\\n\";\r\n }\r\n else {\r\n throw \"buildCondBody, unexpected expression, \" + c.get().constructor.name;\r\n }\r\n }\r\n if (addElse) {\r\n // COND might be called inside a loop\r\n code += indent + \"ELSE.\\n\";\r\n code += indent + ` CLEAR ${uniqueName}.\\n`;\r\n }\r\n code += indent + \"ENDIF.\\n\";\r\n code += indent;\r\n return code;\r\n }\r\n outlineConv(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"CONV\") {\r\n continue;\r\n }\r\n const end = i.findDirectTokenByText(\")\");\r\n if (end === undefined) {\r\n continue;\r\n }\r\n const body = (_a = i.findDirectExpression(Expressions.ConvBody)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n indent + `${uniqueName} = ${body}.\\n` +\r\n indent;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), end.getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CONV\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n // \"CAST\" to \"?=\"\r\n outlineCast(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Cast)) {\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax, true);\r\n const body = (_a = i.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1) +\r\n `${uniqueName} ?= ${body}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CAST\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n uniqueName(position, filename, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(position, filename);\r\n if (spag === undefined) {\r\n const name = \"temprr\" + this.counter;\r\n this.counter++;\r\n return name;\r\n }\r\n while (true) {\r\n const name = \"temp\" + this.counter;\r\n const found = spag.findVariable(name);\r\n this.counter++;\r\n if (found === undefined) {\r\n return name;\r\n }\r\n }\r\n }\r\n replaceXsdBool(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference\r\n && r.position.getName().toUpperCase() === \"XSDBOOL\") {\r\n const token = r.position.getToken();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, token.getStart(), token.getEnd(), \"boolc\");\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n findMethodCallExpression(node, token) {\r\n var _a;\r\n for (const m of node.findAllExpressions(Expressions.MethodCall)) {\r\n if ((_a = m.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStart().equals(token.getStart())) {\r\n return m;\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceMethodConditional(node, lowFile, highSyntax) {\r\n for (const c of node.findAllExpressionsRecursive(Expressions.Compare)) {\r\n const chain = c.findDirectExpression(Expressions.MethodCallChain);\r\n if (chain === undefined) {\r\n continue;\r\n }\r\n let predicate = false;\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference &&\r\n new _builtin_1.BuiltIn().isPredicate(chain.getFirstToken().getStr().toUpperCase())) {\r\n predicate = true;\r\n break;\r\n }\r\n }\r\n const end = chain.getLastToken().getEnd();\r\n let fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" IS NOT INITIAL\");\r\n if (predicate === true) {\r\n fix = edit_helper_1.EditHelper.insertAt(lowFile, end, \" ) = abap_true\");\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, chain.getFirstToken().getStart(), \"boolc( \");\r\n fix = edit_helper_1.EditHelper.merge(fix, fix1);\r\n }\r\n return issue_1.Issue.atToken(lowFile, chain.getFirstToken(), \"Downport method conditional\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceContains(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n // only downport if its an single method call condition\r\n let found = false;\r\n for (const c of node.findAllExpressionsRecursive(Expressions.Compare)) {\r\n found = c.findDirectExpression(Expressions.MethodCallChain) !== undefined;\r\n if (found === true) {\r\n break;\r\n }\r\n }\r\n if (found === false) {\r\n return undefined;\r\n }\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"CONTAINS\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n const sList = expression.findAllExpressions(Expressions.Source).map(e => e.concatTokens());\r\n if (sList.length !== 2) {\r\n continue;\r\n }\r\n const code = sList[0] + \" CS \" + sList[1];\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, token, \"Downport contains()\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceLineFunctions(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"LINE_EXISTS\" || func === \"LINE_INDEX\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n let condition = \"\";\r\n for (const c of ((_a = expression === null || expression === void 0 ? void 0 : expression.findFirstExpression(Expressions.TableExpression)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n const tableName = (_b = expression.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens().split(\"[\")[0];\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const sy = func === \"LINE_EXISTS\" ? \"sy-subrc\" : \"sy-tabix\";\r\n const code = `DATA ${uniqueName} LIKE sy-subrc.\\n` +\r\n indentation + `READ TABLE ${tableName} ${condition}TRANSPORTING NO FIELDS.\\n` +\r\n indentation + uniqueName + ` = ${sy}.\\n` +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, uniqueName + (func === \"LINE_EXISTS\" ? \" = 0\" : \"\"));\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newToCreateObject(node, lowFile, highSyntax) {\r\n const source = node.findDirectExpression(Expressions.Source);\r\n let fix = undefined;\r\n if (node.get() instanceof Statements.Move\r\n && source\r\n && source.getFirstToken().getStr().toUpperCase() === \"NEW\") {\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const found = source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.NewObject);\r\n // must be at top level of the source for quickfix to work(todo: handle more scenarios)\r\n // todo, assumption: the target is not an inline definition\r\n if (target && found && source.concatTokens() === found.concatTokens()) {\r\n const abap = this.newParameters(found, target.concatTokens(), highSyntax, lowFile);\r\n if (abap !== undefined) {\r\n fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), abap);\r\n }\r\n }\r\n }\r\n if (fix === undefined && node.findAllExpressions(Expressions.NewObject)) {\r\n const found = node.findFirstExpression(Expressions.NewObject);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const name = this.uniqueName(found.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const abap = this.newParameters(found, name, highSyntax, lowFile);\r\n if (abap === undefined) {\r\n return undefined;\r\n }\r\n const type = this.findType(found, lowFile, highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const data = `DATA ${name} TYPE REF TO ${type}.\\n` +\r\n indentation + abap + \"\\n\" +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), data);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), name);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n }\r\n if (fix) {\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Use CREATE OBJECT instead of NEW\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n newParameters(found, name, highSyntax, lowFile) {\r\n var _a, _b, _c;\r\n const typeToken = (_a = found.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n let extra = (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr()) === \"#\" ? \"\" : \" TYPE \" + (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr());\r\n const parameters = found.findFirstExpression(Expressions.ParameterListS);\r\n if (parameters) {\r\n extra = parameters ? extra + \" EXPORTING \" + parameters.concatTokens() : extra;\r\n }\r\n else if (typeToken) {\r\n const source = (_b = found.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (source) {\r\n // find the default parameter name for the constructor\r\n const spag = highSyntax.spaghetti.lookupPosition(typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStart(), lowFile.getFilename());\r\n let cdef = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if ((r.referenceType === _reference_1.ReferenceType.InferredType\r\n || r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference)\r\n && r.resolved && r.position.getStart().equals(typeToken.getStart())) {\r\n cdef = r.resolved;\r\n }\r\n }\r\n if (cdef && cdef.getMethodDefinitions === undefined) {\r\n return undefined; // something wrong\r\n }\r\n const importing = (_c = cdef === null || cdef === void 0 ? void 0 : cdef.getMethodDefinitions().getByName(\"CONSTRUCTOR\")) === null || _c === void 0 ? void 0 : _c.getParameters().getDefaultImporting();\r\n if (importing) {\r\n extra += \" EXPORTING \" + importing + \" = \" + source;\r\n }\r\n else if (spag === undefined) {\r\n extra += \" SpagUndefined\";\r\n }\r\n else if (cdef === undefined) {\r\n extra += \" ClassDefinitionNotFound\";\r\n }\r\n else {\r\n extra += \" SomeError\";\r\n }\r\n }\r\n }\r\n const abap = `CREATE OBJECT ${name}${extra}.`;\r\n return abap;\r\n }\r\n}\r\nexports.Downport = Downport;\r\n//# sourceMappingURL=downport.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/downport.js?");
11757
11757
 
11758
11758
  /***/ }),
11759
11759
 
@@ -11797,7 +11797,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11797
11797
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11798
11798
 
11799
11799
  "use strict";
11800
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ExitOrCheck = exports.ExitOrCheckConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ExitOrCheckConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.allowExit = false;\r\n this.allowCheck = false;\r\n }\r\n}\r\nexports.ExitOrCheckConf = ExitOrCheckConf;\r\nclass ExitOrCheck extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ExitOrCheckConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"exit_or_check\",\r\n title: \"Find EXIT or CHECK outside loops\",\r\n shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.\nUse RETURN to leave procesing blocks instead.`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm\nhttps://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stack = [];\r\n for (const statement of file.getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof Statements.Loop\r\n || get instanceof Statements.While\r\n || get instanceof Statements.LoopAtScreen\r\n || get instanceof Statements.SelectLoop\r\n || get instanceof Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof Statements.EndLoop\r\n || get instanceof Statements.EndWhile\r\n || get instanceof Statements.EndSelect\r\n || get instanceof Statements.EndDo) {\r\n stack.pop();\r\n }\r\n else if (this.conf.allowCheck === false && get instanceof Statements.Check && stack.length === 0) {\r\n const message = \"CHECK is not allowed outside of loops\";\r\n let tokensString = statement.concatTokens();\r\n tokensString = tokensString.slice(statement.getFirstToken().getEnd().getCol());\r\n const replacement = \"IF NOT \" + tokensString + \"\\n RETURN.\\nENDIF.\";\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, statement.getFirstToken().getStart(), statement.getLastToken().getEnd(), replacement);\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n else if (this.conf.allowExit === false && get instanceof Statements.Exit && stack.length === 0) {\r\n const message = \"EXIT is not allowed outside of loops\";\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, statement.getFirstToken(), \"RETURN\");\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ExitOrCheck = ExitOrCheck;\r\n//# sourceMappingURL=exit_or_check.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/exit_or_check.js?");
11800
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ExitOrCheck = exports.ExitOrCheckConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ExitOrCheckConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.allowExit = false;\r\n this.allowCheck = false;\r\n }\r\n}\r\nexports.ExitOrCheckConf = ExitOrCheckConf;\r\nclass ExitOrCheck extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ExitOrCheckConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"exit_or_check\",\r\n title: \"Find EXIT or CHECK outside loops\",\r\n shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.\r\nUse RETURN to leave procesing blocks instead.`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm\r\nhttps://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stack = [];\r\n for (const statement of file.getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof Statements.Loop\r\n || get instanceof Statements.While\r\n || get instanceof Statements.LoopAtScreen\r\n || get instanceof Statements.SelectLoop\r\n || get instanceof Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof Statements.EndLoop\r\n || get instanceof Statements.EndWhile\r\n || get instanceof Statements.EndSelect\r\n || get instanceof Statements.EndDo) {\r\n stack.pop();\r\n }\r\n else if (this.conf.allowCheck === false && get instanceof Statements.Check && stack.length === 0) {\r\n const message = \"CHECK is not allowed outside of loops\";\r\n let tokensString = statement.concatTokens();\r\n tokensString = tokensString.slice(statement.getFirstToken().getEnd().getCol());\r\n const replacement = \"IF NOT \" + tokensString + \"\\n RETURN.\\nENDIF.\";\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, statement.getFirstToken().getStart(), statement.getLastToken().getEnd(), replacement);\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n else if (this.conf.allowExit === false && get instanceof Statements.Exit && stack.length === 0) {\r\n const message = \"EXIT is not allowed outside of loops\";\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, statement.getFirstToken(), \"RETURN\");\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ExitOrCheck = ExitOrCheck;\r\n//# sourceMappingURL=exit_or_check.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/exit_or_check.js?");
11801
11801
 
11802
11802
  /***/ }),
11803
11803
 
@@ -11808,7 +11808,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11808
11808
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11809
11809
 
11810
11810
  "use strict";
11811
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Exporting = exports.ExportingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ExportingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ExportingConf = ExportingConf;\r\nclass Exporting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ExportingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"exporting\",\r\n title: \"EXPORTING can be omitted\",\r\n shortDescription: `Detects EXPORTING statements which can be omitted.`,\r\n badExample: `call_method( EXPORTING foo = bar ).`,\r\n goodExample: `call_method( foo = bar ).`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting\nhttps://docs.abapopenchecks.org/checks/30/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"The EXPORTING keyword can be omitted\";\r\n }\r\n runParsed(file, obj) {\r\n let issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n const expressions = statement.findAllExpressionsMulti([expressions_1.MethodCallBody, expressions_1.MethodCall]);\r\n for (const b of expressions) {\r\n if (b.get() instanceof expressions_1.MethodCallBody) {\r\n if (b.getFirstToken().getStr() !== \"(\") {\r\n continue;\r\n }\r\n issues = issues.concat(this.check(b, file));\r\n }\r\n else if (b.get() instanceof expressions_1.MethodCall) {\r\n issues = issues.concat(this.check(b, file));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n check(node, file) {\r\n const e = node.findFirstExpression(expressions_1.MethodParameters);\r\n if (e === undefined) {\r\n return [];\r\n }\r\n if (e.getFirstToken().getStr().toUpperCase() !== \"EXPORTING\") {\r\n return [];\r\n }\r\n const tokens = e.getDirectTokens();\r\n const strings = tokens.map(t => t.getStr().toUpperCase());\r\n if (strings[0] === \"EXPORTING\"\r\n && strings.includes(\"IMPORTING\") === false\r\n && strings.includes(\"RECEIVING\") === false\r\n && strings.includes(\"EXCEPTIONS\") === false\r\n && strings.includes(\"CHANGING\") === false) {\r\n const next = e.getAllTokens()[1];\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, tokens[0].getStart(), next.getStart());\r\n const issue = issue_1.Issue.atToken(file, tokens[0], this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.Exporting = Exporting;\r\n//# sourceMappingURL=exporting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/exporting.js?");
11811
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Exporting = exports.ExportingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ExportingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ExportingConf = ExportingConf;\r\nclass Exporting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ExportingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"exporting\",\r\n title: \"EXPORTING can be omitted\",\r\n shortDescription: `Detects EXPORTING statements which can be omitted.`,\r\n badExample: `call_method( EXPORTING foo = bar ).`,\r\n goodExample: `call_method( foo = bar ).`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting\r\nhttps://docs.abapopenchecks.org/checks/30/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"The EXPORTING keyword can be omitted\";\r\n }\r\n runParsed(file, obj) {\r\n let issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n const expressions = statement.findAllExpressionsMulti([expressions_1.MethodCallBody, expressions_1.MethodCall]);\r\n for (const b of expressions) {\r\n if (b.get() instanceof expressions_1.MethodCallBody) {\r\n if (b.getFirstToken().getStr() !== \"(\") {\r\n continue;\r\n }\r\n issues = issues.concat(this.check(b, file));\r\n }\r\n else if (b.get() instanceof expressions_1.MethodCall) {\r\n issues = issues.concat(this.check(b, file));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n check(node, file) {\r\n const e = node.findFirstExpression(expressions_1.MethodParameters);\r\n if (e === undefined) {\r\n return [];\r\n }\r\n if (e.getFirstToken().getStr().toUpperCase() !== \"EXPORTING\") {\r\n return [];\r\n }\r\n const tokens = e.getDirectTokens();\r\n const strings = tokens.map(t => t.getStr().toUpperCase());\r\n if (strings[0] === \"EXPORTING\"\r\n && strings.includes(\"IMPORTING\") === false\r\n && strings.includes(\"RECEIVING\") === false\r\n && strings.includes(\"EXCEPTIONS\") === false\r\n && strings.includes(\"CHANGING\") === false) {\r\n const next = e.getAllTokens()[1];\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, tokens[0].getStart(), next.getStart());\r\n const issue = issue_1.Issue.atToken(file, tokens[0], this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.Exporting = Exporting;\r\n//# sourceMappingURL=exporting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/exporting.js?");
11812
11812
 
11813
11813
  /***/ }),
11814
11814
 
@@ -11819,7 +11819,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11819
11819
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11820
11820
 
11821
11821
  "use strict";
11822
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ForbiddenIdentifier = exports.ForbiddenIdentifierConf = void 0;\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass ForbiddenIdentifierConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of forbideen identifiers, array of string regex\r\n * @uniqueItems true\r\n */\r\n this.check = [];\r\n }\r\n}\r\nexports.ForbiddenIdentifierConf = ForbiddenIdentifierConf;\r\nclass ForbiddenIdentifier extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ForbiddenIdentifierConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"forbidden_identifier\",\r\n title: \"Forbidden Identifier\",\r\n shortDescription: `Forbid use of specified identifiers, list of regex.`,\r\n extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,\nhttps://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.check === undefined) {\r\n this.conf.check = [];\r\n }\r\n }\r\n runParsed(file) {\r\n if (this.conf.check.length === 0) {\r\n return [];\r\n }\r\n let ret = [];\r\n for (const s of file.getStatements()) {\r\n ret = ret.concat(this.traverse(s, file));\r\n }\r\n return ret;\r\n }\r\n traverse(node, file) {\r\n let ret = [];\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.TokenNodeRegex) {\r\n ret = ret.concat(this.check(c.get(), file));\r\n }\r\n else if (c instanceof nodes_1.TokenNode) {\r\n continue;\r\n }\r\n else {\r\n ret = ret.concat(this.traverse(c, file));\r\n }\r\n }\r\n return ret;\r\n }\r\n check(token, file) {\r\n const str = token.getStr();\r\n const ret = [];\r\n for (const c of this.conf.check) {\r\n const reg = new RegExp(c, \"i\");\r\n if (reg.exec(str)) {\r\n const message = \"Identifer \\\"\" + str + \"\\\" not allowed\";\r\n ret.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.ForbiddenIdentifier = ForbiddenIdentifier;\r\n//# sourceMappingURL=forbidden_identifier.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js?");
11822
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ForbiddenIdentifier = exports.ForbiddenIdentifierConf = void 0;\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass ForbiddenIdentifierConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of forbideen identifiers, array of string regex\r\n * @uniqueItems true\r\n */\r\n this.check = [];\r\n }\r\n}\r\nexports.ForbiddenIdentifierConf = ForbiddenIdentifierConf;\r\nclass ForbiddenIdentifier extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ForbiddenIdentifierConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"forbidden_identifier\",\r\n title: \"Forbidden Identifier\",\r\n shortDescription: `Forbid use of specified identifiers, list of regex.`,\r\n extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,\r\nhttps://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.check === undefined) {\r\n this.conf.check = [];\r\n }\r\n }\r\n runParsed(file) {\r\n if (this.conf.check.length === 0) {\r\n return [];\r\n }\r\n let ret = [];\r\n for (const s of file.getStatements()) {\r\n ret = ret.concat(this.traverse(s, file));\r\n }\r\n return ret;\r\n }\r\n traverse(node, file) {\r\n let ret = [];\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.TokenNodeRegex) {\r\n ret = ret.concat(this.check(c.get(), file));\r\n }\r\n else if (c instanceof nodes_1.TokenNode) {\r\n continue;\r\n }\r\n else {\r\n ret = ret.concat(this.traverse(c, file));\r\n }\r\n }\r\n return ret;\r\n }\r\n check(token, file) {\r\n const str = token.getStr();\r\n const ret = [];\r\n for (const c of this.conf.check) {\r\n const reg = new RegExp(c, \"i\");\r\n if (reg.exec(str)) {\r\n const message = \"Identifer \\\"\" + str + \"\\\" not allowed\";\r\n ret.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.ForbiddenIdentifier = ForbiddenIdentifier;\r\n//# sourceMappingURL=forbidden_identifier.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js?");
11823
11823
 
11824
11824
  /***/ }),
11825
11825
 
@@ -11841,7 +11841,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11841
11841
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11842
11842
 
11843
11843
  "use strict";
11844
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ForbiddenVoidType = exports.ForbiddenVoidTypeConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst void_type_1 = __webpack_require__(/*! ../abap/types/basic/void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass ForbiddenVoidTypeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of forbidden void types, array of string regex, case in-sensitive\r\n * @uniqueItems true\r\n */\r\n this.check = [];\r\n }\r\n}\r\nexports.ForbiddenVoidTypeConf = ForbiddenVoidTypeConf;\r\nclass ForbiddenVoidType {\r\n constructor() {\r\n this.conf = new ForbiddenVoidTypeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"forbidden_void_type\",\r\n title: \"Forbidden Void Types\",\r\n shortDescription: `Avoid usage of specified void types.`,\r\n extendedInformation: `Inspiration:\nBOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,\nDATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.check === undefined) {\r\n this.conf.check = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || this.conf.check.length === 0) {\r\n return [];\r\n }\r\n return this.traverse(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n }\r\n ///////////////\r\n traverse(node) {\r\n var _a, _b, _c;\r\n let ret = [];\r\n const message = \"Forbidden void type: \";\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedVoidReference\r\n && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName) !== undefined\r\n && this.isForbiddenName((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooName)) {\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + ((_c = r.extra) === null || _c === void 0 ? void 0 : _c.ooName), this.getMetadata().key, this.conf.severity));\r\n }\r\n if ((r.referenceType === _reference_1.ReferenceType.VoidType\r\n || r.referenceType === _reference_1.ReferenceType.TableVoidReference)\r\n && this.isForbiddenName(r.position.getName())) {\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + r.position.getName(), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.traverse(c));\r\n }\r\n return ret;\r\n }\r\n isForbiddenType(type) {\r\n if (type instanceof basic_1.StructureType) {\r\n return type.getComponents().some(c => this.isForbiddenType(c.type));\r\n }\r\n else if (!(type instanceof void_type_1.VoidType)) {\r\n return false;\r\n }\r\n const name = type.getVoided();\r\n return this.isForbiddenName(name);\r\n }\r\n isForbiddenName(name) {\r\n if (name === undefined) {\r\n return false;\r\n }\r\n for (const c of this.conf.check) {\r\n const reg = new RegExp(c, \"i\");\r\n const match = reg.test(name);\r\n if (match === true) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.ForbiddenVoidType = ForbiddenVoidType;\r\n//# sourceMappingURL=forbidden_void_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js?");
11844
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ForbiddenVoidType = exports.ForbiddenVoidTypeConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst void_type_1 = __webpack_require__(/*! ../abap/types/basic/void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass ForbiddenVoidTypeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of forbidden void types, array of string regex, case in-sensitive\r\n * @uniqueItems true\r\n */\r\n this.check = [];\r\n }\r\n}\r\nexports.ForbiddenVoidTypeConf = ForbiddenVoidTypeConf;\r\nclass ForbiddenVoidType {\r\n constructor() {\r\n this.conf = new ForbiddenVoidTypeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"forbidden_void_type\",\r\n title: \"Forbidden Void Types\",\r\n shortDescription: `Avoid usage of specified void types.`,\r\n extendedInformation: `Inspiration:\r\nBOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,\r\nDATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.check === undefined) {\r\n this.conf.check = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || this.conf.check.length === 0) {\r\n return [];\r\n }\r\n return this.traverse(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n }\r\n ///////////////\r\n traverse(node) {\r\n var _a, _b, _c;\r\n let ret = [];\r\n const message = \"Forbidden void type: \";\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedVoidReference\r\n && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName) !== undefined\r\n && this.isForbiddenName((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooName)) {\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + ((_c = r.extra) === null || _c === void 0 ? void 0 : _c.ooName), this.getMetadata().key, this.conf.severity));\r\n }\r\n if ((r.referenceType === _reference_1.ReferenceType.VoidType\r\n || r.referenceType === _reference_1.ReferenceType.TableVoidReference)\r\n && this.isForbiddenName(r.position.getName())) {\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + r.position.getName(), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.traverse(c));\r\n }\r\n return ret;\r\n }\r\n isForbiddenType(type) {\r\n if (type instanceof basic_1.StructureType) {\r\n return type.getComponents().some(c => this.isForbiddenType(c.type));\r\n }\r\n else if (!(type instanceof void_type_1.VoidType)) {\r\n return false;\r\n }\r\n const name = type.getVoided();\r\n return this.isForbiddenName(name);\r\n }\r\n isForbiddenName(name) {\r\n if (name === undefined) {\r\n return false;\r\n }\r\n for (const c of this.conf.check) {\r\n const reg = new RegExp(c, \"i\");\r\n const match = reg.test(name);\r\n if (match === true) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.ForbiddenVoidType = ForbiddenVoidType;\r\n//# sourceMappingURL=forbidden_void_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js?");
11845
11845
 
11846
11846
  /***/ }),
11847
11847
 
@@ -11885,7 +11885,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11885
11885
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11886
11886
 
11887
11887
  "use strict";
11888
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionalWriting = exports.FunctionalWritingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass FunctionalWritingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore functional writing in exception classes, local + global */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.FunctionalWritingConf = FunctionalWritingConf;\r\nclass FunctionalWriting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new FunctionalWritingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"functional_writing\",\r\n title: \"Use functional writing\",\r\n shortDescription: `Detects usage of call method when functional style calls can be used.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls\nhttps://docs.abapopenchecks.org/checks/07/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `CALL METHOD zcl_class=>method( ).\nCALL METHOD cl_abap_typedescr=>describe_by_name\n EXPORTING\n p_name = 'NAME'\n RECEIVING\n p_descr_ref = lr_typedescr\n EXCEPTIONS\n type_not_found = 1\n OTHERS = 2.`,\r\n goodExample: `zcl_class=>method( ).\ncl_abap_typedescr=>describe_by_name(\n EXPORTING\n p_name = 'NAME'\n RECEIVING\n p_descr_ref = lr_typedescr\n EXCEPTIONS\n type_not_found = 1\n OTHERS = 2 ).`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Use functional writing style for method calls\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a, _b;\r\n const issues = [];\r\n let exception = false;\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n let definition = undefined;\r\n if (obj instanceof objects_1.Class) {\r\n definition = obj.getClassDefinition();\r\n }\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const statNode of file.getStatements()) {\r\n if (statNode.get() instanceof Statements.ClassImplementation\r\n && definition\r\n && ddic.isException(definition, obj)\r\n && this.conf.ignoreExceptions) {\r\n exception = true;\r\n }\r\n else if (statNode.get() instanceof Statements.EndClass) {\r\n exception = false;\r\n }\r\n else if (exception === false && statNode.get() instanceof Statements.Call) {\r\n if (((_a = statNode.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.MethodCallChain) {\r\n continue;\r\n }\r\n const dynamic = (_b = statNode.findDirectExpression(Expressions.MethodSource)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Dynamic);\r\n if (dynamic !== undefined) {\r\n continue;\r\n }\r\n issues.push(this.createIssueForStatementNode(file, statNode));\r\n }\r\n }\r\n return issues;\r\n }\r\n createIssueForStatementNode(file, statNode) {\r\n const fixString = this.buildFixString(statNode);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, statNode.getStart(), statNode.getEnd(), fixString);\r\n return issue_1.Issue.atStatement(file, statNode, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n buildFixString(statNode) {\r\n // Note: line breaks from source are lost\r\n const methodSource = statNode.findDirectExpression(Expressions.MethodSource);\r\n let methodSourceStr = methodSource === null || methodSource === void 0 ? void 0 : methodSource.concatTokens();\r\n const methodBody = statNode.findDirectExpression(Expressions.MethodCallBody);\r\n let methodBodyStr = \"\";\r\n if (methodBody) {\r\n const methodCallParam = methodBody.findDirectExpression(Expressions.MethodCallParam);\r\n if (methodCallParam && methodCallParam.getFirstToken().getStr() === \"(\") {\r\n // has parameters and parantheses\r\n methodBodyStr = `${methodBody.concatTokens()}.`;\r\n }\r\n else {\r\n // has parameters, but parentheses are missing\r\n methodSourceStr = `${methodSourceStr}( `;\r\n methodBodyStr = `${methodBody.concatTokens()} ).`;\r\n }\r\n }\r\n else {\r\n // no body means no parentheses and no parameters\r\n methodBodyStr = \"( ).\";\r\n }\r\n return methodSourceStr + methodBodyStr;\r\n }\r\n}\r\nexports.FunctionalWriting = FunctionalWriting;\r\n//# sourceMappingURL=functional_writing.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/functional_writing.js?");
11888
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionalWriting = exports.FunctionalWritingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass FunctionalWritingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore functional writing in exception classes, local + global */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.FunctionalWritingConf = FunctionalWritingConf;\r\nclass FunctionalWriting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new FunctionalWritingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"functional_writing\",\r\n title: \"Use functional writing\",\r\n shortDescription: `Detects usage of call method when functional style calls can be used.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls\r\nhttps://docs.abapopenchecks.org/checks/07/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `CALL METHOD zcl_class=>method( ).\r\nCALL METHOD cl_abap_typedescr=>describe_by_name\r\n EXPORTING\r\n p_name = 'NAME'\r\n RECEIVING\r\n p_descr_ref = lr_typedescr\r\n EXCEPTIONS\r\n type_not_found = 1\r\n OTHERS = 2.`,\r\n goodExample: `zcl_class=>method( ).\r\ncl_abap_typedescr=>describe_by_name(\r\n EXPORTING\r\n p_name = 'NAME'\r\n RECEIVING\r\n p_descr_ref = lr_typedescr\r\n EXCEPTIONS\r\n type_not_found = 1\r\n OTHERS = 2 ).`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Use functional writing style for method calls\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a, _b;\r\n const issues = [];\r\n let exception = false;\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n let definition = undefined;\r\n if (obj instanceof objects_1.Class) {\r\n definition = obj.getClassDefinition();\r\n }\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const statNode of file.getStatements()) {\r\n if (statNode.get() instanceof Statements.ClassImplementation\r\n && definition\r\n && ddic.isException(definition, obj)\r\n && this.conf.ignoreExceptions) {\r\n exception = true;\r\n }\r\n else if (statNode.get() instanceof Statements.EndClass) {\r\n exception = false;\r\n }\r\n else if (exception === false && statNode.get() instanceof Statements.Call) {\r\n if (((_a = statNode.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.MethodCallChain) {\r\n continue;\r\n }\r\n const dynamic = (_b = statNode.findDirectExpression(Expressions.MethodSource)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Dynamic);\r\n if (dynamic !== undefined) {\r\n continue;\r\n }\r\n issues.push(this.createIssueForStatementNode(file, statNode));\r\n }\r\n }\r\n return issues;\r\n }\r\n createIssueForStatementNode(file, statNode) {\r\n const fixString = this.buildFixString(statNode);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, statNode.getStart(), statNode.getEnd(), fixString);\r\n return issue_1.Issue.atStatement(file, statNode, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n buildFixString(statNode) {\r\n // Note: line breaks from source are lost\r\n const methodSource = statNode.findDirectExpression(Expressions.MethodSource);\r\n let methodSourceStr = methodSource === null || methodSource === void 0 ? void 0 : methodSource.concatTokens();\r\n const methodBody = statNode.findDirectExpression(Expressions.MethodCallBody);\r\n let methodBodyStr = \"\";\r\n if (methodBody) {\r\n const methodCallParam = methodBody.findDirectExpression(Expressions.MethodCallParam);\r\n if (methodCallParam && methodCallParam.getFirstToken().getStr() === \"(\") {\r\n // has parameters and parantheses\r\n methodBodyStr = `${methodBody.concatTokens()}.`;\r\n }\r\n else {\r\n // has parameters, but parentheses are missing\r\n methodSourceStr = `${methodSourceStr}( `;\r\n methodBodyStr = `${methodBody.concatTokens()} ).`;\r\n }\r\n }\r\n else {\r\n // no body means no parentheses and no parameters\r\n methodBodyStr = \"( ).\";\r\n }\r\n return methodSourceStr + methodBodyStr;\r\n }\r\n}\r\nexports.FunctionalWriting = FunctionalWriting;\r\n//# sourceMappingURL=functional_writing.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/functional_writing.js?");
11889
11889
 
11890
11890
  /***/ }),
11891
11891
 
@@ -11896,7 +11896,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11896
11896
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11897
11897
 
11898
11898
  "use strict";
11899
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.GlobalClass = exports.GlobalClassConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Objects = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass GlobalClassConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.GlobalClassConf = GlobalClassConf;\r\nclass GlobalClass extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new GlobalClassConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"global_class\",\r\n title: \"Global class checks\",\r\n shortDescription: `Checks related to global classes`,\r\n extendedInformation: `* global classes must be in own files\n\n* file names must match class name\n\n* file names must match interface name\n\n* global classes must be global definitions\n\n* global interfaces must be global definitions`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const output = [];\r\n for (const definition of file.getInfo().listClassDefinitions()) {\r\n if (definition.isLocal && obj instanceof Objects.Class && file.getFilename().match(/\\.clas\\.abap$/)) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Global classes must be global\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n if (definition.isGlobal && obj instanceof Objects.Class && definition.name.toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Class definition name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n if (definition.isGlobal && !(obj instanceof Objects.Class)) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Class must be local\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const impl of file.getInfo().listClassImplementations()) {\r\n if (file.getFilename().match(/\\.clas\\.abap$/)\r\n && obj instanceof Objects.Class\r\n && impl.identifier.getName().toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, \"Class implementation name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const impl of file.getInfo().listInterfaceDefinitions()) {\r\n if (file.getFilename().match(/\\.intf\\.abap$/)\r\n && obj instanceof Objects.Interface\r\n && impl.identifier.getName().toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, \"Interface implementation name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const intf of file.getInfo().listInterfaceDefinitions()) {\r\n if (intf.isLocal && obj instanceof Objects.Interface && file.getFilename().match(/\\.intf\\.abap$/)) {\r\n const issue = issue_1.Issue.atIdentifier(intf.identifier, \"Global interface must be global\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.GlobalClass = GlobalClass;\r\n//# sourceMappingURL=global_class.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/global_class.js?");
11899
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.GlobalClass = exports.GlobalClassConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Objects = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass GlobalClassConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.GlobalClassConf = GlobalClassConf;\r\nclass GlobalClass extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new GlobalClassConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"global_class\",\r\n title: \"Global class checks\",\r\n shortDescription: `Checks related to global classes`,\r\n extendedInformation: `* global classes must be in own files\r\n\r\n* file names must match class name\r\n\r\n* file names must match interface name\r\n\r\n* global classes must be global definitions\r\n\r\n* global interfaces must be global definitions`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const output = [];\r\n for (const definition of file.getInfo().listClassDefinitions()) {\r\n if (definition.isLocal && obj instanceof Objects.Class && file.getFilename().match(/\\.clas\\.abap$/)) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Global classes must be global\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n if (definition.isGlobal && obj instanceof Objects.Class && definition.name.toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Class definition name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n if (definition.isGlobal && !(obj instanceof Objects.Class)) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Class must be local\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const impl of file.getInfo().listClassImplementations()) {\r\n if (file.getFilename().match(/\\.clas\\.abap$/)\r\n && obj instanceof Objects.Class\r\n && impl.identifier.getName().toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, \"Class implementation name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const impl of file.getInfo().listInterfaceDefinitions()) {\r\n if (file.getFilename().match(/\\.intf\\.abap$/)\r\n && obj instanceof Objects.Interface\r\n && impl.identifier.getName().toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, \"Interface implementation name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const intf of file.getInfo().listInterfaceDefinitions()) {\r\n if (intf.isLocal && obj instanceof Objects.Interface && file.getFilename().match(/\\.intf\\.abap$/)) {\r\n const issue = issue_1.Issue.atIdentifier(intf.identifier, \"Global interface must be global\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.GlobalClass = GlobalClass;\r\n//# sourceMappingURL=global_class.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/global_class.js?");
11900
11900
 
11901
11901
  /***/ }),
11902
11902
 
@@ -11907,7 +11907,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11907
11907
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11908
11908
 
11909
11909
  "use strict";
11910
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalConditions = exports.IdenticalConditionsConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nclass Conditions {\r\n constructor() {\r\n this.arr = [];\r\n this.arr = [];\r\n }\r\n push(e) {\r\n this.arr.push(e.concatTokens());\r\n }\r\n hasDuplicates() {\r\n return this.arr.some(x => this.arr.indexOf(x) !== this.arr.lastIndexOf(x));\r\n }\r\n}\r\nclass IdenticalConditionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalConditionsConf = IdenticalConditionsConf;\r\nclass IdenticalConditions extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IdenticalConditionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_conditions\",\r\n title: \"Identical conditions\",\r\n shortDescription: `Find identical conditions in IF + CASE + WHILE etc\n\nPrerequsites: code is pretty printed with identical cAsE`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n let issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const i of structure.findAllStructures(Structures.If)) {\r\n issues = issues.concat(this.analyzeIf(file, i));\r\n }\r\n for (const i of structure.findAllStructures(Structures.Case)) {\r\n issues = issues.concat(this.analyzeWhen(file, i));\r\n }\r\n for (const i of structure.findAllExpressions(Expressions.Cond)) {\r\n issues = issues.concat(this.analyzeCond(file, i));\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n analyzeCond(file, node) {\r\n const conditions = new Conditions();\r\n let operator = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n conditions.push(c);\r\n }\r\n else if (operator === \"\") {\r\n operator = c.get().getStr().toUpperCase();\r\n }\r\n else if (operator !== c.get().getStr().toUpperCase()) {\r\n return [];\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n analyzeIf(file, node) {\r\n var _a;\r\n const conditions = new Conditions();\r\n const i = node.findDirectStatement(Statements.If);\r\n if (i === undefined) {\r\n throw new Error(\"identical_conditions, no IF found\");\r\n }\r\n const c = i === null || i === void 0 ? void 0 : i.findDirectExpression(Expressions.Cond);\r\n if (c) {\r\n conditions.push(c);\r\n }\r\n for (const e of node.findDirectStructures(Structures.ElseIf)) {\r\n const c = (_a = e.findDirectStatement(Statements.ElseIf)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Cond);\r\n if (c) {\r\n conditions.push(c);\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n analyzeWhen(file, node) {\r\n const conditions = new Conditions();\r\n const i = node.findDirectStatement(Statements.Case);\r\n if (i === undefined) {\r\n throw new Error(\"identical_conditions, no CASE found\");\r\n }\r\n for (const e of node.findDirectStructures(Structures.When)) {\r\n const w = e.findDirectStatement(Statements.When);\r\n if (w === undefined) {\r\n continue;\r\n }\r\n for (const s of w.findAllExpressions(Expressions.Source)) {\r\n conditions.push(s);\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.IdenticalConditions = IdenticalConditions;\r\n//# sourceMappingURL=identical_conditions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_conditions.js?");
11910
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalConditions = exports.IdenticalConditionsConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nclass Conditions {\r\n constructor() {\r\n this.arr = [];\r\n this.arr = [];\r\n }\r\n push(e) {\r\n this.arr.push(e.concatTokens());\r\n }\r\n hasDuplicates() {\r\n return this.arr.some(x => this.arr.indexOf(x) !== this.arr.lastIndexOf(x));\r\n }\r\n}\r\nclass IdenticalConditionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalConditionsConf = IdenticalConditionsConf;\r\nclass IdenticalConditions extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IdenticalConditionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_conditions\",\r\n title: \"Identical conditions\",\r\n shortDescription: `Find identical conditions in IF + CASE + WHILE etc\r\n\r\nPrerequsites: code is pretty printed with identical cAsE`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n let issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const i of structure.findAllStructures(Structures.If)) {\r\n issues = issues.concat(this.analyzeIf(file, i));\r\n }\r\n for (const i of structure.findAllStructures(Structures.Case)) {\r\n issues = issues.concat(this.analyzeWhen(file, i));\r\n }\r\n for (const i of structure.findAllExpressions(Expressions.Cond)) {\r\n issues = issues.concat(this.analyzeCond(file, i));\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n analyzeCond(file, node) {\r\n const conditions = new Conditions();\r\n let operator = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n conditions.push(c);\r\n }\r\n else if (operator === \"\") {\r\n operator = c.get().getStr().toUpperCase();\r\n }\r\n else if (operator !== c.get().getStr().toUpperCase()) {\r\n return [];\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n analyzeIf(file, node) {\r\n var _a;\r\n const conditions = new Conditions();\r\n const i = node.findDirectStatement(Statements.If);\r\n if (i === undefined) {\r\n throw new Error(\"identical_conditions, no IF found\");\r\n }\r\n const c = i === null || i === void 0 ? void 0 : i.findDirectExpression(Expressions.Cond);\r\n if (c) {\r\n conditions.push(c);\r\n }\r\n for (const e of node.findDirectStructures(Structures.ElseIf)) {\r\n const c = (_a = e.findDirectStatement(Statements.ElseIf)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Cond);\r\n if (c) {\r\n conditions.push(c);\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n analyzeWhen(file, node) {\r\n const conditions = new Conditions();\r\n const i = node.findDirectStatement(Statements.Case);\r\n if (i === undefined) {\r\n throw new Error(\"identical_conditions, no CASE found\");\r\n }\r\n for (const e of node.findDirectStructures(Structures.When)) {\r\n const w = e.findDirectStatement(Statements.When);\r\n if (w === undefined) {\r\n continue;\r\n }\r\n for (const s of w.findAllExpressions(Expressions.Source)) {\r\n conditions.push(s);\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.IdenticalConditions = IdenticalConditions;\r\n//# sourceMappingURL=identical_conditions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_conditions.js?");
11911
11911
 
11912
11912
  /***/ }),
11913
11913
 
@@ -11918,7 +11918,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11918
11918
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11919
11919
 
11920
11920
  "use strict";
11921
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalContents = exports.IdenticalContentsConf = void 0;\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nclass IdenticalContentsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalContentsConf = IdenticalContentsConf;\r\nclass IdenticalContents extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IdenticalContentsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_contents\",\r\n title: \"Identical contents\",\r\n shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,\r\n extendedInformation: `\nPrerequsites: code is pretty printed with identical cAsE\n\nChained statments are ignored`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `IF foo = bar.\n WRITE 'bar'.\n WRITE 'world'.\nELSE.\n WRITE 'foo'.\n WRITE 'world'.\nENDIF.`,\r\n goodExample: `IF foo = bar.\n WRITE 'bar'.\nELSE.\n WRITE 'foo'.\nENDIF.\nWRITE 'world'.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n let issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const i of structure.findAllStructuresRecursive(Structures.If)) {\r\n issues = issues.concat(this.analyzeIf(file, i));\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n analyzeIf(file, node) {\r\n var _a;\r\n if (node.getChildren().length !== 4) {\r\n return [];\r\n }\r\n const ifBody = node.findDirectStructure(Structures.Body);\r\n if (node.findDirectStructure(Structures.ElseIf)) {\r\n return [];\r\n }\r\n const elseBody = (_a = node.findDirectStructure(Structures.Else)) === null || _a === void 0 ? void 0 : _a.findDirectStructure(Structures.Body);\r\n if (elseBody === undefined || ifBody === undefined) {\r\n return [];\r\n }\r\n {\r\n const ifFirst = ifBody.getFirstChild();\r\n const elseFirst = elseBody.getFirstChild();\r\n if (ifFirst === undefined || elseFirst === undefined || this.isChained(ifFirst)) {\r\n return [];\r\n }\r\n else if (ifFirst.concatTokens() === elseFirst.concatTokens()) {\r\n const message = \"Identical contents\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n }\r\n {\r\n const ifLast = ifBody.getLastChild();\r\n const elseLast = elseBody.getLastChild();\r\n if (ifLast === undefined || elseLast === undefined || this.isChained(ifLast)) {\r\n return [];\r\n }\r\n else if (ifLast.concatTokens() === elseLast.concatTokens()) {\r\n const message = \"Identical contents\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n }\r\n return [];\r\n }\r\n isChained(node) {\r\n if (node === undefined) {\r\n return false;\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n return node.getColon() !== undefined;\r\n }\r\n else {\r\n return this.isChained(node.getFirstStatement());\r\n }\r\n }\r\n}\r\nexports.IdenticalContents = IdenticalContents;\r\n//# sourceMappingURL=identical_contents.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_contents.js?");
11921
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalContents = exports.IdenticalContentsConf = void 0;\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nclass IdenticalContentsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalContentsConf = IdenticalContentsConf;\r\nclass IdenticalContents extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IdenticalContentsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_contents\",\r\n title: \"Identical contents\",\r\n shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,\r\n extendedInformation: `\r\nPrerequsites: code is pretty printed with identical cAsE\r\n\r\nChained statments are ignored`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `IF foo = bar.\r\n WRITE 'bar'.\r\n WRITE 'world'.\r\nELSE.\r\n WRITE 'foo'.\r\n WRITE 'world'.\r\nENDIF.`,\r\n goodExample: `IF foo = bar.\r\n WRITE 'bar'.\r\nELSE.\r\n WRITE 'foo'.\r\nENDIF.\r\nWRITE 'world'.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n let issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const i of structure.findAllStructuresRecursive(Structures.If)) {\r\n issues = issues.concat(this.analyzeIf(file, i));\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n analyzeIf(file, node) {\r\n var _a;\r\n if (node.getChildren().length !== 4) {\r\n return [];\r\n }\r\n const ifBody = node.findDirectStructure(Structures.Body);\r\n if (node.findDirectStructure(Structures.ElseIf)) {\r\n return [];\r\n }\r\n const elseBody = (_a = node.findDirectStructure(Structures.Else)) === null || _a === void 0 ? void 0 : _a.findDirectStructure(Structures.Body);\r\n if (elseBody === undefined || ifBody === undefined) {\r\n return [];\r\n }\r\n {\r\n const ifFirst = ifBody.getFirstChild();\r\n const elseFirst = elseBody.getFirstChild();\r\n if (ifFirst === undefined || elseFirst === undefined || this.isChained(ifFirst)) {\r\n return [];\r\n }\r\n else if (ifFirst.concatTokens() === elseFirst.concatTokens()) {\r\n const message = \"Identical contents\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n }\r\n {\r\n const ifLast = ifBody.getLastChild();\r\n const elseLast = elseBody.getLastChild();\r\n if (ifLast === undefined || elseLast === undefined || this.isChained(ifLast)) {\r\n return [];\r\n }\r\n else if (ifLast.concatTokens() === elseLast.concatTokens()) {\r\n const message = \"Identical contents\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n }\r\n return [];\r\n }\r\n isChained(node) {\r\n if (node === undefined) {\r\n return false;\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n return node.getColon() !== undefined;\r\n }\r\n else {\r\n return this.isChained(node.getFirstStatement());\r\n }\r\n }\r\n}\r\nexports.IdenticalContents = IdenticalContents;\r\n//# sourceMappingURL=identical_contents.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_contents.js?");
11922
11922
 
11923
11923
  /***/ }),
11924
11924
 
@@ -11929,7 +11929,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11929
11929
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11930
11930
 
11931
11931
  "use strict";
11932
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalDescriptions = exports.IdenticalDescriptionsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nclass IdenticalDescriptionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalDescriptionsConf = IdenticalDescriptionsConf;\r\nclass IdenticalDescriptions {\r\n constructor() {\r\n this.conf = new IdenticalDescriptionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_descriptions\",\r\n title: \"Identical descriptions\",\r\n shortDescription: `Searches for objects with the same type and same description`,\r\n extendedInformation: `Case insensitive\n\nOnly checks the master language descriptions\n\nWorks for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,\r\n tags: [],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n var _a;\r\n this.descriptions = {};\r\n this.types = [\"INTF\", \"CLAS\", \"DOMA\", \"DTEL\"];\r\n for (const o of reg.getObjects()) {\r\n const type = o.getType();\r\n if (this.types.includes(type)) {\r\n const description = (_a = o.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (description === undefined || description === \"\") {\r\n continue;\r\n }\r\n if (this.descriptions[type] === undefined) {\r\n this.descriptions[type] = {};\r\n }\r\n if (this.descriptions[type][description] === undefined) {\r\n this.descriptions[type][description] = [];\r\n }\r\n this.descriptions[type][description].push(o.getName());\r\n }\r\n }\r\n return this;\r\n }\r\n run(o) {\r\n var _a;\r\n const issues = [];\r\n const type = o.getType();\r\n if (this.types.includes(type)) {\r\n const description = (_a = o.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (description === undefined || description === \"\") {\r\n return issues;\r\n }\r\n const found = this.descriptions[type][description].filter(a => a !== o.getName());\r\n if (found.length > 0) {\r\n const message = \"Identical description: \" + found[0];\r\n issues.push(issue_1.Issue.atRow(o.getXMLFile(), 1, message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n if (o instanceof objects_1.FunctionGroup) {\r\n issues.push(...this.checkFunctionModules(o));\r\n }\r\n return issues;\r\n }\r\n checkFunctionModules(fugr) {\r\n var _a;\r\n const descriptions = {};\r\n for (const fm of fugr.getModules()) {\r\n const d = (_a = fm.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (d === undefined || d === \"\") {\r\n continue;\r\n }\r\n if (descriptions[d] !== undefined) {\r\n const message = \"FUGR \" + fugr.getName() + \" contains function modules with identical descriptions\";\r\n return [issue_1.Issue.atRow(fugr.getXMLFile(), 1, message, this.getMetadata().key, this.getConfig().severity)];\r\n }\r\n descriptions[d] = true;\r\n }\r\n return [];\r\n }\r\n}\r\nexports.IdenticalDescriptions = IdenticalDescriptions;\r\n//# sourceMappingURL=identical_descriptions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_descriptions.js?");
11932
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalDescriptions = exports.IdenticalDescriptionsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nclass IdenticalDescriptionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalDescriptionsConf = IdenticalDescriptionsConf;\r\nclass IdenticalDescriptions {\r\n constructor() {\r\n this.conf = new IdenticalDescriptionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_descriptions\",\r\n title: \"Identical descriptions\",\r\n shortDescription: `Searches for objects with the same type and same description`,\r\n extendedInformation: `Case insensitive\r\n\r\nOnly checks the master language descriptions\r\n\r\nWorks for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,\r\n tags: [],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n var _a;\r\n this.descriptions = {};\r\n this.types = [\"INTF\", \"CLAS\", \"DOMA\", \"DTEL\"];\r\n for (const o of reg.getObjects()) {\r\n const type = o.getType();\r\n if (this.types.includes(type)) {\r\n const description = (_a = o.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (description === undefined || description === \"\") {\r\n continue;\r\n }\r\n if (this.descriptions[type] === undefined) {\r\n this.descriptions[type] = {};\r\n }\r\n if (this.descriptions[type][description] === undefined) {\r\n this.descriptions[type][description] = [];\r\n }\r\n this.descriptions[type][description].push(o.getName());\r\n }\r\n }\r\n return this;\r\n }\r\n run(o) {\r\n var _a;\r\n const issues = [];\r\n const type = o.getType();\r\n if (this.types.includes(type)) {\r\n const description = (_a = o.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (description === undefined || description === \"\") {\r\n return issues;\r\n }\r\n const found = this.descriptions[type][description].filter(a => a !== o.getName());\r\n if (found.length > 0) {\r\n const message = \"Identical description: \" + found[0];\r\n issues.push(issue_1.Issue.atRow(o.getXMLFile(), 1, message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n if (o instanceof objects_1.FunctionGroup) {\r\n issues.push(...this.checkFunctionModules(o));\r\n }\r\n return issues;\r\n }\r\n checkFunctionModules(fugr) {\r\n var _a;\r\n const descriptions = {};\r\n for (const fm of fugr.getModules()) {\r\n const d = (_a = fm.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (d === undefined || d === \"\") {\r\n continue;\r\n }\r\n if (descriptions[d] !== undefined) {\r\n const message = \"FUGR \" + fugr.getName() + \" contains function modules with identical descriptions\";\r\n return [issue_1.Issue.atRow(fugr.getXMLFile(), 1, message, this.getMetadata().key, this.getConfig().severity)];\r\n }\r\n descriptions[d] = true;\r\n }\r\n return [];\r\n }\r\n}\r\nexports.IdenticalDescriptions = IdenticalDescriptions;\r\n//# sourceMappingURL=identical_descriptions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_descriptions.js?");
11933
11933
 
11934
11934
  /***/ }),
11935
11935
 
@@ -11951,7 +11951,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11951
11951
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11952
11952
 
11953
11953
  "use strict";
11954
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IfInIf = exports.IfInIfConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass IfInIfConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IfInIfConf = IfInIfConf;\r\nclass IfInIf extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IfInIfConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"if_in_if\",\r\n title: \"IF in IF\",\r\n shortDescription: `Detects nested ifs which can be refactored to a single condition using AND.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/01/\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,\r\n badExample: `IF condition1.\n IF condition2.\n ...\n ENDIF.\nENDIF.`,\r\n goodExample: `IF ( condition1 ) AND ( condition2 ).\n ...\nENDIF.`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"IF in IF. Use IF cond1 AND cond2 instead\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n let possible = stru.findAllStructures(Structures.If);\r\n possible = possible.concat(stru.findAllStructures(Structures.Else));\r\n for (const i of possible) {\r\n if (i.findDirectStructures(Structures.ElseIf).length > 0\r\n || i.findDirectStructures(Structures.Else).length > 0) {\r\n continue;\r\n }\r\n const blist = i.findDirectStructures(Structures.Body);\r\n if (blist.length === 0) {\r\n continue;\r\n }\r\n const nlist = blist[0].findDirectStructures(Structures.Normal);\r\n if (nlist.length !== 1) {\r\n continue;\r\n }\r\n const niflist = nlist[0].findDirectStructures(Structures.If);\r\n if (niflist.length !== 1) {\r\n continue;\r\n }\r\n const nestedIf = niflist[0];\r\n if (i.get() instanceof Structures.If\r\n && (nestedIf.findDirectStructures(Structures.ElseIf).length > 0\r\n || nestedIf.findDirectStructures(Structures.Else).length > 0)) {\r\n continue;\r\n }\r\n const token = i.getFirstToken();\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.IfInIf = IfInIf;\r\n//# sourceMappingURL=if_in_if.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/if_in_if.js?");
11954
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IfInIf = exports.IfInIfConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass IfInIfConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IfInIfConf = IfInIfConf;\r\nclass IfInIf extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IfInIfConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"if_in_if\",\r\n title: \"IF in IF\",\r\n shortDescription: `Detects nested ifs which can be refactored to a single condition using AND.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/01/\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,\r\n badExample: `IF condition1.\r\n IF condition2.\r\n ...\r\n ENDIF.\r\nENDIF.`,\r\n goodExample: `IF ( condition1 ) AND ( condition2 ).\r\n ...\r\nENDIF.`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"IF in IF. Use IF cond1 AND cond2 instead\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n let possible = stru.findAllStructures(Structures.If);\r\n possible = possible.concat(stru.findAllStructures(Structures.Else));\r\n for (const i of possible) {\r\n if (i.findDirectStructures(Structures.ElseIf).length > 0\r\n || i.findDirectStructures(Structures.Else).length > 0) {\r\n continue;\r\n }\r\n const blist = i.findDirectStructures(Structures.Body);\r\n if (blist.length === 0) {\r\n continue;\r\n }\r\n const nlist = blist[0].findDirectStructures(Structures.Normal);\r\n if (nlist.length !== 1) {\r\n continue;\r\n }\r\n const niflist = nlist[0].findDirectStructures(Structures.If);\r\n if (niflist.length !== 1) {\r\n continue;\r\n }\r\n const nestedIf = niflist[0];\r\n if (i.get() instanceof Structures.If\r\n && (nestedIf.findDirectStructures(Structures.ElseIf).length > 0\r\n || nestedIf.findDirectStructures(Structures.Else).length > 0)) {\r\n continue;\r\n }\r\n const token = i.getFirstToken();\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.IfInIf = IfInIf;\r\n//# sourceMappingURL=if_in_if.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/if_in_if.js?");
11955
11955
 
11956
11956
  /***/ }),
11957
11957
 
@@ -11962,7 +11962,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11962
11962
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11963
11963
 
11964
11964
  "use strict";
11965
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ImplementMethods = exports.ImplementMethodsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\n// todo: abstract methods from superclass parents(might be multiple), if class is not abstract\r\nclass ImplementMethodsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ImplementMethodsConf = ImplementMethodsConf;\r\nclass ImplementMethods extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ImplementMethodsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"implement_methods\",\r\n title: \"Implement methods\",\r\n shortDescription: `Checks for abstract methods and methods from interfaces which need implementing.`,\r\n extendedInformation: `INCLUDE programs are only checked in connection with their main programs.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n let ret = [];\r\n if (file.getStructure() === undefined) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Program && obj.isInclude() === true) {\r\n return [];\r\n }\r\n this.obj = obj;\r\n for (const classDefinition of file.getInfo().listClassDefinitions()) {\r\n const classImplementation = this.lookupImplementationInObject(classDefinition.name, obj);\r\n ret = ret.concat(this.checkClass(classDefinition, classImplementation));\r\n ret = ret.concat(this.checkInterfaces(classDefinition, classImplementation));\r\n }\r\n return ret;\r\n }\r\n /////////////////////////////////\r\n lookupImplementationInObject(name, obj) {\r\n for (const sub of obj.getABAPFiles()) {\r\n const impl = sub.getInfo().getClassImplementationByName(name);\r\n if (impl !== undefined) {\r\n return impl;\r\n }\r\n }\r\n return undefined;\r\n }\r\n lookupDefinitionInObject(name) {\r\n for (const sub of this.obj.getABAPFiles()) {\r\n const def = sub.getInfo().getClassDefinitionByName(name);\r\n if (def !== undefined) {\r\n return def;\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkClass(def, impl) {\r\n const ret = [];\r\n for (const md of def.methods) {\r\n const found = impl === null || impl === void 0 ? void 0 : impl.methods.find(m => m.getName().toUpperCase() === md.name.toUpperCase());\r\n if (md.isAbstract === true) {\r\n if (found !== undefined) {\r\n const issue = issue_1.Issue.atIdentifier(found, \"Do not implement abstract method \\\"\" + md.name + \"\\\"\", this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n continue;\r\n }\r\n if (impl === undefined) {\r\n const message = \"Class implementation for \\\"\" + def.name + \"\\\" not found\";\r\n const issue = issue_1.Issue.atIdentifier(def.identifier, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n else if (found === undefined) {\r\n const message = \"Implement method \\\"\" + md.name + \"\\\"\";\r\n const fix = this.buildFix(impl, md.name);\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, message, this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n }\r\n }\r\n return ret;\r\n }\r\n buildFix(impl, methodName) {\r\n var _a, _b;\r\n const file = this.obj.getABAPFileByName(impl.identifier.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {\r\n const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();\r\n if (name === impl.identifier.getName().toUpperCase()) {\r\n return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `\n METHOD ${methodName.toLowerCase()}.\n RETURN. \" todo, implement method\n ENDMETHOD.`);\r\n }\r\n }\r\n return undefined;\r\n }\r\n findInterface(identifier, name) {\r\n const idef = this.findInterfaceByName(name);\r\n if (idef === undefined) {\r\n const message = \"Implemented interface \\\"\" + name + \"\\\" not found\";\r\n const issue = issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity);\r\n return issue;\r\n }\r\n return idef;\r\n }\r\n findInterfaceByName(name) {\r\n var _a;\r\n let idef = undefined;\r\n const intf = this.reg.getObject(\"INTF\", name);\r\n if (intf === undefined) {\r\n // lookup in localfiles\r\n for (const file of this.obj.getABAPFiles()) {\r\n const found = file.getInfo().getInterfaceDefinitionByName(name);\r\n if (found) {\r\n idef = found;\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n idef = (_a = intf.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getInfo().listInterfaceDefinitions()[0];\r\n }\r\n return idef;\r\n }\r\n /** including implemented super interfaces */\r\n findInterfaceMethods(idef) {\r\n const methods = idef.methods.map((m) => {\r\n return { objectName: idef.name, method: m };\r\n });\r\n for (const i of idef.interfaces) {\r\n const sup = this.findInterface(idef.identifier, i.name);\r\n if (sup !== undefined && !(sup instanceof issue_1.Issue)) {\r\n sup.methods.forEach(m => {\r\n methods.push({ objectName: sup.name, method: m });\r\n });\r\n }\r\n }\r\n return methods;\r\n }\r\n findClass(name) {\r\n let def = this.lookupDefinitionInObject(name);\r\n let impl = this.lookupImplementationInObject(name, this.obj);\r\n if (def && impl) {\r\n return { def, impl };\r\n }\r\n const global = this.reg.getObject(\"CLAS\", name);\r\n if (global) {\r\n def = global.getClassDefinition();\r\n impl = this.lookupImplementationInObject(name, global);\r\n if (def && impl) {\r\n return { def, impl };\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkInterfaces(def, impl) {\r\n const ret = [];\r\n for (const interfaceInfo of def.interfaces) {\r\n const idef = this.findInterface(def.identifier, interfaceInfo.name);\r\n if (idef === undefined || interfaceInfo.partial === true || interfaceInfo.allAbstract === true) {\r\n continue; // ignore parser errors in interface\r\n }\r\n else if (idef instanceof issue_1.Issue) {\r\n return [idef];\r\n }\r\n for (const m of this.findInterfaceMethods(idef)) {\r\n if (interfaceInfo.abstractMethods.includes(m.method.name.toUpperCase())) {\r\n continue;\r\n }\r\n if (this.isImplemented(m, def, impl) === false) {\r\n const message = \"Implement method \\\"\" + m.method.name + \"\\\" from interface \\\"\" + m.objectName + \"\\\"\";\r\n if (impl) {\r\n const fix = this.buildFix(impl, m.objectName + \"~\" + m.method.name);\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, message, this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n }\r\n else {\r\n const issue = issue_1.Issue.atIdentifier(def.identifier, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n isImplemented(m, def, impl) {\r\n if (impl === undefined) {\r\n return false;\r\n }\r\n const name = m.objectName + \"~\" + m.method.name;\r\n let found = impl.methods.find(m => m.getName().toUpperCase() === name.toUpperCase());\r\n if (found === undefined) {\r\n // try looking for ALIASes\r\n for (const alias of def.aliases) {\r\n if (alias.component.toUpperCase() === name.toUpperCase()) {\r\n found = impl.methods.find(m => m.getName().toUpperCase() === alias.name.toUpperCase());\r\n break;\r\n }\r\n }\r\n }\r\n if (found === undefined && def.superClassName !== undefined) {\r\n const clas = this.findClass(def.superClassName);\r\n if (clas) {\r\n return this.isImplemented(m, clas === null || clas === void 0 ? void 0 : clas.def, clas === null || clas === void 0 ? void 0 : clas.impl);\r\n }\r\n }\r\n if (found === undefined) {\r\n for (const i of def.interfaces) {\r\n const idef = this.findInterfaceByName(i.name);\r\n if (idef === undefined) {\r\n continue;\r\n }\r\n const ali = this.viaAliasInInterface(m, idef, impl);\r\n if (ali) {\r\n return ali;\r\n }\r\n }\r\n }\r\n return found !== undefined;\r\n }\r\n viaAliasInInterface(m, intf, impl) {\r\n for (const a of intf.aliases) {\r\n if (a.component.toUpperCase() === m.objectName.toUpperCase() + \"~\" + m.method.name.toUpperCase()) {\r\n const name = intf.name + \"~\" + a.name;\r\n const found = impl.methods.find(m => m.getName().toUpperCase() === name.toUpperCase());\r\n if (found) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.ImplementMethods = ImplementMethods;\r\n//# sourceMappingURL=implement_methods.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/implement_methods.js?");
11965
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ImplementMethods = exports.ImplementMethodsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\n// todo: abstract methods from superclass parents(might be multiple), if class is not abstract\r\nclass ImplementMethodsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ImplementMethodsConf = ImplementMethodsConf;\r\nclass ImplementMethods extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ImplementMethodsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"implement_methods\",\r\n title: \"Implement methods\",\r\n shortDescription: `Checks for abstract methods and methods from interfaces which need implementing.`,\r\n extendedInformation: `INCLUDE programs are only checked in connection with their main programs.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n let ret = [];\r\n if (file.getStructure() === undefined) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Program && obj.isInclude() === true) {\r\n return [];\r\n }\r\n this.obj = obj;\r\n for (const classDefinition of file.getInfo().listClassDefinitions()) {\r\n const classImplementation = this.lookupImplementationInObject(classDefinition.name, obj);\r\n ret = ret.concat(this.checkClass(classDefinition, classImplementation));\r\n ret = ret.concat(this.checkInterfaces(classDefinition, classImplementation));\r\n }\r\n return ret;\r\n }\r\n /////////////////////////////////\r\n lookupImplementationInObject(name, obj) {\r\n for (const sub of obj.getABAPFiles()) {\r\n const impl = sub.getInfo().getClassImplementationByName(name);\r\n if (impl !== undefined) {\r\n return impl;\r\n }\r\n }\r\n return undefined;\r\n }\r\n lookupDefinitionInObject(name) {\r\n for (const sub of this.obj.getABAPFiles()) {\r\n const def = sub.getInfo().getClassDefinitionByName(name);\r\n if (def !== undefined) {\r\n return def;\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkClass(def, impl) {\r\n const ret = [];\r\n for (const md of def.methods) {\r\n const found = impl === null || impl === void 0 ? void 0 : impl.methods.find(m => m.getName().toUpperCase() === md.name.toUpperCase());\r\n if (md.isAbstract === true) {\r\n if (found !== undefined) {\r\n const issue = issue_1.Issue.atIdentifier(found, \"Do not implement abstract method \\\"\" + md.name + \"\\\"\", this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n continue;\r\n }\r\n if (impl === undefined) {\r\n const message = \"Class implementation for \\\"\" + def.name + \"\\\" not found\";\r\n const issue = issue_1.Issue.atIdentifier(def.identifier, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n else if (found === undefined) {\r\n const message = \"Implement method \\\"\" + md.name + \"\\\"\";\r\n const fix = this.buildFix(impl, md.name);\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, message, this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n }\r\n }\r\n return ret;\r\n }\r\n buildFix(impl, methodName) {\r\n var _a, _b;\r\n const file = this.obj.getABAPFileByName(impl.identifier.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {\r\n const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();\r\n if (name === impl.identifier.getName().toUpperCase()) {\r\n return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `\r\n METHOD ${methodName.toLowerCase()}.\r\n RETURN. \" todo, implement method\r\n ENDMETHOD.`);\r\n }\r\n }\r\n return undefined;\r\n }\r\n findInterface(identifier, name) {\r\n const idef = this.findInterfaceByName(name);\r\n if (idef === undefined) {\r\n const message = \"Implemented interface \\\"\" + name + \"\\\" not found\";\r\n const issue = issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity);\r\n return issue;\r\n }\r\n return idef;\r\n }\r\n findInterfaceByName(name) {\r\n var _a;\r\n let idef = undefined;\r\n const intf = this.reg.getObject(\"INTF\", name);\r\n if (intf === undefined) {\r\n // lookup in localfiles\r\n for (const file of this.obj.getABAPFiles()) {\r\n const found = file.getInfo().getInterfaceDefinitionByName(name);\r\n if (found) {\r\n idef = found;\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n idef = (_a = intf.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getInfo().listInterfaceDefinitions()[0];\r\n }\r\n return idef;\r\n }\r\n /** including implemented super interfaces */\r\n findInterfaceMethods(idef) {\r\n const methods = idef.methods.map((m) => {\r\n return { objectName: idef.name, method: m };\r\n });\r\n for (const i of idef.interfaces) {\r\n const sup = this.findInterface(idef.identifier, i.name);\r\n if (sup !== undefined && !(sup instanceof issue_1.Issue)) {\r\n sup.methods.forEach(m => {\r\n methods.push({ objectName: sup.name, method: m });\r\n });\r\n }\r\n }\r\n return methods;\r\n }\r\n findClass(name) {\r\n let def = this.lookupDefinitionInObject(name);\r\n let impl = this.lookupImplementationInObject(name, this.obj);\r\n if (def && impl) {\r\n return { def, impl };\r\n }\r\n const global = this.reg.getObject(\"CLAS\", name);\r\n if (global) {\r\n def = global.getClassDefinition();\r\n impl = this.lookupImplementationInObject(name, global);\r\n if (def && impl) {\r\n return { def, impl };\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkInterfaces(def, impl) {\r\n const ret = [];\r\n for (const interfaceInfo of def.interfaces) {\r\n const idef = this.findInterface(def.identifier, interfaceInfo.name);\r\n if (idef === undefined || interfaceInfo.partial === true || interfaceInfo.allAbstract === true) {\r\n continue; // ignore parser errors in interface\r\n }\r\n else if (idef instanceof issue_1.Issue) {\r\n return [idef];\r\n }\r\n for (const m of this.findInterfaceMethods(idef)) {\r\n if (interfaceInfo.abstractMethods.includes(m.method.name.toUpperCase())) {\r\n continue;\r\n }\r\n if (this.isImplemented(m, def, impl) === false) {\r\n const message = \"Implement method \\\"\" + m.method.name + \"\\\" from interface \\\"\" + m.objectName + \"\\\"\";\r\n if (impl) {\r\n const fix = this.buildFix(impl, m.objectName + \"~\" + m.method.name);\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, message, this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n }\r\n else {\r\n const issue = issue_1.Issue.atIdentifier(def.identifier, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n isImplemented(m, def, impl) {\r\n if (impl === undefined) {\r\n return false;\r\n }\r\n const name = m.objectName + \"~\" + m.method.name;\r\n let found = impl.methods.find(m => m.getName().toUpperCase() === name.toUpperCase());\r\n if (found === undefined) {\r\n // try looking for ALIASes\r\n for (const alias of def.aliases) {\r\n if (alias.component.toUpperCase() === name.toUpperCase()) {\r\n found = impl.methods.find(m => m.getName().toUpperCase() === alias.name.toUpperCase());\r\n break;\r\n }\r\n }\r\n }\r\n if (found === undefined && def.superClassName !== undefined) {\r\n const clas = this.findClass(def.superClassName);\r\n if (clas) {\r\n return this.isImplemented(m, clas === null || clas === void 0 ? void 0 : clas.def, clas === null || clas === void 0 ? void 0 : clas.impl);\r\n }\r\n }\r\n if (found === undefined) {\r\n for (const i of def.interfaces) {\r\n const idef = this.findInterfaceByName(i.name);\r\n if (idef === undefined) {\r\n continue;\r\n }\r\n const ali = this.viaAliasInInterface(m, idef, impl);\r\n if (ali) {\r\n return ali;\r\n }\r\n }\r\n }\r\n return found !== undefined;\r\n }\r\n viaAliasInInterface(m, intf, impl) {\r\n for (const a of intf.aliases) {\r\n if (a.component.toUpperCase() === m.objectName.toUpperCase() + \"~\" + m.method.name.toUpperCase()) {\r\n const name = intf.name + \"~\" + a.name;\r\n const found = impl.methods.find(m => m.getName().toUpperCase() === name.toUpperCase());\r\n if (found) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.ImplementMethods = ImplementMethods;\r\n//# sourceMappingURL=implement_methods.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/implement_methods.js?");
11966
11966
 
11967
11967
  /***/ }),
11968
11968
 
@@ -11973,7 +11973,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
11973
11973
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
11974
11974
 
11975
11975
  "use strict";
11976
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InStatementIndentation = exports.InStatementIndentationConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass InStatementIndentationConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Additional indent for first statement of blocks */\r\n this.blockStatements = 2;\r\n /** Ignore global exception classes */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.InStatementIndentationConf = InStatementIndentationConf;\r\nclass InStatementIndentation extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new InStatementIndentationConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"in_statement_indentation\",\r\n title: \"In-statement indentation\",\r\n shortDescription: \"Checks alignment within statements which span multiple lines.\",\r\n extendedInformation: `Lines following the first line should be indented once (2 spaces).\n \nFor block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)\nto distinguish them better from code within the block.`,\r\n badExample: `IF 1 = 1\n AND 2 = 2.\n WRITE 'hello' &&\n 'world'.\nENDIF.`,\r\n goodExample: `IF 1 = 1\n AND 2 = 2.\n WRITE 'hello' &&\n 'world'.\nENDIF.`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Fix in-statement indentation\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const ret = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof objects_1.Class) {\r\n const definition = obj.getClassDefinition();\r\n if (definition === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n for (const s of file.getStatements()) {\r\n if (s.get() instanceof _statement_1.Comment || s.get() instanceof _statement_1.Unknown) {\r\n continue;\r\n }\r\n const tokens = s.getTokens();\r\n if (tokens.length === 0) {\r\n continue;\r\n }\r\n const beginLine = tokens[0].getRow();\r\n let expected = tokens[0].getCol() + 2;\r\n const type = s.get();\r\n if (type instanceof Statements.If\r\n || type instanceof Statements.While\r\n || type instanceof Statements.Module\r\n || type instanceof Statements.SelectLoop\r\n || type instanceof Statements.FunctionModule\r\n || type instanceof Statements.Do\r\n || type instanceof Statements.At\r\n || type instanceof Statements.Catch\r\n || type instanceof Statements.Case\r\n || type instanceof Statements.When\r\n || type instanceof Statements.Cleanup\r\n || type instanceof Statements.Loop\r\n || type instanceof Statements.Form\r\n || type instanceof Statements.Else\r\n || type instanceof Statements.ElseIf\r\n || type instanceof Statements.MethodImplementation) {\r\n expected = expected + this.conf.blockStatements;\r\n }\r\n for (const t of tokens) {\r\n if (t.getRow() === beginLine) {\r\n continue;\r\n }\r\n if (t.getCol() < expected) {\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, new position_1.Position(t.getRow(), 1), t.getStart(), \" \".repeat(expected - 1));\r\n const issue = issue_1.Issue.atToken(file, t, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n break;\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.InStatementIndentation = InStatementIndentation;\r\n//# sourceMappingURL=in_statement_indentation.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js?");
11976
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InStatementIndentation = exports.InStatementIndentationConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass InStatementIndentationConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Additional indent for first statement of blocks */\r\n this.blockStatements = 2;\r\n /** Ignore global exception classes */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.InStatementIndentationConf = InStatementIndentationConf;\r\nclass InStatementIndentation extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new InStatementIndentationConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"in_statement_indentation\",\r\n title: \"In-statement indentation\",\r\n shortDescription: \"Checks alignment within statements which span multiple lines.\",\r\n extendedInformation: `Lines following the first line should be indented once (2 spaces).\r\n \r\nFor block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)\r\nto distinguish them better from code within the block.`,\r\n badExample: `IF 1 = 1\r\n AND 2 = 2.\r\n WRITE 'hello' &&\r\n 'world'.\r\nENDIF.`,\r\n goodExample: `IF 1 = 1\r\n AND 2 = 2.\r\n WRITE 'hello' &&\r\n 'world'.\r\nENDIF.`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Fix in-statement indentation\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const ret = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof objects_1.Class) {\r\n const definition = obj.getClassDefinition();\r\n if (definition === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n for (const s of file.getStatements()) {\r\n if (s.get() instanceof _statement_1.Comment || s.get() instanceof _statement_1.Unknown) {\r\n continue;\r\n }\r\n const tokens = s.getTokens();\r\n if (tokens.length === 0) {\r\n continue;\r\n }\r\n const beginLine = tokens[0].getRow();\r\n let expected = tokens[0].getCol() + 2;\r\n const type = s.get();\r\n if (type instanceof Statements.If\r\n || type instanceof Statements.While\r\n || type instanceof Statements.Module\r\n || type instanceof Statements.SelectLoop\r\n || type instanceof Statements.FunctionModule\r\n || type instanceof Statements.Do\r\n || type instanceof Statements.At\r\n || type instanceof Statements.Catch\r\n || type instanceof Statements.Case\r\n || type instanceof Statements.When\r\n || type instanceof Statements.Cleanup\r\n || type instanceof Statements.Loop\r\n || type instanceof Statements.Form\r\n || type instanceof Statements.Else\r\n || type instanceof Statements.ElseIf\r\n || type instanceof Statements.MethodImplementation) {\r\n expected = expected + this.conf.blockStatements;\r\n }\r\n for (const t of tokens) {\r\n if (t.getRow() === beginLine) {\r\n continue;\r\n }\r\n if (t.getCol() < expected) {\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, new position_1.Position(t.getRow(), 1), t.getStart(), \" \".repeat(expected - 1));\r\n const issue = issue_1.Issue.atToken(file, t, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n break;\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.InStatementIndentation = InStatementIndentation;\r\n//# sourceMappingURL=in_statement_indentation.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js?");
11977
11977
 
11978
11978
  /***/ }),
11979
11979
 
@@ -12017,7 +12017,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12017
12017
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12018
12018
 
12019
12019
  "use strict";
12020
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IntfReferencingClas = exports.IntfReferencingClasConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass IntfReferencingClasConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of classes allowed to be referenced, regex, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.allow = [];\r\n }\r\n}\r\nexports.IntfReferencingClasConf = IntfReferencingClasConf;\r\nclass IntfReferencingClas {\r\n constructor() {\r\n this.conf = new IntfReferencingClasConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"intf_referencing_clas\",\r\n title: \"INTF referencing CLAS\",\r\n shortDescription: `Interface contains references to class`,\r\n extendedInformation: `Only global interfaces are checked.\n Only first level references are checked.\n Exception class references are ignored.\n Void references are ignored.`,\r\n };\r\n }\r\n getConfig() {\r\n if (this.conf.allow === undefined) {\r\n this.conf.allow = [];\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof objects_1.Interface)) {\r\n return [];\r\n }\r\n return this.traverse(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n }\r\n ////////////////\r\n traverse(node) {\r\n var _a, _b;\r\n let ret = [];\r\n const message = \"Referencing CLAS: \";\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference\r\n && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooType) === \"CLAS\"\r\n && ((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooName) !== undefined) {\r\n const found = this.reg.getObject(\"CLAS\", r.extra.ooName) || undefined;\r\n if (found && ddic.isException(found.getClassDefinition(), found)) {\r\n continue;\r\n }\r\n else if (this.getConfig().allow.some(reg => new RegExp(reg, \"i\").test(r.extra.ooName))) {\r\n continue;\r\n }\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + r.extra.ooName, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.traverse(c));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.IntfReferencingClas = IntfReferencingClas;\r\n//# sourceMappingURL=intf_referencing_clas.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/intf_referencing_clas.js?");
12020
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IntfReferencingClas = exports.IntfReferencingClasConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass IntfReferencingClasConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of classes allowed to be referenced, regex, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.allow = [];\r\n }\r\n}\r\nexports.IntfReferencingClasConf = IntfReferencingClasConf;\r\nclass IntfReferencingClas {\r\n constructor() {\r\n this.conf = new IntfReferencingClasConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"intf_referencing_clas\",\r\n title: \"INTF referencing CLAS\",\r\n shortDescription: `Interface contains references to class`,\r\n extendedInformation: `Only global interfaces are checked.\r\n Only first level references are checked.\r\n Exception class references are ignored.\r\n Void references are ignored.`,\r\n };\r\n }\r\n getConfig() {\r\n if (this.conf.allow === undefined) {\r\n this.conf.allow = [];\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof objects_1.Interface)) {\r\n return [];\r\n }\r\n return this.traverse(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n }\r\n ////////////////\r\n traverse(node) {\r\n var _a, _b;\r\n let ret = [];\r\n const message = \"Referencing CLAS: \";\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference\r\n && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooType) === \"CLAS\"\r\n && ((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooName) !== undefined) {\r\n const found = this.reg.getObject(\"CLAS\", r.extra.ooName) || undefined;\r\n if (found && ddic.isException(found.getClassDefinition(), found)) {\r\n continue;\r\n }\r\n else if (this.getConfig().allow.some(reg => new RegExp(reg, \"i\").test(r.extra.ooName))) {\r\n continue;\r\n }\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + r.extra.ooName, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.traverse(c));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.IntfReferencingClas = IntfReferencingClas;\r\n//# sourceMappingURL=intf_referencing_clas.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/intf_referencing_clas.js?");
12021
12021
 
12022
12022
  /***/ }),
12023
12023
 
@@ -12061,7 +12061,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12061
12061
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12062
12062
 
12063
12063
  "use strict";
12064
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineBreakStyle = exports.LineBreakStyleConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LineBreakStyleConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.LineBreakStyleConf = LineBreakStyleConf;\r\nclass LineBreakStyle {\r\n constructor() {\r\n this.conf = new LineBreakStyleConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_break_style\",\r\n title: \"Makes sure line breaks are consistent in the ABAP code\",\r\n shortDescription: `Enforces LF as newlines in ABAP files\n\nabapGit does not work with CRLF`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const output = [];\r\n for (const file of obj.getFiles()) {\r\n if (file.getFilename().endsWith(\".abap\")) {\r\n const rows = file.getRawRows();\r\n for (let i = 0; i < rows.length; i++) {\r\n if (rows[i].endsWith(\"\\r\") === true) {\r\n const message = \"Line contains carriage return\";\r\n const issue = issue_1.Issue.atRow(file, i + 1, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n break; // only one finding per file\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.LineBreakStyle = LineBreakStyle;\r\n//# sourceMappingURL=line_break_style.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_break_style.js?");
12064
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineBreakStyle = exports.LineBreakStyleConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LineBreakStyleConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.LineBreakStyleConf = LineBreakStyleConf;\r\nclass LineBreakStyle {\r\n constructor() {\r\n this.conf = new LineBreakStyleConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_break_style\",\r\n title: \"Makes sure line breaks are consistent in the ABAP code\",\r\n shortDescription: `Enforces LF as newlines in ABAP files\r\n\r\nabapGit does not work with CRLF`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const output = [];\r\n for (const file of obj.getFiles()) {\r\n if (file.getFilename().endsWith(\".abap\")) {\r\n const rows = file.getRawRows();\r\n for (let i = 0; i < rows.length; i++) {\r\n if (rows[i].endsWith(\"\\r\") === true) {\r\n const message = \"Line contains carriage return\";\r\n const issue = issue_1.Issue.atRow(file, i + 1, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n break; // only one finding per file\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.LineBreakStyle = LineBreakStyle;\r\n//# sourceMappingURL=line_break_style.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_break_style.js?");
12065
12065
 
12066
12066
  /***/ }),
12067
12067
 
@@ -12072,7 +12072,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12072
12072
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12073
12073
 
12074
12074
  "use strict";
12075
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineLength = exports.LineLengthConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LineLengthConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Maximum line length in characters, trailing whitespace ignored */\r\n this.length = 120;\r\n }\r\n}\r\nexports.LineLengthConf = LineLengthConf;\r\nclass LineLength extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LineLengthConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_length\",\r\n title: \"Line length\",\r\n shortDescription: `Detects lines exceeding the provided maximum length.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length\nhttps://docs.abapopenchecks.org/checks/04/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n // maximum line length in abap files\r\n const maxLineLength = 255;\r\n file.getRawRows().forEach((row, rowIndex) => {\r\n row = row.replace(\"\\r\", \"\");\r\n let message = \"\";\r\n if (row.length > maxLineLength) {\r\n message = `Maximum allowed line length of ${maxLineLength} exceeded, currently ${row.length}`;\r\n }\r\n else if (row.length > this.conf.length) {\r\n message = `Reduce line length to max ${this.conf.length}, currently ${row.length}`;\r\n }\r\n else {\r\n return;\r\n }\r\n issues.push(issue_1.Issue.atRow(file, rowIndex + 1, message, this.getMetadata().key, this.conf.severity));\r\n });\r\n return issues;\r\n }\r\n}\r\nexports.LineLength = LineLength;\r\n//# sourceMappingURL=line_length.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_length.js?");
12075
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineLength = exports.LineLengthConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LineLengthConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Maximum line length in characters, trailing whitespace ignored */\r\n this.length = 120;\r\n }\r\n}\r\nexports.LineLengthConf = LineLengthConf;\r\nclass LineLength extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LineLengthConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_length\",\r\n title: \"Line length\",\r\n shortDescription: `Detects lines exceeding the provided maximum length.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length\r\nhttps://docs.abapopenchecks.org/checks/04/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n // maximum line length in abap files\r\n const maxLineLength = 255;\r\n file.getRawRows().forEach((row, rowIndex) => {\r\n row = row.replace(\"\\r\", \"\");\r\n let message = \"\";\r\n if (row.length > maxLineLength) {\r\n message = `Maximum allowed line length of ${maxLineLength} exceeded, currently ${row.length}`;\r\n }\r\n else if (row.length > this.conf.length) {\r\n message = `Reduce line length to max ${this.conf.length}, currently ${row.length}`;\r\n }\r\n else {\r\n return;\r\n }\r\n issues.push(issue_1.Issue.atRow(file, rowIndex + 1, message, this.getMetadata().key, this.conf.severity));\r\n });\r\n return issues;\r\n }\r\n}\r\nexports.LineLength = LineLength;\r\n//# sourceMappingURL=line_length.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_length.js?");
12076
12076
 
12077
12077
  /***/ }),
12078
12078
 
@@ -12083,7 +12083,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12083
12083
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12084
12084
 
12085
12085
  "use strict";
12086
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineOnlyPunc = exports.LineOnlyPuncConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass LineOnlyPuncConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore lines with only puncutation in global exception classes */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.LineOnlyPuncConf = LineOnlyPuncConf;\r\nclass LineOnlyPunc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LineOnlyPuncConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_only_punc\",\r\n title: \"Line containing only punctuation\",\r\n shortDescription: `Detects lines containing only punctuation.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end\nhttps://docs.abapopenchecks.org/checks/16/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: \"zcl_class=>method(\\n).\",\r\n goodExample: \"zcl_class=>method( ).\",\r\n };\r\n }\r\n getMessage() {\r\n return \"A line should not contain only \\\".\\\" or \\\").\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof objects_1.Class) {\r\n const definition = obj.getClassDefinition();\r\n if (definition === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n const rows = file.getRawRows();\r\n const reg = new RegExp(\"^\\\\)?\\\\. *(\\\\\\\".*)?$\");\r\n for (let i = 0; i < rows.length; i++) {\r\n if (reg.exec(rows[i].trim())) {\r\n const column = rows[i].indexOf(\")\") >= 0 ? rows[i].indexOf(\")\") + 1 : rows[i].indexOf(\".\") + 1;\r\n const position = new position_1.Position(i + 1, column);\r\n // merge punc into previous row\r\n let rowContent = rows[i].trim();\r\n // if reported row contains a paranthesis, prefix with space if needed\r\n if (rowContent.length > 1 && !rows[i - 1].endsWith(\" \") && !rows[i - 1].endsWith(\" \\r\")) {\r\n rowContent = \" \" + rowContent;\r\n }\r\n let offset = 0;\r\n if (rows[i - 1].endsWith(\"\\r\")) {\r\n offset = -1;\r\n }\r\n const startPos = new position_1.Position(i, rows[i - 1].length + 1 + offset);\r\n const endPos = new position_1.Position(i + 1, rows[i].length + 1);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, startPos, endPos, rowContent);\r\n const issue = issue_1.Issue.atPosition(file, position, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.LineOnlyPunc = LineOnlyPunc;\r\n//# sourceMappingURL=line_only_punc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_only_punc.js?");
12086
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineOnlyPunc = exports.LineOnlyPuncConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass LineOnlyPuncConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore lines with only puncutation in global exception classes */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.LineOnlyPuncConf = LineOnlyPuncConf;\r\nclass LineOnlyPunc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LineOnlyPuncConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_only_punc\",\r\n title: \"Line containing only punctuation\",\r\n shortDescription: `Detects lines containing only punctuation.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end\r\nhttps://docs.abapopenchecks.org/checks/16/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: \"zcl_class=>method(\\n).\",\r\n goodExample: \"zcl_class=>method( ).\",\r\n };\r\n }\r\n getMessage() {\r\n return \"A line should not contain only \\\".\\\" or \\\").\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof objects_1.Class) {\r\n const definition = obj.getClassDefinition();\r\n if (definition === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n const rows = file.getRawRows();\r\n const reg = new RegExp(\"^\\\\)?\\\\. *(\\\\\\\".*)?$\");\r\n for (let i = 0; i < rows.length; i++) {\r\n if (reg.exec(rows[i].trim())) {\r\n const column = rows[i].indexOf(\")\") >= 0 ? rows[i].indexOf(\")\") + 1 : rows[i].indexOf(\".\") + 1;\r\n const position = new position_1.Position(i + 1, column);\r\n // merge punc into previous row\r\n let rowContent = rows[i].trim();\r\n // if reported row contains a paranthesis, prefix with space if needed\r\n if (rowContent.length > 1 && !rows[i - 1].endsWith(\" \") && !rows[i - 1].endsWith(\" \\r\")) {\r\n rowContent = \" \" + rowContent;\r\n }\r\n let offset = 0;\r\n if (rows[i - 1].endsWith(\"\\r\")) {\r\n offset = -1;\r\n }\r\n const startPos = new position_1.Position(i, rows[i - 1].length + 1 + offset);\r\n const endPos = new position_1.Position(i + 1, rows[i].length + 1);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, startPos, endPos, rowContent);\r\n const issue = issue_1.Issue.atPosition(file, position, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.LineOnlyPunc = LineOnlyPunc;\r\n//# sourceMappingURL=line_only_punc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_only_punc.js?");
12087
12087
 
12088
12088
  /***/ }),
12089
12089
 
@@ -12116,7 +12116,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12116
12116
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12117
12117
 
12118
12118
  "use strict";
12119
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LocalVariableNames = exports.LocalVariableNamesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _naming_rule_config_1 = __webpack_require__(/*! ./_naming_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_naming_rule_config.js\");\r\nconst name_validator_1 = __webpack_require__(/*! ../utils/name_validator */ \"./node_modules/@abaplint/core/build/src/utils/name_validator.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LocalVariableNamesConf extends _naming_rule_config_1.NamingRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** The pattern for local variable names */\r\n this.expectedData = \"^L._.+$\";\r\n /** The pattern for local constant names */\r\n this.expectedConstant = \"^LC_.+$\";\r\n /** The pattern for field symbol names */\r\n this.expectedFS = \"^<L._.+>$\";\r\n }\r\n}\r\nexports.LocalVariableNamesConf = LocalVariableNamesConf;\r\nclass LocalVariableNames extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LocalVariableNamesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"local_variable_names\",\r\n title: \"Local variable naming conventions\",\r\n shortDescription: `\nAllows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.\nRegexes are case-insensitive.`,\r\n tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(expected, actual) {\r\n return this.conf.patternKind === \"required\" ?\r\n \"Local variable name does not match pattern \" + expected + \": \" + actual :\r\n \"Local variable name must not match pattern \" + expected + \": \" + actual;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const ret = [];\r\n if (this.conf.patternKind === undefined) {\r\n this.conf.patternKind = \"required\";\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n // inside METHOD, FORM, FUNCTION MODULE\r\n for (const node of stru.findAllStructures(Structures.Form)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n for (const node of stru.findAllStructures(Structures.Method)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n for (const node of stru.findAllStructures(Structures.FunctionModule)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n return ret;\r\n }\r\n checkLocals(structure, file) {\r\n let ret = [];\r\n // data, field symbols\r\n for (const dat of structure.findAllStatements(Statements.Data)) {\r\n const parent = structure.findParent(dat);\r\n if (parent && parent.get() instanceof Structures.Data) {\r\n continue; // inside DATA BEGIN OF\r\n }\r\n const found = dat.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n // inline data\r\n for (const dat of structure.findAllExpressions(Expressions.InlineData)) {\r\n const found = dat.findFirstExpression(Expressions.TargetField);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n // data structures, data begin of, first level\r\n const dataStructures = structure.findAllStructures(Structures.Data);\r\n for (const struc of dataStructures) {\r\n // ignore nested DATA BEGIN\r\n const stat = struc.findFirstStatement(Statements.DataBegin);\r\n const found = stat === null || stat === void 0 ? void 0 : stat.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n for (const fieldsymbol of structure.findAllStatements(Statements.FieldSymbol)) {\r\n const found = fieldsymbol.findFirstExpression(Expressions.FieldSymbol);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedFS));\r\n }\r\n }\r\n // inline field symbols\r\n for (const fieldsymbol of structure.findAllExpressions(Expressions.InlineFS)) {\r\n const found = fieldsymbol.findFirstExpression(Expressions.TargetFieldSymbol);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedFS));\r\n }\r\n }\r\n const constants = structure.findAllStatements(Statements.Constant);\r\n for (const constant of constants) {\r\n const parent = structure.findParent(constant);\r\n if (parent && parent.get() instanceof Structures.Constants) {\r\n continue; // inside DATA BEGIN OF\r\n }\r\n const found = constant.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedConstant));\r\n }\r\n }\r\n return ret;\r\n }\r\n checkName(token, file, expected) {\r\n const ret = [];\r\n const regex = new RegExp(expected, \"i\");\r\n const name = token.getStr();\r\n if (name_validator_1.NameValidator.violatesRule(name, regex, this.conf)) {\r\n const message = this.getDescription(expected, name);\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.LocalVariableNames = LocalVariableNames;\r\n//# sourceMappingURL=local_variable_names.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/local_variable_names.js?");
12119
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LocalVariableNames = exports.LocalVariableNamesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _naming_rule_config_1 = __webpack_require__(/*! ./_naming_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_naming_rule_config.js\");\r\nconst name_validator_1 = __webpack_require__(/*! ../utils/name_validator */ \"./node_modules/@abaplint/core/build/src/utils/name_validator.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LocalVariableNamesConf extends _naming_rule_config_1.NamingRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** The pattern for local variable names */\r\n this.expectedData = \"^L._.+$\";\r\n /** The pattern for local constant names */\r\n this.expectedConstant = \"^LC_.+$\";\r\n /** The pattern for field symbol names */\r\n this.expectedFS = \"^<L._.+>$\";\r\n }\r\n}\r\nexports.LocalVariableNamesConf = LocalVariableNamesConf;\r\nclass LocalVariableNames extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LocalVariableNamesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"local_variable_names\",\r\n title: \"Local variable naming conventions\",\r\n shortDescription: `\r\nAllows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.\r\nRegexes are case-insensitive.`,\r\n tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(expected, actual) {\r\n return this.conf.patternKind === \"required\" ?\r\n \"Local variable name does not match pattern \" + expected + \": \" + actual :\r\n \"Local variable name must not match pattern \" + expected + \": \" + actual;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const ret = [];\r\n if (this.conf.patternKind === undefined) {\r\n this.conf.patternKind = \"required\";\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n // inside METHOD, FORM, FUNCTION MODULE\r\n for (const node of stru.findAllStructures(Structures.Form)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n for (const node of stru.findAllStructures(Structures.Method)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n for (const node of stru.findAllStructures(Structures.FunctionModule)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n return ret;\r\n }\r\n checkLocals(structure, file) {\r\n let ret = [];\r\n // data, field symbols\r\n for (const dat of structure.findAllStatements(Statements.Data)) {\r\n const parent = structure.findParent(dat);\r\n if (parent && parent.get() instanceof Structures.Data) {\r\n continue; // inside DATA BEGIN OF\r\n }\r\n const found = dat.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n // inline data\r\n for (const dat of structure.findAllExpressions(Expressions.InlineData)) {\r\n const found = dat.findFirstExpression(Expressions.TargetField);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n // data structures, data begin of, first level\r\n const dataStructures = structure.findAllStructures(Structures.Data);\r\n for (const struc of dataStructures) {\r\n // ignore nested DATA BEGIN\r\n const stat = struc.findFirstStatement(Statements.DataBegin);\r\n const found = stat === null || stat === void 0 ? void 0 : stat.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n for (const fieldsymbol of structure.findAllStatements(Statements.FieldSymbol)) {\r\n const found = fieldsymbol.findFirstExpression(Expressions.FieldSymbol);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedFS));\r\n }\r\n }\r\n // inline field symbols\r\n for (const fieldsymbol of structure.findAllExpressions(Expressions.InlineFS)) {\r\n const found = fieldsymbol.findFirstExpression(Expressions.TargetFieldSymbol);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedFS));\r\n }\r\n }\r\n const constants = structure.findAllStatements(Statements.Constant);\r\n for (const constant of constants) {\r\n const parent = structure.findParent(constant);\r\n if (parent && parent.get() instanceof Structures.Constants) {\r\n continue; // inside DATA BEGIN OF\r\n }\r\n const found = constant.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedConstant));\r\n }\r\n }\r\n return ret;\r\n }\r\n checkName(token, file, expected) {\r\n const ret = [];\r\n const regex = new RegExp(expected, \"i\");\r\n const name = token.getStr();\r\n if (name_validator_1.NameValidator.violatesRule(name, regex, this.conf)) {\r\n const message = this.getDescription(expected, name);\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.LocalVariableNames = LocalVariableNames;\r\n//# sourceMappingURL=local_variable_names.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/local_variable_names.js?");
12120
12120
 
12121
12121
  /***/ }),
12122
12122
 
@@ -12138,7 +12138,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12138
12138
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12139
12139
 
12140
12140
  "use strict";
12141
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ManyParentheses = exports.ManyParenthesesConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ManyParenthesesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ManyParenthesesConf = ManyParenthesesConf;\r\nclass ManyParentheses extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ManyParenthesesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"many_parentheses\",\r\n title: \"Too many parentheses\",\r\n shortDescription: `Searches for expressions where extra parentheses can safely be removed`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n badExample: `\nIF ( destination IS INITIAL ).\nENDIF.\nIF foo = boo AND ( bar = lar AND moo = loo ).\nENDIF.\n`,\r\n goodExample: `\nIF destination IS INITIAL.\nENDIF.\nIF foo = boo AND bar = lar AND moo = loo.\nENDIF.\n`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const cond of structure.findAllExpressions(Expressions.Cond)) {\r\n issues.push(...this.analyze(file, cond));\r\n }\r\n for (const sub of structure.findAllExpressions(Expressions.CondSub)) {\r\n const cond = sub.findDirectExpressions(Expressions.Cond);\r\n if (cond.length !== 1) {\r\n continue;\r\n }\r\n if (cond[0].getChildren().length === 1) {\r\n const message = \"Too many parentheses, simple\";\r\n const fixText = sub.getChildren()[1].concatTokens();\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, sub.getFirstToken().getStart(), sub.getLastToken().getEnd(), fixText);\r\n const issue = issue_1.Issue.atToken(file, sub.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const m of structure.findAllStatements(Statements.Move)) {\r\n issues.push(...this.analyzeMove(file, m));\r\n }\r\n for (const m of structure.findAllStatements(Statements.Select)) {\r\n issues.push(...this.analyzeInto(file, m));\r\n }\r\n return issues;\r\n }\r\n ////////////////////\r\n analyzeInto(file, m) {\r\n const into = m.findFirstExpression(Expressions.SQLIntoStructure);\r\n if (into === undefined) {\r\n return [];\r\n }\r\n const second = into.getAllTokens()[1];\r\n if (second === undefined || second.getStr() !== \"(\") {\r\n return [];\r\n }\r\n const concat = into.concatTokens();\r\n if (concat.endsWith(\")\") === true && concat.includes(\",\") === false) {\r\n const issue = issue_1.Issue.atStatement(file, m, \"Too many parentheses\", this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n analyzeMove(file, m) {\r\n const issues = [];\r\n const children = m.getChildren();\r\n const last = children[children.length - 2];\r\n const lastChildren = last.getChildren();\r\n if (lastChildren.length === 3\r\n && lastChildren[0].getFirstToken().getStr() === \"(\"\r\n && lastChildren[2].getFirstToken().getStr() === \")\") {\r\n const issue = issue_1.Issue.atToken(file, last.getFirstToken(), \"Too many parentheses\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n analyze(file, cond) {\r\n const issues = [];\r\n let comparator = \"\";\r\n for (const c of cond.getChildren()) {\r\n let current = \"\";\r\n if (c instanceof nodes_1.TokenNode) {\r\n current = c.get().getStr().toUpperCase();\r\n }\r\n else if (c instanceof nodes_1.ExpressionNode && c.get() instanceof Expressions.CondSub) {\r\n if (c.getFirstToken().getStr().toUpperCase() === \"NOT\") {\r\n return [];\r\n }\r\n const i = c.findDirectExpression(Expressions.Cond);\r\n if (i === undefined) {\r\n return [];\r\n }\r\n current = this.findComparator(i);\r\n }\r\n if (comparator === \"\") {\r\n comparator = current;\r\n }\r\n else if (comparator !== current) {\r\n return [];\r\n }\r\n }\r\n if (comparator !== \"\" && comparator !== \"MIXED\") {\r\n const message = \"Too many parentheses, complex\";\r\n const issue = issue_1.Issue.atToken(file, cond.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n findComparator(cond) {\r\n let comparator = \"\";\r\n const children = cond.getChildren();\r\n for (const c of children) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n const current = c.get().getStr().toUpperCase();\r\n if (comparator === \"\") {\r\n comparator = current;\r\n }\r\n else if (current !== comparator) {\r\n return \"MIXED\";\r\n }\r\n }\r\n }\r\n return comparator;\r\n }\r\n}\r\nexports.ManyParentheses = ManyParentheses;\r\n//# sourceMappingURL=many_parentheses.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/many_parentheses.js?");
12141
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ManyParentheses = exports.ManyParenthesesConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ManyParenthesesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ManyParenthesesConf = ManyParenthesesConf;\r\nclass ManyParentheses extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ManyParenthesesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"many_parentheses\",\r\n title: \"Too many parentheses\",\r\n shortDescription: `Searches for expressions where extra parentheses can safely be removed`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n badExample: `\r\nIF ( destination IS INITIAL ).\r\nENDIF.\r\nIF foo = boo AND ( bar = lar AND moo = loo ).\r\nENDIF.\r\n`,\r\n goodExample: `\r\nIF destination IS INITIAL.\r\nENDIF.\r\nIF foo = boo AND bar = lar AND moo = loo.\r\nENDIF.\r\n`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const cond of structure.findAllExpressions(Expressions.Cond)) {\r\n issues.push(...this.analyze(file, cond));\r\n }\r\n for (const sub of structure.findAllExpressions(Expressions.CondSub)) {\r\n const cond = sub.findDirectExpressions(Expressions.Cond);\r\n if (cond.length !== 1) {\r\n continue;\r\n }\r\n if (cond[0].getChildren().length === 1) {\r\n const message = \"Too many parentheses, simple\";\r\n const fixText = sub.getChildren()[1].concatTokens();\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, sub.getFirstToken().getStart(), sub.getLastToken().getEnd(), fixText);\r\n const issue = issue_1.Issue.atToken(file, sub.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const m of structure.findAllStatements(Statements.Move)) {\r\n issues.push(...this.analyzeMove(file, m));\r\n }\r\n for (const m of structure.findAllStatements(Statements.Select)) {\r\n issues.push(...this.analyzeInto(file, m));\r\n }\r\n return issues;\r\n }\r\n ////////////////////\r\n analyzeInto(file, m) {\r\n const into = m.findFirstExpression(Expressions.SQLIntoStructure);\r\n if (into === undefined) {\r\n return [];\r\n }\r\n const second = into.getAllTokens()[1];\r\n if (second === undefined || second.getStr() !== \"(\") {\r\n return [];\r\n }\r\n const concat = into.concatTokens();\r\n if (concat.endsWith(\")\") === true && concat.includes(\",\") === false) {\r\n const issue = issue_1.Issue.atStatement(file, m, \"Too many parentheses\", this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n analyzeMove(file, m) {\r\n const issues = [];\r\n const children = m.getChildren();\r\n const last = children[children.length - 2];\r\n const lastChildren = last.getChildren();\r\n if (lastChildren.length === 3\r\n && lastChildren[0].getFirstToken().getStr() === \"(\"\r\n && lastChildren[2].getFirstToken().getStr() === \")\") {\r\n const issue = issue_1.Issue.atToken(file, last.getFirstToken(), \"Too many parentheses\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n analyze(file, cond) {\r\n const issues = [];\r\n let comparator = \"\";\r\n for (const c of cond.getChildren()) {\r\n let current = \"\";\r\n if (c instanceof nodes_1.TokenNode) {\r\n current = c.get().getStr().toUpperCase();\r\n }\r\n else if (c instanceof nodes_1.ExpressionNode && c.get() instanceof Expressions.CondSub) {\r\n if (c.getFirstToken().getStr().toUpperCase() === \"NOT\") {\r\n return [];\r\n }\r\n const i = c.findDirectExpression(Expressions.Cond);\r\n if (i === undefined) {\r\n return [];\r\n }\r\n current = this.findComparator(i);\r\n }\r\n if (comparator === \"\") {\r\n comparator = current;\r\n }\r\n else if (comparator !== current) {\r\n return [];\r\n }\r\n }\r\n if (comparator !== \"\" && comparator !== \"MIXED\") {\r\n const message = \"Too many parentheses, complex\";\r\n const issue = issue_1.Issue.atToken(file, cond.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n findComparator(cond) {\r\n let comparator = \"\";\r\n const children = cond.getChildren();\r\n for (const c of children) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n const current = c.get().getStr().toUpperCase();\r\n if (comparator === \"\") {\r\n comparator = current;\r\n }\r\n else if (current !== comparator) {\r\n return \"MIXED\";\r\n }\r\n }\r\n }\r\n return comparator;\r\n }\r\n}\r\nexports.ManyParentheses = ManyParentheses;\r\n//# sourceMappingURL=many_parentheses.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/many_parentheses.js?");
12142
12142
 
12143
12143
  /***/ }),
12144
12144
 
@@ -12149,7 +12149,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12149
12149
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12150
12150
 
12151
12151
  "use strict";
12152
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MaxOneMethodParameterPerLine = exports.MaxOneMethodParameterPerLineConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass MaxOneMethodParameterPerLineConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.MaxOneMethodParameterPerLineConf = MaxOneMethodParameterPerLineConf;\r\nclass MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new MaxOneMethodParameterPerLineConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"max_one_method_parameter_per_line\",\r\n title: \"Max one method parameter definition per line\",\r\n shortDescription: `Keep max one method parameter description per line`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],\r\n badExample: `\nMETHODS apps_scope_token\n IMPORTING\n body TYPE bodyapps_scope_token client_id TYPE str.`,\r\n goodExample: `\nMETHODS apps_scope_token\n IMPORTING\n body TYPE bodyapps_scope_token\n client_id TYPE str.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n for (const statement of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.MethodDef)) || []) {\r\n let prev = undefined;\r\n for (const p of statement.findAllExpressions(Expressions.MethodParam)) {\r\n if (prev === undefined) {\r\n prev = p;\r\n continue;\r\n }\r\n if (prev.getFirstToken().getStart().getRow() === p.getFirstToken().getStart().getRow()) {\r\n const issue = issue_1.Issue.atToken(file, prev.getFirstToken(), this.getMetadata().title, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n prev = p;\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.MaxOneMethodParameterPerLine = MaxOneMethodParameterPerLine;\r\n//# sourceMappingURL=max_one_method_parameter_per_line.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/max_one_method_parameter_per_line.js?");
12152
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MaxOneMethodParameterPerLine = exports.MaxOneMethodParameterPerLineConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass MaxOneMethodParameterPerLineConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.MaxOneMethodParameterPerLineConf = MaxOneMethodParameterPerLineConf;\r\nclass MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new MaxOneMethodParameterPerLineConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"max_one_method_parameter_per_line\",\r\n title: \"Max one method parameter definition per line\",\r\n shortDescription: `Keep max one method parameter description per line`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],\r\n badExample: `\r\nMETHODS apps_scope_token\r\n IMPORTING\r\n body TYPE bodyapps_scope_token client_id TYPE str.`,\r\n goodExample: `\r\nMETHODS apps_scope_token\r\n IMPORTING\r\n body TYPE bodyapps_scope_token\r\n client_id TYPE str.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n for (const statement of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.MethodDef)) || []) {\r\n let prev = undefined;\r\n for (const p of statement.findAllExpressions(Expressions.MethodParam)) {\r\n if (prev === undefined) {\r\n prev = p;\r\n continue;\r\n }\r\n if (prev.getFirstToken().getStart().getRow() === p.getFirstToken().getStart().getRow()) {\r\n const issue = issue_1.Issue.atToken(file, prev.getFirstToken(), this.getMetadata().title, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n prev = p;\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.MaxOneMethodParameterPerLine = MaxOneMethodParameterPerLine;\r\n//# sourceMappingURL=max_one_method_parameter_per_line.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/max_one_method_parameter_per_line.js?");
12153
12153
 
12154
12154
  /***/ }),
12155
12155
 
@@ -12160,7 +12160,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12160
12160
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12161
12161
 
12162
12162
  "use strict";
12163
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MaxOneStatement = exports.MaxOneStatementConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass MaxOneStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.MaxOneStatementConf = MaxOneStatementConf;\r\nclass MaxOneStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new MaxOneStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"max_one_statement\",\r\n title: \"Max one statement per line\",\r\n shortDescription: `Checks that each line contains only a single statement.`,\r\n extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.\n\nDoes not report anything for chained statements.\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line\nhttps://docs.abapopenchecks.org/checks/11/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `WRITE foo. WRITE bar.`,\r\n goodExample: `WRITE foo.\\nWRITE bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Only one statement is allowed per line\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let prev = 0;\r\n let reported = 0;\r\n for (const statement of file.getStatements()) {\r\n const term = statement.getTerminator();\r\n if (statement.get() instanceof _statement_1.Comment\r\n || statement.get() instanceof _statement_1.NativeSQL\r\n || term === \",\") {\r\n continue;\r\n }\r\n const pos = statement.getStart();\r\n if (pos instanceof position_1.VirtualPosition) {\r\n continue;\r\n }\r\n const row = pos.getRow();\r\n if (prev === row && row !== reported && statement.getFirstToken().getStr() !== \".\") {\r\n const fix = edit_helper_1.EditHelper.insertAt(file, pos, \"\\n\");\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n reported = row;\r\n }\r\n prev = row;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.MaxOneStatement = MaxOneStatement;\r\n//# sourceMappingURL=max_one_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/max_one_statement.js?");
12163
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MaxOneStatement = exports.MaxOneStatementConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass MaxOneStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.MaxOneStatementConf = MaxOneStatementConf;\r\nclass MaxOneStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new MaxOneStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"max_one_statement\",\r\n title: \"Max one statement per line\",\r\n shortDescription: `Checks that each line contains only a single statement.`,\r\n extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.\r\n\r\nDoes not report anything for chained statements.\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line\r\nhttps://docs.abapopenchecks.org/checks/11/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `WRITE foo. WRITE bar.`,\r\n goodExample: `WRITE foo.\\nWRITE bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Only one statement is allowed per line\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let prev = 0;\r\n let reported = 0;\r\n for (const statement of file.getStatements()) {\r\n const term = statement.getTerminator();\r\n if (statement.get() instanceof _statement_1.Comment\r\n || statement.get() instanceof _statement_1.NativeSQL\r\n || term === \",\") {\r\n continue;\r\n }\r\n const pos = statement.getStart();\r\n if (pos instanceof position_1.VirtualPosition) {\r\n continue;\r\n }\r\n const row = pos.getRow();\r\n if (prev === row && row !== reported && statement.getFirstToken().getStr() !== \".\") {\r\n const fix = edit_helper_1.EditHelper.insertAt(file, pos, \"\\n\");\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n reported = row;\r\n }\r\n prev = row;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.MaxOneStatement = MaxOneStatement;\r\n//# sourceMappingURL=max_one_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/max_one_statement.js?");
12164
12164
 
12165
12165
  /***/ }),
12166
12166
 
@@ -12204,7 +12204,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12204
12204
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12205
12205
 
12206
12206
  "use strict";
12207
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodOverwritesBuiltIn = exports.MethodOverwritesBuiltInConf = void 0;\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass MethodOverwritesBuiltInConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.MethodOverwritesBuiltInConf = MethodOverwritesBuiltInConf;\r\nclass MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new MethodOverwritesBuiltInConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"method_overwrites_builtin\",\r\n title: \"Method name overwrites builtin function\",\r\n shortDescription: `Checks Method names that overwrite builtin SAP functions`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions`,\r\n tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let methods = [];\r\n for (const classDef of file.getInfo().listClassDefinitions()) {\r\n methods = methods.concat(classDef.methods);\r\n }\r\n for (const intfDef of file.getInfo().listInterfaceDefinitions()) {\r\n methods = methods.concat(intfDef.methods);\r\n }\r\n const builtIn = new _builtin_1.BuiltIn();\r\n for (const method of methods) {\r\n if (builtIn.searchBuiltin(method.name.toUpperCase())) {\r\n const message = `Method name \"${method.name}\" overwrites built-in SAP function name`;\r\n issues.push(__1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.MethodOverwritesBuiltIn = MethodOverwritesBuiltIn;\r\n//# sourceMappingURL=method_overwrites_builtin.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/method_overwrites_builtin.js?");
12207
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MethodOverwritesBuiltIn = exports.MethodOverwritesBuiltInConf = void 0;\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nconst _builtin_1 = __webpack_require__(/*! ../abap/5_syntax/_builtin */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_builtin.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass MethodOverwritesBuiltInConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.MethodOverwritesBuiltInConf = MethodOverwritesBuiltInConf;\r\nclass MethodOverwritesBuiltIn extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new MethodOverwritesBuiltInConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"method_overwrites_builtin\",\r\n title: \"Method name overwrites builtin function\",\r\n shortDescription: `Checks Method names that overwrite builtin SAP functions`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abenbuilt_in_functions_overview.htm\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obscuring-built-in-functions`,\r\n tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let methods = [];\r\n for (const classDef of file.getInfo().listClassDefinitions()) {\r\n methods = methods.concat(classDef.methods);\r\n }\r\n for (const intfDef of file.getInfo().listInterfaceDefinitions()) {\r\n methods = methods.concat(intfDef.methods);\r\n }\r\n const builtIn = new _builtin_1.BuiltIn();\r\n for (const method of methods) {\r\n if (builtIn.searchBuiltin(method.name.toUpperCase())) {\r\n const message = `Method name \"${method.name}\" overwrites built-in SAP function name`;\r\n issues.push(__1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.MethodOverwritesBuiltIn = MethodOverwritesBuiltIn;\r\n//# sourceMappingURL=method_overwrites_builtin.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/method_overwrites_builtin.js?");
12208
12208
 
12209
12209
  /***/ }),
12210
12210
 
@@ -12270,7 +12270,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12270
12270
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12271
12271
 
12272
12272
  "use strict";
12273
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Nesting = exports.NestingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NestingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Maximum allowed nesting depth */\r\n this.depth = 5;\r\n }\r\n}\r\nexports.NestingConf = NestingConf;\r\nclass Nesting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NestingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"nesting\",\r\n title: \"Check nesting depth\",\r\n shortDescription: `Checks for methods exceeding a maximum nesting depth`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low\nhttps://docs.abapopenchecks.org/checks/74/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(max) {\r\n return \"Reduce nesting depth to max \" + max;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let depth = 0;\r\n for (const statement of file.getStatements()) {\r\n const type = statement.get();\r\n if (type instanceof Statements.If\r\n || type instanceof Statements.Case\r\n || type instanceof Statements.While\r\n || type instanceof Statements.Loop\r\n || type instanceof Statements.SelectLoop\r\n || type instanceof Statements.Do\r\n || type instanceof Statements.Try) {\r\n depth = depth + 1;\r\n }\r\n else if (type instanceof Statements.EndIf\r\n || type instanceof Statements.EndCase\r\n || type instanceof Statements.EndWhile\r\n || type instanceof Statements.EndLoop\r\n || type instanceof Statements.EndSelect\r\n || type instanceof Statements.EndDo\r\n || type instanceof Statements.EndTry) {\r\n depth = depth - 1;\r\n }\r\n if (depth > this.conf.depth) {\r\n const pos = statement.getFirstToken().getStart();\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getDescription(this.conf.depth.toString()), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n break; // only one finding per file\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Nesting = Nesting;\r\n//# sourceMappingURL=nesting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/nesting.js?");
12273
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Nesting = exports.NestingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NestingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Maximum allowed nesting depth */\r\n this.depth = 5;\r\n }\r\n}\r\nexports.NestingConf = NestingConf;\r\nclass Nesting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NestingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"nesting\",\r\n title: \"Check nesting depth\",\r\n shortDescription: `Checks for methods exceeding a maximum nesting depth`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low\r\nhttps://docs.abapopenchecks.org/checks/74/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(max) {\r\n return \"Reduce nesting depth to max \" + max;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let depth = 0;\r\n for (const statement of file.getStatements()) {\r\n const type = statement.get();\r\n if (type instanceof Statements.If\r\n || type instanceof Statements.Case\r\n || type instanceof Statements.While\r\n || type instanceof Statements.Loop\r\n || type instanceof Statements.SelectLoop\r\n || type instanceof Statements.Do\r\n || type instanceof Statements.Try) {\r\n depth = depth + 1;\r\n }\r\n else if (type instanceof Statements.EndIf\r\n || type instanceof Statements.EndCase\r\n || type instanceof Statements.EndWhile\r\n || type instanceof Statements.EndLoop\r\n || type instanceof Statements.EndSelect\r\n || type instanceof Statements.EndDo\r\n || type instanceof Statements.EndTry) {\r\n depth = depth - 1;\r\n }\r\n if (depth > this.conf.depth) {\r\n const pos = statement.getFirstToken().getStart();\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getDescription(this.conf.depth.toString()), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n break; // only one finding per file\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Nesting = Nesting;\r\n//# sourceMappingURL=nesting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/nesting.js?");
12274
12274
 
12275
12275
  /***/ }),
12276
12276
 
@@ -12303,7 +12303,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12303
12303
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12304
12304
 
12305
12305
  "use strict";
12306
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoChainedAssignment = exports.NoChainedAssignmentConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoChainedAssignmentConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NoChainedAssignmentConf = NoChainedAssignmentConf;\r\nclass NoChainedAssignment extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoChainedAssignmentConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_chained_assignment\",\r\n title: \"No chained assignment\",\r\n shortDescription: `Find chained assingments and reports issues`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],\r\n badExample: `var1 = var2 = var3.`,\r\n goodExample: `var2 = var3.\nvar1 = var2.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const s of file.getStatements()) {\r\n if (!(s.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n if (s.findDirectExpressions(Expressions.Target).length >= 2) {\r\n const message = \"No chained assignment\";\r\n const issue = issue_1.Issue.atStatement(file, s, message, this.getMetadata().key);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.NoChainedAssignment = NoChainedAssignment;\r\n//# sourceMappingURL=no_chained_assignment.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_chained_assignment.js?");
12306
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoChainedAssignment = exports.NoChainedAssignmentConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoChainedAssignmentConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NoChainedAssignmentConf = NoChainedAssignmentConf;\r\nclass NoChainedAssignment extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoChainedAssignmentConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_chained_assignment\",\r\n title: \"No chained assignment\",\r\n shortDescription: `Find chained assingments and reports issues`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],\r\n badExample: `var1 = var2 = var3.`,\r\n goodExample: `var2 = var3.\r\nvar1 = var2.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const s of file.getStatements()) {\r\n if (!(s.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n if (s.findDirectExpressions(Expressions.Target).length >= 2) {\r\n const message = \"No chained assignment\";\r\n const issue = issue_1.Issue.atStatement(file, s, message, this.getMetadata().key);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.NoChainedAssignment = NoChainedAssignment;\r\n//# sourceMappingURL=no_chained_assignment.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_chained_assignment.js?");
12307
12307
 
12308
12308
  /***/ }),
12309
12309
 
@@ -12314,7 +12314,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12314
12314
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12315
12315
 
12316
12316
  "use strict";
12317
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoExternalFormCalls = exports.NoExternalFormCallsConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoExternalFormCallsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NoExternalFormCallsConf = NoExternalFormCallsConf;\r\nclass NoExternalFormCalls extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoExternalFormCallsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_external_form_calls\",\r\n title: \"No external FORM calls\",\r\n shortDescription: `Detect external form calls`,\r\n badExample: `PERFORM foo IN PROGRAM bar.\n\nPERFORM foo(bar).`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues; // parser error\r\n }\r\n for (const p of stru.findAllStatements(Statements.Perform)) {\r\n if (p.findDirectExpression(Expressions.IncludeName) || p.findDirectTokenByText(\"PROGRAM\")) {\r\n const message = \"No external FORM calls\";\r\n issues.push(issue_1.Issue.atStatement(file, p, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.NoExternalFormCalls = NoExternalFormCalls;\r\n//# sourceMappingURL=no_external_form_calls.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_external_form_calls.js?");
12317
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoExternalFormCalls = exports.NoExternalFormCallsConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoExternalFormCallsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NoExternalFormCallsConf = NoExternalFormCallsConf;\r\nclass NoExternalFormCalls extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoExternalFormCallsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_external_form_calls\",\r\n title: \"No external FORM calls\",\r\n shortDescription: `Detect external form calls`,\r\n badExample: `PERFORM foo IN PROGRAM bar.\r\n\r\nPERFORM foo(bar).`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues; // parser error\r\n }\r\n for (const p of stru.findAllStatements(Statements.Perform)) {\r\n if (p.findDirectExpression(Expressions.IncludeName) || p.findDirectTokenByText(\"PROGRAM\")) {\r\n const message = \"No external FORM calls\";\r\n issues.push(issue_1.Issue.atStatement(file, p, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.NoExternalFormCalls = NoExternalFormCalls;\r\n//# sourceMappingURL=no_external_form_calls.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_external_form_calls.js?");
12318
12318
 
12319
12319
  /***/ }),
12320
12320
 
@@ -12325,7 +12325,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12325
12325
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12326
12326
 
12327
12327
  "use strict";
12328
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoInlineInOptionalBranches = exports.NoInlineInOptionalBranchesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass NoInlineInOptionalBranchesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NoInlineInOptionalBranchesConf = NoInlineInOptionalBranchesConf;\r\nclass NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoInlineInOptionalBranchesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_inline_in_optional_branches\",\r\n title: \"Don't declare inline in optional branches\",\r\n shortDescription: `Don't declare inline in optional branches`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches\n\nConsidered optional branches:\n* inside IF/ELSEIF/ELSE\n* inside LOOP\n* inside WHILE\n* inside CASE/WHEN, CASE TYPE OF\n* inside DO\n* inside SELECT loops\n\nNot considered optional branches:\n* TRY/CATCH/CLEANUP`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n const version = this.reg.getConfig().getVersion();\r\n if (version === version_1.Version.v700\r\n || version === version_1.Version.v702\r\n || version === version_1.Version.OpenABAP) {\r\n return [];\r\n }\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return []; // syntax error\r\n }\r\n const candidates = [\r\n ...struc.findAllStructures(Structures.If),\r\n ...struc.findAllStructures(Structures.Loop),\r\n ...struc.findAllStructures(Structures.While),\r\n ...struc.findAllStructures(Structures.Case),\r\n ...struc.findAllStructures(Structures.CaseType),\r\n ...struc.findAllStructures(Structures.Do),\r\n ...struc.findAllStructures(Structures.Select)\r\n ];\r\n for (const c of candidates) {\r\n const inline = c.findFirstExpression(Expressions.InlineData);\r\n if (inline) {\r\n const message = \"Don't declare inline in optional branches\";\r\n const issue = issue_1.Issue.atToken(file, inline.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.NoInlineInOptionalBranches = NoInlineInOptionalBranches;\r\n//# sourceMappingURL=no_inline_in_optional_branches.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_inline_in_optional_branches.js?");
12328
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoInlineInOptionalBranches = exports.NoInlineInOptionalBranchesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass NoInlineInOptionalBranchesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NoInlineInOptionalBranchesConf = NoInlineInOptionalBranchesConf;\r\nclass NoInlineInOptionalBranches extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoInlineInOptionalBranchesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_inline_in_optional_branches\",\r\n title: \"Don't declare inline in optional branches\",\r\n shortDescription: `Don't declare inline in optional branches`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-declare-inline-in-optional-branches\r\n\r\nConsidered optional branches:\r\n* inside IF/ELSEIF/ELSE\r\n* inside LOOP\r\n* inside WHILE\r\n* inside CASE/WHEN, CASE TYPE OF\r\n* inside DO\r\n* inside SELECT loops\r\n\r\nNot considered optional branches:\r\n* TRY/CATCH/CLEANUP`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n const version = this.reg.getConfig().getVersion();\r\n if (version === version_1.Version.v700\r\n || version === version_1.Version.v702\r\n || version === version_1.Version.OpenABAP) {\r\n return [];\r\n }\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return []; // syntax error\r\n }\r\n const candidates = [\r\n ...struc.findAllStructures(Structures.If),\r\n ...struc.findAllStructures(Structures.Loop),\r\n ...struc.findAllStructures(Structures.While),\r\n ...struc.findAllStructures(Structures.Case),\r\n ...struc.findAllStructures(Structures.CaseType),\r\n ...struc.findAllStructures(Structures.Do),\r\n ...struc.findAllStructures(Structures.Select)\r\n ];\r\n for (const c of candidates) {\r\n const inline = c.findFirstExpression(Expressions.InlineData);\r\n if (inline) {\r\n const message = \"Don't declare inline in optional branches\";\r\n const issue = issue_1.Issue.atToken(file, inline.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.NoInlineInOptionalBranches = NoInlineInOptionalBranches;\r\n//# sourceMappingURL=no_inline_in_optional_branches.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_inline_in_optional_branches.js?");
12329
12329
 
12330
12330
  /***/ }),
12331
12331
 
@@ -12336,7 +12336,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12336
12336
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12337
12337
 
12338
12338
  "use strict";
12339
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoPublicAttributes = exports.NoPublicAttributesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _abap_file_information_1 = __webpack_require__(/*! ../abap/4_file_information/_abap_file_information */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_abap_file_information.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoPublicAttributesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allows public attributes, if they are declared as READ-ONLY. */\r\n this.allowReadOnly = false;\r\n /** Option to ignore test classes for this check. */\r\n this.ignoreTestClasses = false;\r\n }\r\n}\r\nexports.NoPublicAttributesConf = NoPublicAttributesConf;\r\nclass NoPublicAttributes extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoPublicAttributesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_public_attributes\",\r\n title: \"No public attributes\",\r\n shortDescription: `Checks that classes and interfaces don't contain any public attributes.\nExceptions are excluded from this rule.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(name) {\r\n return \"Public attributes are not allowed, attribute \\\"\" + name + \"\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n this.file = file;\r\n const attributes = this.getAllPublicAttributes(obj);\r\n return this.findAllIssues(attributes);\r\n }\r\n getAllPublicAttributes(obj) {\r\n let attributes = [];\r\n attributes = attributes.concat(this.getAllPublicClassAttributes(obj));\r\n attributes = attributes.concat(this.getAllPublicInterfaceAttributes());\r\n return attributes;\r\n }\r\n getAllPublicClassAttributes(obj) {\r\n let attributes = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const classDef of this.file.getInfo().listClassDefinitions()) {\r\n if (ddic.isException(classDef, obj)) {\r\n continue;\r\n }\r\n attributes = attributes.concat(classDef.attributes.filter(a => a.visibility === visibility_1.Visibility.Public));\r\n }\r\n return attributes;\r\n }\r\n getAllPublicInterfaceAttributes() {\r\n let attributes = [];\r\n for (const interfaceDef of this.file.getInfo().listInterfaceDefinitions()) {\r\n attributes = attributes.concat(interfaceDef.attributes.filter(a => a.visibility === visibility_1.Visibility.Public));\r\n }\r\n return attributes;\r\n }\r\n findAllIssues(attributes) {\r\n const issues = [];\r\n for (const attr of attributes) {\r\n if (this.conf.allowReadOnly === true && attr.readOnly) {\r\n continue;\r\n }\r\n else if (attr.level === _abap_file_information_1.AttributeLevel.Constant) {\r\n continue;\r\n }\r\n else if ((this.conf.ignoreTestClasses === true)\r\n && this.file.getFilename().includes(\".testclasses.\")) {\r\n continue;\r\n }\r\n const issue = issue_1.Issue.atIdentifier(attr.identifier, this.getDescription(attr.name), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.NoPublicAttributes = NoPublicAttributes;\r\n//# sourceMappingURL=no_public_attributes.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_public_attributes.js?");
12339
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoPublicAttributes = exports.NoPublicAttributesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _abap_file_information_1 = __webpack_require__(/*! ../abap/4_file_information/_abap_file_information */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_abap_file_information.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoPublicAttributesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allows public attributes, if they are declared as READ-ONLY. */\r\n this.allowReadOnly = false;\r\n /** Option to ignore test classes for this check. */\r\n this.ignoreTestClasses = false;\r\n }\r\n}\r\nexports.NoPublicAttributesConf = NoPublicAttributesConf;\r\nclass NoPublicAttributes extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoPublicAttributesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_public_attributes\",\r\n title: \"No public attributes\",\r\n shortDescription: `Checks that classes and interfaces don't contain any public attributes.\r\nExceptions are excluded from this rule.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(name) {\r\n return \"Public attributes are not allowed, attribute \\\"\" + name + \"\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n this.file = file;\r\n const attributes = this.getAllPublicAttributes(obj);\r\n return this.findAllIssues(attributes);\r\n }\r\n getAllPublicAttributes(obj) {\r\n let attributes = [];\r\n attributes = attributes.concat(this.getAllPublicClassAttributes(obj));\r\n attributes = attributes.concat(this.getAllPublicInterfaceAttributes());\r\n return attributes;\r\n }\r\n getAllPublicClassAttributes(obj) {\r\n let attributes = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const classDef of this.file.getInfo().listClassDefinitions()) {\r\n if (ddic.isException(classDef, obj)) {\r\n continue;\r\n }\r\n attributes = attributes.concat(classDef.attributes.filter(a => a.visibility === visibility_1.Visibility.Public));\r\n }\r\n return attributes;\r\n }\r\n getAllPublicInterfaceAttributes() {\r\n let attributes = [];\r\n for (const interfaceDef of this.file.getInfo().listInterfaceDefinitions()) {\r\n attributes = attributes.concat(interfaceDef.attributes.filter(a => a.visibility === visibility_1.Visibility.Public));\r\n }\r\n return attributes;\r\n }\r\n findAllIssues(attributes) {\r\n const issues = [];\r\n for (const attr of attributes) {\r\n if (this.conf.allowReadOnly === true && attr.readOnly) {\r\n continue;\r\n }\r\n else if (attr.level === _abap_file_information_1.AttributeLevel.Constant) {\r\n continue;\r\n }\r\n else if ((this.conf.ignoreTestClasses === true)\r\n && this.file.getFilename().includes(\".testclasses.\")) {\r\n continue;\r\n }\r\n const issue = issue_1.Issue.atIdentifier(attr.identifier, this.getDescription(attr.name), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.NoPublicAttributes = NoPublicAttributes;\r\n//# sourceMappingURL=no_public_attributes.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_public_attributes.js?");
12340
12340
 
12341
12341
  /***/ }),
12342
12342
 
@@ -12347,7 +12347,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12347
12347
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12348
12348
 
12349
12349
  "use strict";
12350
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoYodaConditions = exports.NoYodaConditionsConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoYodaConditionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Only report issues where the left side is a constant */\r\n this.onlyConstants = false;\r\n }\r\n}\r\nexports.NoYodaConditionsConf = NoYodaConditionsConf;\r\nclass NoYodaConditions extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoYodaConditionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_yoda_conditions\",\r\n title: \"No Yoda conditions\",\r\n shortDescription: `Finds Yoda conditions and reports issues`,\r\n extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions\n\nConditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `IF 0 <> sy-subrc.\nENDIF.`,\r\n goodExample: `IF sy-subrc <> 0.\nENDIF.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b;\r\n const issues = [];\r\n for (const c of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Compare)) || []) {\r\n const operator = (_b = c.findDirectExpression(Expressions.CompareOperator)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\r\n if (operator === undefined\r\n || operator === \"CP\"\r\n || operator === \"NP\"\r\n || operator === \"CS\"\r\n || operator === \"NS\"\r\n || operator === \"CA\"\r\n || operator === \"NA\"\r\n || operator === \"CO\"\r\n || operator === \"CN\") {\r\n continue;\r\n }\r\n const sources = c.findDirectExpressions(Expressions.Source);\r\n if (sources.length !== 2) {\r\n continue;\r\n }\r\n if (this.conf.onlyConstants === true) {\r\n if (this.isConstant(sources[0]) === true && this.isConstant(sources[1]) === false) {\r\n const start = sources[0].getFirstToken().getStart();\r\n const end = sources[1].getLastToken().getEnd();\r\n const issue = issue_1.Issue.atRange(file, start, end, \"No Yoda conditions\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n continue;\r\n }\r\n // Scenarios:\r\n // constant COMPARE chain\r\n // constant COMPARE multiple tokens with spaces\r\n // fieldChain COMPARE multiple tokens with spaces\r\n if ((this.withoutSpaces(sources[0]) === false && this.withoutSpaces(sources[1]) === true) || ((this.isConstant(sources[0]) === true && this.isFieldChain(sources[1]) === true))) {\r\n const start = sources[0].getFirstToken().getStart();\r\n const end = sources[1].getLastToken().getEnd();\r\n const issue = issue_1.Issue.atRange(file, start, end, \"No Yoda conditions\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n isConstant(node) {\r\n var _a;\r\n if (node.getChildren().length > 1) {\r\n return false;\r\n }\r\n return ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Constant;\r\n }\r\n isFieldChain(node) {\r\n var _a;\r\n if (node.getChildren().length > 1) {\r\n return false;\r\n }\r\n return ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.FieldChain;\r\n }\r\n withoutSpaces(node) {\r\n return node.concatTokensWithoutStringsAndComments().includes(\" \");\r\n }\r\n}\r\nexports.NoYodaConditions = NoYodaConditions;\r\n//# sourceMappingURL=no_yoda_conditions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_yoda_conditions.js?");
12350
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoYodaConditions = exports.NoYodaConditionsConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoYodaConditionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Only report issues where the left side is a constant */\r\n this.onlyConstants = false;\r\n }\r\n}\r\nexports.NoYodaConditionsConf = NoYodaConditionsConf;\r\nclass NoYodaConditions extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoYodaConditionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_yoda_conditions\",\r\n title: \"No Yoda conditions\",\r\n shortDescription: `Finds Yoda conditions and reports issues`,\r\n extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions\r\n\r\nConditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `IF 0 <> sy-subrc.\r\nENDIF.`,\r\n goodExample: `IF sy-subrc <> 0.\r\nENDIF.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b;\r\n const issues = [];\r\n for (const c of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Compare)) || []) {\r\n const operator = (_b = c.findDirectExpression(Expressions.CompareOperator)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\r\n if (operator === undefined\r\n || operator === \"CP\"\r\n || operator === \"NP\"\r\n || operator === \"CS\"\r\n || operator === \"NS\"\r\n || operator === \"CA\"\r\n || operator === \"NA\"\r\n || operator === \"CO\"\r\n || operator === \"CN\") {\r\n continue;\r\n }\r\n const sources = c.findDirectExpressions(Expressions.Source);\r\n if (sources.length !== 2) {\r\n continue;\r\n }\r\n if (this.conf.onlyConstants === true) {\r\n if (this.isConstant(sources[0]) === true && this.isConstant(sources[1]) === false) {\r\n const start = sources[0].getFirstToken().getStart();\r\n const end = sources[1].getLastToken().getEnd();\r\n const issue = issue_1.Issue.atRange(file, start, end, \"No Yoda conditions\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n continue;\r\n }\r\n // Scenarios:\r\n // constant COMPARE chain\r\n // constant COMPARE multiple tokens with spaces\r\n // fieldChain COMPARE multiple tokens with spaces\r\n if ((this.withoutSpaces(sources[0]) === false && this.withoutSpaces(sources[1]) === true) || ((this.isConstant(sources[0]) === true && this.isFieldChain(sources[1]) === true))) {\r\n const start = sources[0].getFirstToken().getStart();\r\n const end = sources[1].getLastToken().getEnd();\r\n const issue = issue_1.Issue.atRange(file, start, end, \"No Yoda conditions\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n isConstant(node) {\r\n var _a;\r\n if (node.getChildren().length > 1) {\r\n return false;\r\n }\r\n return ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Constant;\r\n }\r\n isFieldChain(node) {\r\n var _a;\r\n if (node.getChildren().length > 1) {\r\n return false;\r\n }\r\n return ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.FieldChain;\r\n }\r\n withoutSpaces(node) {\r\n return node.concatTokensWithoutStringsAndComments().includes(\" \");\r\n }\r\n}\r\nexports.NoYodaConditions = NoYodaConditions;\r\n//# sourceMappingURL=no_yoda_conditions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_yoda_conditions.js?");
12351
12351
 
12352
12352
  /***/ }),
12353
12353
 
@@ -12358,7 +12358,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12358
12358
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12359
12359
 
12360
12360
  "use strict";
12361
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NROBConsistency = exports.NROBConsistencyConf = void 0;\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Objects = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nclass NROBConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NROBConsistencyConf = NROBConsistencyConf;\r\nclass NROBConsistency {\r\n constructor() {\r\n this.conf = new NROBConsistencyConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"nrob_consistency\",\r\n title: \"Number range consistency\",\r\n shortDescription: `Consistency checks for number ranges`,\r\n extendedInformation: `Issue reported if percentage warning is over 50%\n\nIssue reported if the referenced domain is not found(taking error namespace into account)`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof Objects.NumberRange)) {\r\n return [];\r\n }\r\n const issues = [];\r\n const id = obj.getIdentifier();\r\n if (id === undefined) {\r\n return [];\r\n }\r\n if (obj.getPercentage() || 0 > 50) {\r\n const message = \"Percentage more than 50\";\r\n issues.push(issue_1.Issue.atIdentifier(id, message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n const domain = obj.getDomain();\r\n if (domain\r\n && this.reg.getObject(\"DOMA\", domain) === undefined\r\n && this.reg.inErrorNamespace(domain) === true) {\r\n const message = \"Domain \" + domain + \" not found\";\r\n issues.push(issue_1.Issue.atIdentifier(id, message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n return [];\r\n }\r\n}\r\nexports.NROBConsistency = NROBConsistency;\r\n//# sourceMappingURL=nrob_consistency.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/nrob_consistency.js?");
12361
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NROBConsistency = exports.NROBConsistencyConf = void 0;\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Objects = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nclass NROBConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NROBConsistencyConf = NROBConsistencyConf;\r\nclass NROBConsistency {\r\n constructor() {\r\n this.conf = new NROBConsistencyConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"nrob_consistency\",\r\n title: \"Number range consistency\",\r\n shortDescription: `Consistency checks for number ranges`,\r\n extendedInformation: `Issue reported if percentage warning is over 50%\r\n\r\nIssue reported if the referenced domain is not found(taking error namespace into account)`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof Objects.NumberRange)) {\r\n return [];\r\n }\r\n const issues = [];\r\n const id = obj.getIdentifier();\r\n if (id === undefined) {\r\n return [];\r\n }\r\n if (obj.getPercentage() || 0 > 50) {\r\n const message = \"Percentage more than 50\";\r\n issues.push(issue_1.Issue.atIdentifier(id, message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n const domain = obj.getDomain();\r\n if (domain\r\n && this.reg.getObject(\"DOMA\", domain) === undefined\r\n && this.reg.inErrorNamespace(domain) === true) {\r\n const message = \"Domain \" + domain + \" not found\";\r\n issues.push(issue_1.Issue.atIdentifier(id, message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n return [];\r\n }\r\n}\r\nexports.NROBConsistency = NROBConsistency;\r\n//# sourceMappingURL=nrob_consistency.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/nrob_consistency.js?");
12362
12362
 
12363
12363
  /***/ }),
12364
12364
 
@@ -12380,7 +12380,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12380
12380
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12381
12381
 
12382
12382
  "use strict";
12383
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ObsoleteStatement = exports.ObsoleteStatementConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ObsoleteStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Check for REFRESH statement */\r\n this.refresh = true;\r\n /** Check for COMPUTE statement */\r\n this.compute = true;\r\n /** Check for ADD statement */\r\n this.add = true;\r\n /** Check for SUBTRACT statement */\r\n this.subtract = true;\r\n /** Check for MULTIPLY statement */\r\n this.multiply = true;\r\n /** Check for DIVIDE statement */\r\n this.divide = true;\r\n /** Check for MOVE statement */\r\n this.move = true;\r\n /** Checks for usages of IS REQUESTED */\r\n this.requested = true;\r\n /** Checks for usages of OCCURS */\r\n this.occurs = true;\r\n /** Checks for SET EXTENDED CHECK */\r\n this.setExtended = true;\r\n /** Checks for WITH HEADER LINE */\r\n this.withHeaderLine = true;\r\n /** Checks for FIELD-SYMBOLS ... STRUCTURE */\r\n this.fieldSymbolStructure = true;\r\n /** Checks for TYPE-POOLS */\r\n this.typePools = true;\r\n /** Checks for addition LOAD */\r\n this.load = true;\r\n /** Checks for PARAMETER */\r\n this.parameter = true;\r\n /** Checks for RANGES */\r\n this.ranges = true;\r\n /** Checks for COMMUNICATION */\r\n this.communication = true;\r\n /** Checks for PACK */\r\n this.pack = true;\r\n /** Checks for SELECT without INTO */\r\n this.selectWithoutInto = true;\r\n /** FREE MEMORY, without ID */\r\n this.freeMemory = true;\r\n /** Checks for EXIT FROM SQL */\r\n this.exitFromSQL = true;\r\n /** Checks for SORT itab BY <fs> */\r\n this.sortByFS = true;\r\n /** Checks for CALL TRANSFORMATION OBJECTS */\r\n this.callTransformation = true;\r\n /** Check for POSIX REGEX usage */\r\n this.regex = true;\r\n /** Check for OCCURENCES vs OCCURRENCES usage */\r\n this.occurences = true;\r\n /** Check for CLIENT SPECIFIED */\r\n this.clientSpecified = true;\r\n }\r\n}\r\nexports.ObsoleteStatementConf = ObsoleteStatementConf;\r\nclass ObsoleteStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ObsoleteStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"obsolete_statement\",\r\n title: \"Obsolete statements\",\r\n shortDescription: `Checks for usages of certain obsolete statements`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n extendedInformation: `\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements\n\nSET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm\n\nIS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm\n\nWITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm\n\nFIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm\n\nTYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\n\nLOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\n\nCOMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm\n\nOCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm\n\nPARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm\n\nRANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm\n\nPACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm\n\nMOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm\n\nSELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm\nSELECT COUNT(*) is considered okay\n\nFREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm\n\nSORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm\n\nCALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm\n\nPOSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm\n\nOCCURENCES: check for OCCURENCES vs OCCURRENCES\n\nCLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b, _c;\r\n const issues = [];\r\n const statements = file.getStatements();\r\n let prev = undefined;\r\n const configVersion = this.reg.getConfig().getVersion();\r\n for (const staNode of statements) {\r\n const sta = staNode.get();\r\n if ((sta instanceof Statements.Refresh && this.conf.refresh)\r\n || (sta instanceof Statements.Compute && this.conf.compute)\r\n || (sta instanceof Statements.Add && this.conf.add)\r\n || (sta instanceof Statements.Subtract && this.conf.subtract)\r\n || (sta instanceof Statements.ClassDefinitionLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.InterfaceLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.Multiply && this.conf.multiply)\r\n || (sta instanceof Statements.Divide && this.conf.divide)\r\n || (sta instanceof Statements.Move && this.conf.move\r\n && staNode.getTokens()[0].getStr().toUpperCase() === \"MOVE\"\r\n && staNode.getTokens()[1].getStr() !== \"-\"\r\n && staNode.getTokens()[1].getStr().toUpperCase() !== \"EXACT\")) {\r\n if (prev === undefined || staNode.getStart().getCol() !== prev.getCol() || staNode.getStart().getRow() !== prev.getRow()) {\r\n const message = \"Statement \\\"\" + staNode.getFirstToken().getStr() + \"\\\" is obsolete\";\r\n const fix = this.getFix(file, sta, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = staNode.getStart();\r\n }\r\n if (this.conf.setExtended && sta instanceof Statements.SetExtendedCheck) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SET EXTENDED CHECK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.communication && sta instanceof Statements.Communication) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"COMMUNICATION is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.pack && sta instanceof Statements.Pack) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"PACK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.parameter && sta instanceof Statements.Parameter) {\r\n const token = staNode.getFirstToken();\r\n if (token.getStr().toUpperCase() === \"PARAMETER\") {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"PARAMETERS\");\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of PARAMETER\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.ranges && sta instanceof Statements.Ranges) {\r\n const children = staNode.getChildren();\r\n let fix = undefined;\r\n if (children.length === 5) {\r\n const simpleNameString = children[1].concatTokens();\r\n const fieldSubString = children[3].concatTokens();\r\n const replacement = \"TYPES \" + simpleNameString + \" LIKE RANGE OF \" + fieldSubString + \".\";\r\n fix = edit_helper_1.EditHelper.replaceRange(file, staNode.getStart(), staNode.getEnd(), replacement);\r\n }\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use LIKE RANGE OF instead of RANGES\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.selectWithoutInto\r\n && (sta instanceof Statements.Select || sta instanceof Statements.SelectLoop)\r\n && staNode.findFirstExpression(Expressions.SQLIntoStructure) === undefined\r\n && staNode.findFirstExpression(Expressions.SQLIntoTable) === undefined) {\r\n const concat = (_a = staNode.findFirstExpression(Expressions.SQLFieldList)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (concat !== \"COUNT(*)\" && concat !== \"COUNT( * )\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SELECT without INTO\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.requested && sta instanceof Statements.If) {\r\n for (const compare of staNode.findAllExpressions(Expressions.Compare)) {\r\n const token = compare.findDirectTokenByText(\"REQUESTED\");\r\n if (token) {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"SUPPLIED\");\r\n const issue = issue_1.Issue.atToken(file, token, \"IS REQUESTED is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.occurs) {\r\n if ((sta instanceof Statements.Describe)\r\n || (sta instanceof Statements.Ranges)\r\n || (sta instanceof Statements.DataBegin)\r\n || (sta instanceof Statements.TypeBegin)) {\r\n const token = staNode.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const dataDef of staNode.findAllExpressions(Expressions.DataDefinition)) {\r\n const token = (_b = dataDef.findDirectExpression(Expressions.TypeTable)) === null || _b === void 0 ? void 0 : _b.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.withHeaderLine === true && sta instanceof Statements.Data) {\r\n if (staNode.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\")) {\r\n const token = staNode.getTokens().find(t => t.getStr().toUpperCase() === \"WITH\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"WITH HEADER LINE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.fieldSymbolStructure && sta instanceof Statements.FieldSymbol) {\r\n const token = staNode.findDirectTokenByText(\"STRUCTURE\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"FIELD-SYMBOLS ... STRUCTURE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.typePools && sta instanceof Statements.TypePools && configVersion >= version_1.Version.v702) {\r\n const fix = edit_helper_1.EditHelper.deleteStatement(file, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"TYPE-POOLS\\\" is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.freeMemory && sta instanceof Statements.FreeMemory) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"FREE MEMORY.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"FREE MEMORY\\\" without ID is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.exitFromSQL && sta instanceof Statements.Exit) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"EXIT FROM SQL.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"EXIT FROM SQL\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.sortByFS && sta instanceof Statements.Sort) {\r\n const afterBy = staNode.findExpressionAfterToken(\"BY\");\r\n if (afterBy instanceof nodes_1.ExpressionNode && afterBy.get() instanceof expressions_1.SourceFieldSymbol) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"SORT itab BY <fs>\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.callTransformation && sta instanceof Statements.CallTransformation) {\r\n const objects = staNode.findExpressionAfterToken(\"OBJECTS\");\r\n if (objects) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of OBJECTS\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.occurences && sta instanceof Statements.Replace) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat.includes(\" OCCURENCES \")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use \\\"OCCURRENCES\\\"\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (configVersion >= version_1.Version.v754 && this.conf.clientSpecified\r\n && (sta instanceof Statements.Select\r\n || sta instanceof Statements.SelectLoop\r\n || sta instanceof Statements.DeleteDatabase\r\n || sta instanceof Statements.InsertDatabase\r\n || sta instanceof Statements.ModifyDatabase\r\n || sta instanceof Statements.UpdateDatabase)) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat.includes(\" CLIENT SPECIFIED\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use USING CLIENT\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (configVersion >= version_1.Version.v756 && this.conf.regex) {\r\n if (sta instanceof Statements.Find || sta instanceof Statements.Replace) {\r\n if ((_c = staNode.findFirstExpression(Expressions.FindType)) === null || _c === void 0 ? void 0 : _c.concatTokens().includes(\"REGEX\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"REGEX obsolete, use PCRE\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else {\r\n const classNameExpression = staNode.findAllExpressions(Expressions.ClassName);\r\n const methodNameExpression = staNode.findAllExpressions(Expressions.MethodName);\r\n if (classNameExpression.length !== 0 && methodNameExpression.length !== 0) {\r\n const className = classNameExpression[0].concatTokens();\r\n const methodName = methodNameExpression[0].concatTokens();\r\n if (className === \"cl_abap_regex\") {\r\n if (methodName === \"create_posix\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"create_posix obsolete, use create_pcre\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else if (className === \"cl_abap_matcher\") {\r\n if (methodName.includes(\"posix\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"posix methods obsolete, use pcre methods\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, statementNode) {\r\n if (statement instanceof Statements.Refresh) {\r\n if (statementNode.getChildren().length === 6) {\r\n return undefined;\r\n }\r\n return edit_helper_1.EditHelper.replaceToken(file, statementNode.getFirstToken(), \"CLEAR\");\r\n }\r\n else if (statement instanceof Statements.Compute) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 5) {\r\n const tokenForDeletion = statementNode.getFirstToken();\r\n let endPosition = tokenForDeletion.getEnd();\r\n endPosition = new position_1.Position(endPosition.getRow(), endPosition.getCol() + 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, tokenForDeletion.getStart(), endPosition);\r\n }\r\n else {\r\n const targetString = children[2].concatTokens();\r\n const sourceString = children[4].concatTokens();\r\n const replacement = targetString + \" = EXACT #( \" + sourceString + \" ).\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n }\r\n else if (statement instanceof Statements.Add ||\r\n statement instanceof Statements.Subtract) {\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Add) {\r\n replacement = targetString + \" = \" + targetString + \" + \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Subtract) {\r\n replacement = targetString + \" = \" + targetString + \" - \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Multiply ||\r\n statement instanceof Statements.Divide) {\r\n const children = statementNode.getChildren();\r\n const targetString = children[1].concatTokens();\r\n const sourceString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Multiply) {\r\n replacement = targetString + \" = \" + targetString + \" * \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Divide) {\r\n replacement = targetString + \" = \" + targetString + \" / \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Move) {\r\n if (statementNode.getColon() !== undefined) {\r\n return undefined;\r\n }\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let operator = children[2].concatTokens();\r\n if (operator === \"TO\") {\r\n operator = \" = \";\r\n }\r\n else {\r\n operator = \" ?= \";\r\n }\r\n const replacement = targetString + operator + sourceString + \".\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.ClassDefinitionLoad ||\r\n statement instanceof Statements.InterfaceLoad) {\r\n let token = undefined;\r\n if (statement instanceof Statements.ClassDefinitionLoad) {\r\n token = statementNode.getChildren()[3].getFirstToken();\r\n }\r\n else {\r\n token = statementNode.getChildren()[2].getFirstToken();\r\n }\r\n let startPosition = token.getStart();\r\n startPosition = new position_1.Position(startPosition.getRow(), startPosition.getCol() - 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, startPosition, token.getEnd());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.ObsoleteStatement = ObsoleteStatement;\r\n//# sourceMappingURL=obsolete_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/obsolete_statement.js?");
12383
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ObsoleteStatement = exports.ObsoleteStatementConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ObsoleteStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Check for REFRESH statement */\r\n this.refresh = true;\r\n /** Check for COMPUTE statement */\r\n this.compute = true;\r\n /** Check for ADD statement */\r\n this.add = true;\r\n /** Check for SUBTRACT statement */\r\n this.subtract = true;\r\n /** Check for MULTIPLY statement */\r\n this.multiply = true;\r\n /** Check for DIVIDE statement */\r\n this.divide = true;\r\n /** Check for MOVE statement */\r\n this.move = true;\r\n /** Checks for usages of IS REQUESTED */\r\n this.requested = true;\r\n /** Checks for usages of OCCURS */\r\n this.occurs = true;\r\n /** Checks for SET EXTENDED CHECK */\r\n this.setExtended = true;\r\n /** Checks for WITH HEADER LINE */\r\n this.withHeaderLine = true;\r\n /** Checks for FIELD-SYMBOLS ... STRUCTURE */\r\n this.fieldSymbolStructure = true;\r\n /** Checks for TYPE-POOLS */\r\n this.typePools = true;\r\n /** Checks for addition LOAD */\r\n this.load = true;\r\n /** Checks for PARAMETER */\r\n this.parameter = true;\r\n /** Checks for RANGES */\r\n this.ranges = true;\r\n /** Checks for COMMUNICATION */\r\n this.communication = true;\r\n /** Checks for PACK */\r\n this.pack = true;\r\n /** Checks for SELECT without INTO */\r\n this.selectWithoutInto = true;\r\n /** FREE MEMORY, without ID */\r\n this.freeMemory = true;\r\n /** Checks for EXIT FROM SQL */\r\n this.exitFromSQL = true;\r\n /** Checks for SORT itab BY <fs> */\r\n this.sortByFS = true;\r\n /** Checks for CALL TRANSFORMATION OBJECTS */\r\n this.callTransformation = true;\r\n /** Check for POSIX REGEX usage */\r\n this.regex = true;\r\n /** Check for OCCURENCES vs OCCURRENCES usage */\r\n this.occurences = true;\r\n /** Check for CLIENT SPECIFIED */\r\n this.clientSpecified = true;\r\n }\r\n}\r\nexports.ObsoleteStatementConf = ObsoleteStatementConf;\r\nclass ObsoleteStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ObsoleteStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"obsolete_statement\",\r\n title: \"Obsolete statements\",\r\n shortDescription: `Checks for usages of certain obsolete statements`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements\r\n\r\nSET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm\r\n\r\nIS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm\r\n\r\nWITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm\r\n\r\nFIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm\r\n\r\nTYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\r\n\r\nLOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\r\n\r\nCOMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm\r\n\r\nOCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm\r\n\r\nPARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm\r\n\r\nRANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm\r\n\r\nPACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm\r\n\r\nMOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm\r\n\r\nSELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm\r\nSELECT COUNT(*) is considered okay\r\n\r\nFREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm\r\n\r\nSORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm\r\n\r\nCALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm\r\n\r\nPOSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm\r\n\r\nOCCURENCES: check for OCCURENCES vs OCCURRENCES\r\n\r\nCLIENT SPECIFIED, from 754: https://help.sap.com/doc/abapdocu_latest_index_htm/latest/en-US/index.htm?file=abapselect_client_obsolete.htm`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b, _c;\r\n const issues = [];\r\n const statements = file.getStatements();\r\n let prev = undefined;\r\n const configVersion = this.reg.getConfig().getVersion();\r\n for (const staNode of statements) {\r\n const sta = staNode.get();\r\n if ((sta instanceof Statements.Refresh && this.conf.refresh)\r\n || (sta instanceof Statements.Compute && this.conf.compute)\r\n || (sta instanceof Statements.Add && this.conf.add)\r\n || (sta instanceof Statements.Subtract && this.conf.subtract)\r\n || (sta instanceof Statements.ClassDefinitionLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.InterfaceLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.Multiply && this.conf.multiply)\r\n || (sta instanceof Statements.Divide && this.conf.divide)\r\n || (sta instanceof Statements.Move && this.conf.move\r\n && staNode.getTokens()[0].getStr().toUpperCase() === \"MOVE\"\r\n && staNode.getTokens()[1].getStr() !== \"-\"\r\n && staNode.getTokens()[1].getStr().toUpperCase() !== \"EXACT\")) {\r\n if (prev === undefined || staNode.getStart().getCol() !== prev.getCol() || staNode.getStart().getRow() !== prev.getRow()) {\r\n const message = \"Statement \\\"\" + staNode.getFirstToken().getStr() + \"\\\" is obsolete\";\r\n const fix = this.getFix(file, sta, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = staNode.getStart();\r\n }\r\n if (this.conf.setExtended && sta instanceof Statements.SetExtendedCheck) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SET EXTENDED CHECK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.communication && sta instanceof Statements.Communication) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"COMMUNICATION is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.pack && sta instanceof Statements.Pack) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"PACK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.parameter && sta instanceof Statements.Parameter) {\r\n const token = staNode.getFirstToken();\r\n if (token.getStr().toUpperCase() === \"PARAMETER\") {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"PARAMETERS\");\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of PARAMETER\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.ranges && sta instanceof Statements.Ranges) {\r\n const children = staNode.getChildren();\r\n let fix = undefined;\r\n if (children.length === 5) {\r\n const simpleNameString = children[1].concatTokens();\r\n const fieldSubString = children[3].concatTokens();\r\n const replacement = \"TYPES \" + simpleNameString + \" LIKE RANGE OF \" + fieldSubString + \".\";\r\n fix = edit_helper_1.EditHelper.replaceRange(file, staNode.getStart(), staNode.getEnd(), replacement);\r\n }\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use LIKE RANGE OF instead of RANGES\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.selectWithoutInto\r\n && (sta instanceof Statements.Select || sta instanceof Statements.SelectLoop)\r\n && staNode.findFirstExpression(Expressions.SQLIntoStructure) === undefined\r\n && staNode.findFirstExpression(Expressions.SQLIntoTable) === undefined) {\r\n const concat = (_a = staNode.findFirstExpression(Expressions.SQLFieldList)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (concat !== \"COUNT(*)\" && concat !== \"COUNT( * )\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SELECT without INTO\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.requested && sta instanceof Statements.If) {\r\n for (const compare of staNode.findAllExpressions(Expressions.Compare)) {\r\n const token = compare.findDirectTokenByText(\"REQUESTED\");\r\n if (token) {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"SUPPLIED\");\r\n const issue = issue_1.Issue.atToken(file, token, \"IS REQUESTED is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.occurs) {\r\n if ((sta instanceof Statements.Describe)\r\n || (sta instanceof Statements.Ranges)\r\n || (sta instanceof Statements.DataBegin)\r\n || (sta instanceof Statements.TypeBegin)) {\r\n const token = staNode.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const dataDef of staNode.findAllExpressions(Expressions.DataDefinition)) {\r\n const token = (_b = dataDef.findDirectExpression(Expressions.TypeTable)) === null || _b === void 0 ? void 0 : _b.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.withHeaderLine === true && sta instanceof Statements.Data) {\r\n if (staNode.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\")) {\r\n const token = staNode.getTokens().find(t => t.getStr().toUpperCase() === \"WITH\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"WITH HEADER LINE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.fieldSymbolStructure && sta instanceof Statements.FieldSymbol) {\r\n const token = staNode.findDirectTokenByText(\"STRUCTURE\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"FIELD-SYMBOLS ... STRUCTURE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.typePools && sta instanceof Statements.TypePools && configVersion >= version_1.Version.v702) {\r\n const fix = edit_helper_1.EditHelper.deleteStatement(file, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"TYPE-POOLS\\\" is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.freeMemory && sta instanceof Statements.FreeMemory) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"FREE MEMORY.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"FREE MEMORY\\\" without ID is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.exitFromSQL && sta instanceof Statements.Exit) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"EXIT FROM SQL.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"EXIT FROM SQL\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.sortByFS && sta instanceof Statements.Sort) {\r\n const afterBy = staNode.findExpressionAfterToken(\"BY\");\r\n if (afterBy instanceof nodes_1.ExpressionNode && afterBy.get() instanceof expressions_1.SourceFieldSymbol) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"SORT itab BY <fs>\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.callTransformation && sta instanceof Statements.CallTransformation) {\r\n const objects = staNode.findExpressionAfterToken(\"OBJECTS\");\r\n if (objects) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of OBJECTS\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.occurences && sta instanceof Statements.Replace) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat.includes(\" OCCURENCES \")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use \\\"OCCURRENCES\\\"\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (configVersion >= version_1.Version.v754 && this.conf.clientSpecified\r\n && (sta instanceof Statements.Select\r\n || sta instanceof Statements.SelectLoop\r\n || sta instanceof Statements.DeleteDatabase\r\n || sta instanceof Statements.InsertDatabase\r\n || sta instanceof Statements.ModifyDatabase\r\n || sta instanceof Statements.UpdateDatabase)) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat.includes(\" CLIENT SPECIFIED\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use USING CLIENT\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (configVersion >= version_1.Version.v756 && this.conf.regex) {\r\n if (sta instanceof Statements.Find || sta instanceof Statements.Replace) {\r\n if ((_c = staNode.findFirstExpression(Expressions.FindType)) === null || _c === void 0 ? void 0 : _c.concatTokens().includes(\"REGEX\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"REGEX obsolete, use PCRE\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else {\r\n const classNameExpression = staNode.findAllExpressions(Expressions.ClassName);\r\n const methodNameExpression = staNode.findAllExpressions(Expressions.MethodName);\r\n if (classNameExpression.length !== 0 && methodNameExpression.length !== 0) {\r\n const className = classNameExpression[0].concatTokens();\r\n const methodName = methodNameExpression[0].concatTokens();\r\n if (className === \"cl_abap_regex\") {\r\n if (methodName === \"create_posix\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"create_posix obsolete, use create_pcre\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else if (className === \"cl_abap_matcher\") {\r\n if (methodName.includes(\"posix\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"posix methods obsolete, use pcre methods\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, statementNode) {\r\n if (statement instanceof Statements.Refresh) {\r\n if (statementNode.getChildren().length === 6) {\r\n return undefined;\r\n }\r\n return edit_helper_1.EditHelper.replaceToken(file, statementNode.getFirstToken(), \"CLEAR\");\r\n }\r\n else if (statement instanceof Statements.Compute) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 5) {\r\n const tokenForDeletion = statementNode.getFirstToken();\r\n let endPosition = tokenForDeletion.getEnd();\r\n endPosition = new position_1.Position(endPosition.getRow(), endPosition.getCol() + 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, tokenForDeletion.getStart(), endPosition);\r\n }\r\n else {\r\n const targetString = children[2].concatTokens();\r\n const sourceString = children[4].concatTokens();\r\n const replacement = targetString + \" = EXACT #( \" + sourceString + \" ).\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n }\r\n else if (statement instanceof Statements.Add ||\r\n statement instanceof Statements.Subtract) {\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Add) {\r\n replacement = targetString + \" = \" + targetString + \" + \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Subtract) {\r\n replacement = targetString + \" = \" + targetString + \" - \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Multiply ||\r\n statement instanceof Statements.Divide) {\r\n const children = statementNode.getChildren();\r\n const targetString = children[1].concatTokens();\r\n const sourceString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Multiply) {\r\n replacement = targetString + \" = \" + targetString + \" * \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Divide) {\r\n replacement = targetString + \" = \" + targetString + \" / \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Move) {\r\n if (statementNode.getColon() !== undefined) {\r\n return undefined;\r\n }\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let operator = children[2].concatTokens();\r\n if (operator === \"TO\") {\r\n operator = \" = \";\r\n }\r\n else {\r\n operator = \" ?= \";\r\n }\r\n const replacement = targetString + operator + sourceString + \".\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.ClassDefinitionLoad ||\r\n statement instanceof Statements.InterfaceLoad) {\r\n let token = undefined;\r\n if (statement instanceof Statements.ClassDefinitionLoad) {\r\n token = statementNode.getChildren()[3].getFirstToken();\r\n }\r\n else {\r\n token = statementNode.getChildren()[2].getFirstToken();\r\n }\r\n let startPosition = token.getStart();\r\n startPosition = new position_1.Position(startPosition.getRow(), startPosition.getCol() - 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, startPosition, token.getEnd());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.ObsoleteStatement = ObsoleteStatement;\r\n//# sourceMappingURL=obsolete_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/obsolete_statement.js?");
12384
12384
 
12385
12385
  /***/ }),
12386
12386
 
@@ -12391,7 +12391,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12391
12391
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12392
12392
 
12393
12393
  "use strict";
12394
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OmitParameterName = exports.OmitParameterNameConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst method_definition_1 = __webpack_require__(/*! ../abap/types/method_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/method_definition.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass OmitParameterNameConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.OmitParameterNameConf = OmitParameterNameConf;\r\nclass OmitParameterName {\r\n constructor() {\r\n this.conf = new OmitParameterNameConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"omit_parameter_name\",\r\n title: \"Omit parameter name\",\r\n shortDescription: `Omit the parameter name in single parameter calls`,\r\n extendedInformation: `\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls\n\nEXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n badExample: `method( param = 2 ).`,\r\n goodExample: `method( 2 ).`,\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n var _a, _b;\r\n const issues = [];\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n continue;\r\n }\r\n for (const c of stru.findAllExpressions(Expressions.MethodCall)) {\r\n if (c.findFirstExpression(Expressions.MethodParameters)) {\r\n continue;\r\n }\r\n // hmm, this will break for nested method calls?\r\n const parameters = c.findAllExpressions(Expressions.ParameterS);\r\n if (parameters.length > 1 || parameters.length === 0) {\r\n continue;\r\n }\r\n const name = c.findDirectExpression(Expressions.MethodName);\r\n if (name === undefined) {\r\n continue;\r\n }\r\n const param = c.findDirectExpression(Expressions.MethodCallParam);\r\n if (param === undefined) {\r\n continue;\r\n }\r\n const ref = this.findMethodReference(name.getFirstToken(), spaghetti, file.getFilename());\r\n if (ref === undefined) {\r\n continue;\r\n }\r\n const i = ref.getParameters().getDefaultImporting();\r\n if (i === undefined) {\r\n continue;\r\n }\r\n const p = (_a = parameters[0].findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if ((p === null || p === void 0 ? void 0 : p.getStr().toUpperCase()) === i.toUpperCase()) {\r\n const message = \"Omit default parameter name \\\"\" + i + \"\\\"\";\r\n const end = (_b = parameters[0].findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStart();\r\n if (end) {\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, p.getStart(), end);\r\n issues.push(issue_1.Issue.atRange(file, p.getStart(), end, message, this.getMetadata().key, this.getConfig().severity, fix));\r\n }\r\n else {\r\n issues.push(issue_1.Issue.atToken(file, name.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////\r\n findMethodReference(token, spaghetti, filename) {\r\n const scope = spaghetti.lookupPosition(token.getStart(), filename);\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.MethodReference) {\r\n continue;\r\n }\r\n else if (r.position.getStart().equals(token.getStart())\r\n && r.resolved instanceof method_definition_1.MethodDefinition) {\r\n return r.resolved;\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.OmitParameterName = OmitParameterName;\r\n//# sourceMappingURL=omit_parameter_name.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/omit_parameter_name.js?");
12394
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OmitParameterName = exports.OmitParameterNameConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst method_definition_1 = __webpack_require__(/*! ../abap/types/method_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/method_definition.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass OmitParameterNameConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.OmitParameterNameConf = OmitParameterNameConf;\r\nclass OmitParameterName {\r\n constructor() {\r\n this.conf = new OmitParameterNameConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"omit_parameter_name\",\r\n title: \"Omit parameter name\",\r\n shortDescription: `Omit the parameter name in single parameter calls`,\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls\r\n\r\nEXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n badExample: `method( param = 2 ).`,\r\n goodExample: `method( 2 ).`,\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n var _a, _b;\r\n const issues = [];\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n continue;\r\n }\r\n for (const c of stru.findAllExpressions(Expressions.MethodCall)) {\r\n if (c.findFirstExpression(Expressions.MethodParameters)) {\r\n continue;\r\n }\r\n // hmm, this will break for nested method calls?\r\n const parameters = c.findAllExpressions(Expressions.ParameterS);\r\n if (parameters.length > 1 || parameters.length === 0) {\r\n continue;\r\n }\r\n const name = c.findDirectExpression(Expressions.MethodName);\r\n if (name === undefined) {\r\n continue;\r\n }\r\n const param = c.findDirectExpression(Expressions.MethodCallParam);\r\n if (param === undefined) {\r\n continue;\r\n }\r\n const ref = this.findMethodReference(name.getFirstToken(), spaghetti, file.getFilename());\r\n if (ref === undefined) {\r\n continue;\r\n }\r\n const i = ref.getParameters().getDefaultImporting();\r\n if (i === undefined) {\r\n continue;\r\n }\r\n const p = (_a = parameters[0].findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if ((p === null || p === void 0 ? void 0 : p.getStr().toUpperCase()) === i.toUpperCase()) {\r\n const message = \"Omit default parameter name \\\"\" + i + \"\\\"\";\r\n const end = (_b = parameters[0].findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStart();\r\n if (end) {\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, p.getStart(), end);\r\n issues.push(issue_1.Issue.atRange(file, p.getStart(), end, message, this.getMetadata().key, this.getConfig().severity, fix));\r\n }\r\n else {\r\n issues.push(issue_1.Issue.atToken(file, name.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////\r\n findMethodReference(token, spaghetti, filename) {\r\n const scope = spaghetti.lookupPosition(token.getStart(), filename);\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.MethodReference) {\r\n continue;\r\n }\r\n else if (r.position.getStart().equals(token.getStart())\r\n && r.resolved instanceof method_definition_1.MethodDefinition) {\r\n return r.resolved;\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.OmitParameterName = OmitParameterName;\r\n//# sourceMappingURL=omit_parameter_name.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/omit_parameter_name.js?");
12395
12395
 
12396
12396
  /***/ }),
12397
12397
 
@@ -12413,7 +12413,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12413
12413
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12414
12414
 
12415
12415
  "use strict";
12416
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OmitReceiving = exports.OmitReceivingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nclass OmitReceivingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.OmitReceivingConf = OmitReceivingConf;\r\nclass OmitReceiving extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new OmitReceivingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"omit_receiving\",\r\n title: \"Omit RECEIVING\",\r\n shortDescription: `Omit RECEIVING`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `\n upload_pack(\n EXPORTING\n io_client = lo_client\n iv_url = iv_url\n iv_deepen_level = iv_deepen_level\n it_hashes = lt_hashes\n RECEIVING\n rt_objects = et_objects ).`,\r\n goodExample: `\n et_objects = upload_pack(\n io_client = lo_client\n iv_url = iv_url\n iv_deepen_level = iv_deepen_level\n it_hashes = lt_hashes ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n for (const e of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.MethodCallParam)) || []) {\r\n const p = e.findDirectExpression(Expressions.MethodParameters);\r\n if (p === undefined) {\r\n continue;\r\n }\r\n const r = p.findDirectTokenByText(\"RECEIVING\");\r\n if (r === undefined) {\r\n continue;\r\n }\r\n const ex = p.findDirectTokenByText(\"EXCEPTIONS\");\r\n if (ex !== undefined) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atToken(file, r, \"Omit RECEIVING\", this.getMetadata().key, this.getConfig().severity));\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.OmitReceiving = OmitReceiving;\r\n//# sourceMappingURL=omit_receiving.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/omit_receiving.js?");
12416
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OmitReceiving = exports.OmitReceivingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nclass OmitReceivingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.OmitReceivingConf = OmitReceivingConf;\r\nclass OmitReceiving extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new OmitReceivingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"omit_receiving\",\r\n title: \"Omit RECEIVING\",\r\n shortDescription: `Omit RECEIVING`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `\r\n upload_pack(\r\n EXPORTING\r\n io_client = lo_client\r\n iv_url = iv_url\r\n iv_deepen_level = iv_deepen_level\r\n it_hashes = lt_hashes\r\n RECEIVING\r\n rt_objects = et_objects ).`,\r\n goodExample: `\r\n et_objects = upload_pack(\r\n io_client = lo_client\r\n iv_url = iv_url\r\n iv_deepen_level = iv_deepen_level\r\n it_hashes = lt_hashes ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n for (const e of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.MethodCallParam)) || []) {\r\n const p = e.findDirectExpression(Expressions.MethodParameters);\r\n if (p === undefined) {\r\n continue;\r\n }\r\n const r = p.findDirectTokenByText(\"RECEIVING\");\r\n if (r === undefined) {\r\n continue;\r\n }\r\n const ex = p.findDirectTokenByText(\"EXCEPTIONS\");\r\n if (ex !== undefined) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atToken(file, r, \"Omit RECEIVING\", this.getMetadata().key, this.getConfig().severity));\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.OmitReceiving = OmitReceiving;\r\n//# sourceMappingURL=omit_receiving.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/omit_receiving.js?");
12417
12417
 
12418
12418
  /***/ }),
12419
12419
 
@@ -12424,7 +12424,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12424
12424
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12425
12425
 
12426
12426
  "use strict";
12427
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Parser702Chaining = exports.Parser702ChainingConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass Parser702ChainingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.Parser702ChainingConf = Parser702ChainingConf;\r\nclass Parser702Chaining extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new Parser702ChainingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_702_chaining\",\r\n title: \"Parser Error, bad chanining on 702\",\r\n shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,\nthis rule finds these and reports errors.\nOnly active on target version 702 and below.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() !== version_1.Version.v702\r\n && this.reg.getConfig().getVersion() !== version_1.Version.v700) {\r\n return [];\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const chain of stru.findAllExpressions(Expressions.MethodCallChain)) {\r\n const calls = chain.findDirectExpressions(Expressions.MethodCall);\r\n if (calls.length < 2) {\r\n continue;\r\n }\r\n for (const call of calls) {\r\n const callParam = call.findDirectExpression(Expressions.MethodCallParam);\r\n if (callParam === undefined) {\r\n continue;\r\n }\r\n const param = callParam.findDirectExpression(Expressions.MethodParameters);\r\n if (param === undefined) {\r\n continue;\r\n }\r\n if (param.findDirectTokenByText(\"IMPORTING\")\r\n || param.findDirectTokenByText(\"CHANGING\")\r\n || param.findDirectTokenByText(\"EXCEPTIONS\")) {\r\n const message = \"This kind of method chaining not possible in 702\";\r\n const issue = issue_1.Issue.atPosition(file, param.getFirstToken().getStart(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Parser702Chaining = Parser702Chaining;\r\n//# sourceMappingURL=parser_702_chaining.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_702_chaining.js?");
12427
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Parser702Chaining = exports.Parser702ChainingConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass Parser702ChainingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.Parser702ChainingConf = Parser702ChainingConf;\r\nclass Parser702Chaining extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new Parser702ChainingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_702_chaining\",\r\n title: \"Parser Error, bad chanining on 702\",\r\n shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,\r\nthis rule finds these and reports errors.\r\nOnly active on target version 702 and below.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() !== version_1.Version.v702\r\n && this.reg.getConfig().getVersion() !== version_1.Version.v700) {\r\n return [];\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const chain of stru.findAllExpressions(Expressions.MethodCallChain)) {\r\n const calls = chain.findDirectExpressions(Expressions.MethodCall);\r\n if (calls.length < 2) {\r\n continue;\r\n }\r\n for (const call of calls) {\r\n const callParam = call.findDirectExpression(Expressions.MethodCallParam);\r\n if (callParam === undefined) {\r\n continue;\r\n }\r\n const param = callParam.findDirectExpression(Expressions.MethodParameters);\r\n if (param === undefined) {\r\n continue;\r\n }\r\n if (param.findDirectTokenByText(\"IMPORTING\")\r\n || param.findDirectTokenByText(\"CHANGING\")\r\n || param.findDirectTokenByText(\"EXCEPTIONS\")) {\r\n const message = \"This kind of method chaining not possible in 702\";\r\n const issue = issue_1.Issue.atPosition(file, param.getFirstToken().getStart(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Parser702Chaining = Parser702Chaining;\r\n//# sourceMappingURL=parser_702_chaining.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_702_chaining.js?");
12428
12428
 
12429
12429
  /***/ }),
12430
12430
 
@@ -12435,7 +12435,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12435
12435
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12436
12436
 
12437
12437
  "use strict";
12438
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ParserError = exports.ParserErrorConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst statement_parser_1 = __webpack_require__(/*! ../abap/2_statements/statement_parser */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statement_parser.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass ParserErrorConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ParserErrorConf = ParserErrorConf;\r\nclass ParserError extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ParserErrorConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_error\",\r\n title: \"Parser error\",\r\n shortDescription: `Checks for syntax not recognized by abaplint.\n\nSee recognized syntax at https://syntax.abaplint.org`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const statement of file.getStatements()) {\r\n if (!(statement.get() instanceof _statement_1.Unknown)) {\r\n continue;\r\n }\r\n if (statement.getTokens().length > statement_parser_1.STATEMENT_MAX_TOKENS) {\r\n const message = \"Statement too long, refactor statement\";\r\n const issue = issue_1.Issue.atToken(file, statement.getTokens()[0], message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n else {\r\n const tok = statement.getFirstToken();\r\n const message = \"Statement does not exist in ABAP\" + this.reg.getConfig().getVersion() + \"(or a parser error), \\\"\" + tok.getStr() + \"\\\"\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.reg.getConfig().getVersion() === version_1.Version.v700) {\r\n for (const statement of file.getStatements()) {\r\n if (statement.getPragmas().length > 0) {\r\n const message = \"Pragmas not allowed in v700\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ParserError = ParserError;\r\n//# sourceMappingURL=parser_error.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_error.js?");
12438
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ParserError = exports.ParserErrorConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst statement_parser_1 = __webpack_require__(/*! ../abap/2_statements/statement_parser */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statement_parser.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass ParserErrorConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ParserErrorConf = ParserErrorConf;\r\nclass ParserError extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ParserErrorConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_error\",\r\n title: \"Parser error\",\r\n shortDescription: `Checks for syntax not recognized by abaplint.\r\n\r\nSee recognized syntax at https://syntax.abaplint.org`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const statement of file.getStatements()) {\r\n if (!(statement.get() instanceof _statement_1.Unknown)) {\r\n continue;\r\n }\r\n if (statement.getTokens().length > statement_parser_1.STATEMENT_MAX_TOKENS) {\r\n const message = \"Statement too long, refactor statement\";\r\n const issue = issue_1.Issue.atToken(file, statement.getTokens()[0], message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n else {\r\n const tok = statement.getFirstToken();\r\n const message = \"Statement does not exist in ABAP\" + this.reg.getConfig().getVersion() + \"(or a parser error), \\\"\" + tok.getStr() + \"\\\"\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.reg.getConfig().getVersion() === version_1.Version.v700) {\r\n for (const statement of file.getStatements()) {\r\n if (statement.getPragmas().length > 0) {\r\n const message = \"Pragmas not allowed in v700\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ParserError = ParserError;\r\n//# sourceMappingURL=parser_error.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_error.js?");
12439
12439
 
12440
12440
  /***/ }),
12441
12441
 
@@ -12446,7 +12446,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12446
12446
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12447
12447
 
12448
12448
  "use strict";
12449
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ParserMissingSpace = exports.ParserMissingSpaceConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\n// todo: this rule needs refactoring\r\nclass ParserMissingSpaceConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ParserMissingSpaceConf = ParserMissingSpaceConf;\r\nclass ParserMissingSpace extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ParserMissingSpaceConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_missing_space\",\r\n title: \"Parser Error, missing space\",\r\n shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.\nThis rule makes sure the spaces are consistently required across the language.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],\r\n badExample: `IF ( foo = 'bar').`,\r\n goodExample: `IF ( foo = 'bar' ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let start = new position_1.Position(0, 0);\r\n for (const statement of file.getStatements()) {\r\n const missing = this.missingSpace(statement);\r\n if (missing) {\r\n const message = \"Missing space between string or character literal and parentheses\";\r\n start = missing;\r\n const issue = issue_1.Issue.atPosition(file, start, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n missingSpace(statement) {\r\n const found = statement.findAllExpressionsMulti([Expressions.CondSub, Expressions.SQLCond,\r\n Expressions.ValueBody, Expressions.NewObject, Expressions.Cond,\r\n Expressions.ComponentCond, Expressions.MethodCallParam], true);\r\n let pos = undefined;\r\n for (const f of found) {\r\n const type = f.get();\r\n if (type instanceof Expressions.CondSub) {\r\n pos = this.checkCondSub(f);\r\n }\r\n else if (type instanceof Expressions.ValueBody) {\r\n pos = this.checkValueBody(f);\r\n }\r\n else if (type instanceof Expressions.Cond) {\r\n pos = this.checkCond(f);\r\n }\r\n else if (type instanceof Expressions.ComponentCond) {\r\n pos = this.checkComponentCond(f);\r\n }\r\n else if (type instanceof Expressions.SQLCond) {\r\n pos = this.checkSQLCond(f);\r\n }\r\n else if (type instanceof Expressions.NewObject) {\r\n pos = this.checkNewObject(f);\r\n }\r\n else if (type instanceof Expressions.MethodCallParam) {\r\n pos = this.checkMethodCallParam(f);\r\n }\r\n if (pos) {\r\n return pos;\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkSQLCond(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.SQLCond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkNewObject(cond) {\r\n const children = cond.getChildren();\r\n {\r\n const first = children[children.length - 2].getLastToken();\r\n const second = children[children.length - 1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getEnd().getCol() === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkCondSub(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.Cond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkComponentCond(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.ComponentCond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkValueBody(vb) {\r\n var _a, _b;\r\n const children = vb.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n const current = children[i];\r\n if (current instanceof nodes_1.TokenNode) {\r\n const prev = (_a = children[i - 1]) === null || _a === void 0 ? void 0 : _a.getLastToken();\r\n const next = (_b = children[i + 1]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\r\n if (current.getFirstToken().getStr() === \"(\"\r\n && next\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (current.getFirstToken().getStr() === \")\"\r\n && prev\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getEnd().getCol() === current.getFirstToken().getStart().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkCond(cond) {\r\n const children = cond.getAllTokens();\r\n for (let i = 0; i < children.length - 1; i++) {\r\n const current = children[i];\r\n const next = children[i + 1];\r\n if (next.getStr().startsWith(\"'\")\r\n && next.getRow() === current.getRow()\r\n && next.getCol() === current.getEnd().getCol()) {\r\n return current.getEnd();\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkMethodCallParam(call) {\r\n const children = call.getChildren();\r\n {\r\n const first = children[0].getFirstToken();\r\n const second = children[1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getCol() + 1 === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n {\r\n const first = children[children.length - 2].getLastToken();\r\n const second = children[children.length - 1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getEnd().getCol() === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.ParserMissingSpace = ParserMissingSpace;\r\n//# sourceMappingURL=parser_missing_space.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_missing_space.js?");
12449
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ParserMissingSpace = exports.ParserMissingSpaceConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\n// todo: this rule needs refactoring\r\nclass ParserMissingSpaceConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ParserMissingSpaceConf = ParserMissingSpaceConf;\r\nclass ParserMissingSpace extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ParserMissingSpaceConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_missing_space\",\r\n title: \"Parser Error, missing space\",\r\n shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.\r\nThis rule makes sure the spaces are consistently required across the language.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],\r\n badExample: `IF ( foo = 'bar').`,\r\n goodExample: `IF ( foo = 'bar' ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let start = new position_1.Position(0, 0);\r\n for (const statement of file.getStatements()) {\r\n const missing = this.missingSpace(statement);\r\n if (missing) {\r\n const message = \"Missing space between string or character literal and parentheses\";\r\n start = missing;\r\n const issue = issue_1.Issue.atPosition(file, start, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n missingSpace(statement) {\r\n const found = statement.findAllExpressionsMulti([Expressions.CondSub, Expressions.SQLCond,\r\n Expressions.ValueBody, Expressions.NewObject, Expressions.Cond,\r\n Expressions.ComponentCond, Expressions.MethodCallParam], true);\r\n let pos = undefined;\r\n for (const f of found) {\r\n const type = f.get();\r\n if (type instanceof Expressions.CondSub) {\r\n pos = this.checkCondSub(f);\r\n }\r\n else if (type instanceof Expressions.ValueBody) {\r\n pos = this.checkValueBody(f);\r\n }\r\n else if (type instanceof Expressions.Cond) {\r\n pos = this.checkCond(f);\r\n }\r\n else if (type instanceof Expressions.ComponentCond) {\r\n pos = this.checkComponentCond(f);\r\n }\r\n else if (type instanceof Expressions.SQLCond) {\r\n pos = this.checkSQLCond(f);\r\n }\r\n else if (type instanceof Expressions.NewObject) {\r\n pos = this.checkNewObject(f);\r\n }\r\n else if (type instanceof Expressions.MethodCallParam) {\r\n pos = this.checkMethodCallParam(f);\r\n }\r\n if (pos) {\r\n return pos;\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkSQLCond(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.SQLCond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkNewObject(cond) {\r\n const children = cond.getChildren();\r\n {\r\n const first = children[children.length - 2].getLastToken();\r\n const second = children[children.length - 1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getEnd().getCol() === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkCondSub(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.Cond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkComponentCond(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.ComponentCond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkValueBody(vb) {\r\n var _a, _b;\r\n const children = vb.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n const current = children[i];\r\n if (current instanceof nodes_1.TokenNode) {\r\n const prev = (_a = children[i - 1]) === null || _a === void 0 ? void 0 : _a.getLastToken();\r\n const next = (_b = children[i + 1]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\r\n if (current.getFirstToken().getStr() === \"(\"\r\n && next\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (current.getFirstToken().getStr() === \")\"\r\n && prev\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getEnd().getCol() === current.getFirstToken().getStart().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkCond(cond) {\r\n const children = cond.getAllTokens();\r\n for (let i = 0; i < children.length - 1; i++) {\r\n const current = children[i];\r\n const next = children[i + 1];\r\n if (next.getStr().startsWith(\"'\")\r\n && next.getRow() === current.getRow()\r\n && next.getCol() === current.getEnd().getCol()) {\r\n return current.getEnd();\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkMethodCallParam(call) {\r\n const children = call.getChildren();\r\n {\r\n const first = children[0].getFirstToken();\r\n const second = children[1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getCol() + 1 === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n {\r\n const first = children[children.length - 2].getLastToken();\r\n const second = children[children.length - 1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getEnd().getCol() === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.ParserMissingSpace = ParserMissingSpace;\r\n//# sourceMappingURL=parser_missing_space.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_missing_space.js?");
12450
12450
 
12451
12451
  /***/ }),
12452
12452
 
@@ -12479,7 +12479,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12479
12479
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12480
12480
 
12481
12481
  "use strict";
12482
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferInline = exports.PreferInlineConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass PreferInlineConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferInlineConf = PreferInlineConf;\r\nclass PreferInline {\r\n constructor() {\r\n this.conf = new PreferInlineConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_inline\",\r\n title: \"Prefer Inline Declarations\",\r\n shortDescription: `Prefer inline to up-front declarations.`,\r\n extendedInformation: `EXPERIMENTAL\n\nActivates if language version is v740sp02 or above.\n\nVariables must be local(METHOD or FORM).\n\nNo generic or void typed variables.\n\nFirst position used must be a full/pure write.\n\nMove statment is not a cast(?=)\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],\r\n badExample: `DATA foo TYPE i.\nfoo = 2.\nDATA percentage TYPE decfloat34.\npercentage = ( comment_number / abs_statement_number ) * 100.`,\r\n goodExample: `DATA(foo) = 2.\nDATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n else if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const scopes = this.findScopeCandidates(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n const ret = [];\r\n for (const s of scopes) {\r\n ret.push(...this.analyzeScope(s, obj));\r\n }\r\n return ret;\r\n }\r\n ///////////////////////////\r\n analyzeScope(node, obj) {\r\n var _a, _b;\r\n const ret = [];\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const identifier = vars[name];\r\n if (this.isLocalDefinition(node, identifier) === false\r\n || identifier.getMeta().includes(\"inline\" /* IdentifierMeta.InlineDefinition */)\r\n || identifier.getMeta().includes(\"form_parameter\" /* IdentifierMeta.FormParameter */)) {\r\n continue;\r\n }\r\n else if (identifier.getType().isGeneric() === true) {\r\n continue;\r\n }\r\n else if (identifier.getType().containsVoid() === true) {\r\n continue;\r\n }\r\n const write = this.firstUseIsWrite(node, identifier);\r\n if (write === undefined) {\r\n continue;\r\n }\r\n // check that it is a pure write, eg not sub component assignment\r\n const next = this.findNextToken(write, obj);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n else if ((next === null || next === void 0 ? void 0 : next.getStart().equals(write.position.getEnd())) && next.getStr() !== \".\" && next.getStr() !== \",\") {\r\n continue;\r\n }\r\n const file = obj.getABAPFileByName(identifier.getFilename());\r\n const writeStatement = edit_helper_1.EditHelper.findStatement(next, file);\r\n const statementType = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.get();\r\n if (statementType === undefined) {\r\n continue;\r\n }\r\n // for now only allow some specific target statements, todo refactor\r\n if (!(statementType instanceof Statements.Move\r\n || statementType instanceof Statements.Catch\r\n || statementType instanceof Statements.ReadTable\r\n || statementType instanceof Statements.Loop)\r\n || ((_a = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.concatTokens()) === null || _a === void 0 ? void 0 : _a.includes(\"?=\"))\r\n || ((_b = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.concatTokens()) === null || _b === void 0 ? void 0 : _b.includes(\" #(\"))) {\r\n continue;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(identifier.getToken(), file);\r\n const concat = statement === null || statement === void 0 ? void 0 : statement.concatTokens().toUpperCase();\r\n if (concat === null || concat === void 0 ? void 0 : concat.includes(\"BEGIN OF\")) {\r\n continue;\r\n }\r\n let fix = undefined;\r\n if (file && statement) {\r\n const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n const name = identifier.getName();\r\n const replace = name.startsWith(\"<\") ? \"FIELD-SYMBOL(\" + name + \")\" : \"DATA(\" + name + \")\";\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(file, write.position.getStart(), write.position.getEnd(), replace);\r\n fix = edit_helper_1.EditHelper.merge(fix1, fix2);\r\n }\r\n const message = this.getMetadata().title + \", \" + name;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n ////////////////////////\r\n findNextToken(ref, obj) {\r\n const file = obj.getABAPFileByName(ref.resolved.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n for (const t of file.getTokens()) {\r\n if (t.getStart().isAfter(ref.position.getEnd())) {\r\n return t;\r\n }\r\n }\r\n return undefined;\r\n }\r\n firstUseIsWrite(node, identifier) {\r\n // assumption: variables are local, so only the current scope must be searched\r\n var _a, _b, _c;\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.TypeReference\r\n && ((_a = r.resolved) === null || _a === void 0 ? void 0 : _a.getStart().equals(identifier.getStart())) === true) {\r\n return undefined;\r\n }\r\n }\r\n let firstRead = undefined;\r\n for (const r of node.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.DataReadReference\r\n || ((_b = r.resolved) === null || _b === void 0 ? void 0 : _b.getStart().equals(identifier.getStart())) === false) {\r\n continue;\r\n }\r\n if (r.resolved) {\r\n firstRead = { position: r.position, resolved: r.resolved };\r\n break;\r\n }\r\n }\r\n let firstWrite = undefined;\r\n for (const w of node.getData().references) {\r\n if (w.referenceType !== _reference_1.ReferenceType.DataWriteReference\r\n || ((_c = w.resolved) === null || _c === void 0 ? void 0 : _c.getStart().equals(identifier.getStart())) === false) {\r\n continue;\r\n }\r\n if (w.resolved) {\r\n firstWrite = { position: w.position, resolved: w.resolved };\r\n break;\r\n }\r\n }\r\n if (firstRead === undefined) {\r\n return firstWrite;\r\n }\r\n else if (firstWrite === undefined) {\r\n return undefined;\r\n }\r\n else if (firstWrite.position.getStart().getRow() === firstRead.position.getStart().getRow()) {\r\n // if the same statement both reads and write the same variable\r\n // note that currently just the line number is compared, this is not correct, it should check if its the same statement\r\n return undefined;\r\n }\r\n else if (firstWrite.position.getStart().isBefore(firstRead.position.getStart())) {\r\n return firstWrite;\r\n }\r\n return undefined;\r\n }\r\n isLocalDefinition(node, identifier) {\r\n const { start, end } = node.calcCoverage();\r\n if (identifier.getStart().isAfter(start) && identifier.getStart().isBefore(end)) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n findScopeCandidates(node) {\r\n if (node.getIdentifier().stype === _scope_type_1.ScopeType.Form\r\n || node.getIdentifier().stype === _scope_type_1.ScopeType.Method) {\r\n return [node];\r\n }\r\n let ret = [];\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.findScopeCandidates(c));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.PreferInline = PreferInline;\r\n//# sourceMappingURL=prefer_inline.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_inline.js?");
12482
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferInline = exports.PreferInlineConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass PreferInlineConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferInlineConf = PreferInlineConf;\r\nclass PreferInline {\r\n constructor() {\r\n this.conf = new PreferInlineConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_inline\",\r\n title: \"Prefer Inline Declarations\",\r\n shortDescription: `Prefer inline to up-front declarations.`,\r\n extendedInformation: `EXPERIMENTAL\r\n\r\nActivates if language version is v740sp02 or above.\r\n\r\nVariables must be local(METHOD or FORM).\r\n\r\nNo generic or void typed variables.\r\n\r\nFirst position used must be a full/pure write.\r\n\r\nMove statment is not a cast(?=)\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],\r\n badExample: `DATA foo TYPE i.\r\nfoo = 2.\r\nDATA percentage TYPE decfloat34.\r\npercentage = ( comment_number / abs_statement_number ) * 100.`,\r\n goodExample: `DATA(foo) = 2.\r\nDATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n else if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const scopes = this.findScopeCandidates(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n const ret = [];\r\n for (const s of scopes) {\r\n ret.push(...this.analyzeScope(s, obj));\r\n }\r\n return ret;\r\n }\r\n ///////////////////////////\r\n analyzeScope(node, obj) {\r\n var _a, _b;\r\n const ret = [];\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const identifier = vars[name];\r\n if (this.isLocalDefinition(node, identifier) === false\r\n || identifier.getMeta().includes(\"inline\" /* IdentifierMeta.InlineDefinition */)\r\n || identifier.getMeta().includes(\"form_parameter\" /* IdentifierMeta.FormParameter */)) {\r\n continue;\r\n }\r\n else if (identifier.getType().isGeneric() === true) {\r\n continue;\r\n }\r\n else if (identifier.getType().containsVoid() === true) {\r\n continue;\r\n }\r\n const write = this.firstUseIsWrite(node, identifier);\r\n if (write === undefined) {\r\n continue;\r\n }\r\n // check that it is a pure write, eg not sub component assignment\r\n const next = this.findNextToken(write, obj);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n else if ((next === null || next === void 0 ? void 0 : next.getStart().equals(write.position.getEnd())) && next.getStr() !== \".\" && next.getStr() !== \",\") {\r\n continue;\r\n }\r\n const file = obj.getABAPFileByName(identifier.getFilename());\r\n const writeStatement = edit_helper_1.EditHelper.findStatement(next, file);\r\n const statementType = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.get();\r\n if (statementType === undefined) {\r\n continue;\r\n }\r\n // for now only allow some specific target statements, todo refactor\r\n if (!(statementType instanceof Statements.Move\r\n || statementType instanceof Statements.Catch\r\n || statementType instanceof Statements.ReadTable\r\n || statementType instanceof Statements.Loop)\r\n || ((_a = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.concatTokens()) === null || _a === void 0 ? void 0 : _a.includes(\"?=\"))\r\n || ((_b = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.concatTokens()) === null || _b === void 0 ? void 0 : _b.includes(\" #(\"))) {\r\n continue;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(identifier.getToken(), file);\r\n const concat = statement === null || statement === void 0 ? void 0 : statement.concatTokens().toUpperCase();\r\n if (concat === null || concat === void 0 ? void 0 : concat.includes(\"BEGIN OF\")) {\r\n continue;\r\n }\r\n let fix = undefined;\r\n if (file && statement) {\r\n const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n const name = identifier.getName();\r\n const replace = name.startsWith(\"<\") ? \"FIELD-SYMBOL(\" + name + \")\" : \"DATA(\" + name + \")\";\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(file, write.position.getStart(), write.position.getEnd(), replace);\r\n fix = edit_helper_1.EditHelper.merge(fix1, fix2);\r\n }\r\n const message = this.getMetadata().title + \", \" + name;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n ////////////////////////\r\n findNextToken(ref, obj) {\r\n const file = obj.getABAPFileByName(ref.resolved.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n for (const t of file.getTokens()) {\r\n if (t.getStart().isAfter(ref.position.getEnd())) {\r\n return t;\r\n }\r\n }\r\n return undefined;\r\n }\r\n firstUseIsWrite(node, identifier) {\r\n // assumption: variables are local, so only the current scope must be searched\r\n var _a, _b, _c;\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.TypeReference\r\n && ((_a = r.resolved) === null || _a === void 0 ? void 0 : _a.getStart().equals(identifier.getStart())) === true) {\r\n return undefined;\r\n }\r\n }\r\n let firstRead = undefined;\r\n for (const r of node.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.DataReadReference\r\n || ((_b = r.resolved) === null || _b === void 0 ? void 0 : _b.getStart().equals(identifier.getStart())) === false) {\r\n continue;\r\n }\r\n if (r.resolved) {\r\n firstRead = { position: r.position, resolved: r.resolved };\r\n break;\r\n }\r\n }\r\n let firstWrite = undefined;\r\n for (const w of node.getData().references) {\r\n if (w.referenceType !== _reference_1.ReferenceType.DataWriteReference\r\n || ((_c = w.resolved) === null || _c === void 0 ? void 0 : _c.getStart().equals(identifier.getStart())) === false) {\r\n continue;\r\n }\r\n if (w.resolved) {\r\n firstWrite = { position: w.position, resolved: w.resolved };\r\n break;\r\n }\r\n }\r\n if (firstRead === undefined) {\r\n return firstWrite;\r\n }\r\n else if (firstWrite === undefined) {\r\n return undefined;\r\n }\r\n else if (firstWrite.position.getStart().getRow() === firstRead.position.getStart().getRow()) {\r\n // if the same statement both reads and write the same variable\r\n // note that currently just the line number is compared, this is not correct, it should check if its the same statement\r\n return undefined;\r\n }\r\n else if (firstWrite.position.getStart().isBefore(firstRead.position.getStart())) {\r\n return firstWrite;\r\n }\r\n return undefined;\r\n }\r\n isLocalDefinition(node, identifier) {\r\n const { start, end } = node.calcCoverage();\r\n if (identifier.getStart().isAfter(start) && identifier.getStart().isBefore(end)) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n findScopeCandidates(node) {\r\n if (node.getIdentifier().stype === _scope_type_1.ScopeType.Form\r\n || node.getIdentifier().stype === _scope_type_1.ScopeType.Method) {\r\n return [node];\r\n }\r\n let ret = [];\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.findScopeCandidates(c));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.PreferInline = PreferInline;\r\n//# sourceMappingURL=prefer_inline.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_inline.js?");
12483
12483
 
12484
12484
  /***/ }),
12485
12485
 
@@ -12490,7 +12490,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12490
12490
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12491
12491
 
12492
12492
  "use strict";
12493
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferIsNot = exports.PreferIsNotConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass PreferIsNotConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferIsNotConf = PreferIsNotConf;\r\nclass PreferIsNot extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferIsNotConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_is_not\",\r\n title: \"Prefer IS NOT to NOT IS\",\r\n shortDescription: `Prefer IS NOT to NOT IS`,\r\n extendedInformation: `\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is\n\n\"if not is_valid( ).\" examples are skipped`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n goodExample: `IF variable IS NOT INITIAL.\nIF variable NP 'TODO*'.\nIF variable <> 42.`,\r\n badExample: `IF NOT variable IS INITIAL.\nIF NOT variable CP 'TODO*'.\nIF NOT variable = 42.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const s of file.getStatements()) {\r\n for (const c of s.findAllExpressions(Expressions.Compare)) {\r\n if (c.concatTokens().toUpperCase().startsWith(\"NOT \") === false) {\r\n continue;\r\n }\r\n else if (c.getChildren().length === 2 && c.getChildren()[1].get() instanceof Expressions.MethodCallChain) {\r\n continue;\r\n }\r\n const message = \"Prefer IS NOT to NOT IS\";\r\n const fix = this.getFix(file, c);\r\n issues.push(issue_1.Issue.atToken(file, c.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, c) {\r\n let insertFix;\r\n if (c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"IS\") {\r\n const tokenPositionBeforeDelete = c.getChildren()[2].getLastToken().getEnd();\r\n const tokenPosition = new position_1.Position(tokenPositionBeforeDelete.getRow(), tokenPositionBeforeDelete.getCol() + 1);\r\n insertFix = edit_helper_1.EditHelper.insertAt(file, tokenPosition, \"NOT \");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"IN\" || c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"BETWEEN\") {\r\n const tokenPositionBeforeDelete = c.getChildren()[1].getLastToken().getEnd();\r\n const tokenPosition = new position_1.Position(tokenPositionBeforeDelete.getRow(), tokenPositionBeforeDelete.getCol() + 1);\r\n insertFix = edit_helper_1.EditHelper.insertAt(file, tokenPosition, \"NOT \");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<>\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<>\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"=\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \">\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \">\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \">=\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \">=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<=\");\r\n }\r\n else {\r\n return;\r\n }\r\n const endCol = c.getChildren()[0].getFirstToken().getEnd().getCol() + 1;\r\n const endPosition = new position_1.Position(c.getChildren()[0].getFirstToken().getEnd().getRow(), endCol);\r\n const deleteFix = edit_helper_1.EditHelper.deleteRange(file, c.getChildren()[0].getFirstToken().getStart(), endPosition);\r\n const finalFix = edit_helper_1.EditHelper.merge(insertFix, deleteFix);\r\n return finalFix;\r\n }\r\n}\r\nexports.PreferIsNot = PreferIsNot;\r\n//# sourceMappingURL=prefer_is_not.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_is_not.js?");
12493
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferIsNot = exports.PreferIsNotConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass PreferIsNotConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferIsNotConf = PreferIsNotConf;\r\nclass PreferIsNot extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferIsNotConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_is_not\",\r\n title: \"Prefer IS NOT to NOT IS\",\r\n shortDescription: `Prefer IS NOT to NOT IS`,\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is\r\n\r\n\"if not is_valid( ).\" examples are skipped`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n goodExample: `IF variable IS NOT INITIAL.\r\nIF variable NP 'TODO*'.\r\nIF variable <> 42.`,\r\n badExample: `IF NOT variable IS INITIAL.\r\nIF NOT variable CP 'TODO*'.\r\nIF NOT variable = 42.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const s of file.getStatements()) {\r\n for (const c of s.findAllExpressions(Expressions.Compare)) {\r\n if (c.concatTokens().toUpperCase().startsWith(\"NOT \") === false) {\r\n continue;\r\n }\r\n else if (c.getChildren().length === 2 && c.getChildren()[1].get() instanceof Expressions.MethodCallChain) {\r\n continue;\r\n }\r\n const message = \"Prefer IS NOT to NOT IS\";\r\n const fix = this.getFix(file, c);\r\n issues.push(issue_1.Issue.atToken(file, c.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, c) {\r\n let insertFix;\r\n if (c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"IS\") {\r\n const tokenPositionBeforeDelete = c.getChildren()[2].getLastToken().getEnd();\r\n const tokenPosition = new position_1.Position(tokenPositionBeforeDelete.getRow(), tokenPositionBeforeDelete.getCol() + 1);\r\n insertFix = edit_helper_1.EditHelper.insertAt(file, tokenPosition, \"NOT \");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"IN\" || c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"BETWEEN\") {\r\n const tokenPositionBeforeDelete = c.getChildren()[1].getLastToken().getEnd();\r\n const tokenPosition = new position_1.Position(tokenPositionBeforeDelete.getRow(), tokenPositionBeforeDelete.getCol() + 1);\r\n insertFix = edit_helper_1.EditHelper.insertAt(file, tokenPosition, \"NOT \");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<>\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<>\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"=\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \">\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \">\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \">=\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \">=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<=\");\r\n }\r\n else {\r\n return;\r\n }\r\n const endCol = c.getChildren()[0].getFirstToken().getEnd().getCol() + 1;\r\n const endPosition = new position_1.Position(c.getChildren()[0].getFirstToken().getEnd().getRow(), endCol);\r\n const deleteFix = edit_helper_1.EditHelper.deleteRange(file, c.getChildren()[0].getFirstToken().getStart(), endPosition);\r\n const finalFix = edit_helper_1.EditHelper.merge(insertFix, deleteFix);\r\n return finalFix;\r\n }\r\n}\r\nexports.PreferIsNot = PreferIsNot;\r\n//# sourceMappingURL=prefer_is_not.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_is_not.js?");
12494
12494
 
12495
12495
  /***/ }),
12496
12496
 
@@ -12501,7 +12501,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12501
12501
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12502
12502
 
12503
12503
  "use strict";
12504
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferRaiseExceptionNew = exports.PreferRaiseExceptionNewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass PreferRaiseExceptionNewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferRaiseExceptionNewConf = PreferRaiseExceptionNewConf;\r\nclass PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferRaiseExceptionNewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_raise_exception_new\",\r\n title: \"Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE\",\r\n shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,\r\n extendedInformation: `\n https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,\r\n badExample: `RAISE EXCEPTION TYPE cx_generation_error\n EXPORTING\n previous = exception.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n if (this.reg.getConfig().getVersion() < __1.Version.v752) {\r\n return [];\r\n }\r\n const issues = [];\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof __1.Statements.Raise) {\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.includes(\" MESSAGE\")) {\r\n continue;\r\n }\r\n if (concat.startsWith(\"RAISE EXCEPTION TYPE \")) {\r\n const message = \"Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE\";\r\n const fix = this.getFix(file, statement, concat.includes(\" EXPORTING\") ? true : false);\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, withExporting) {\r\n const children = statement.getChildren();\r\n let contentFix = undefined;\r\n if (withExporting) {\r\n const fixText = \"( \" + children[5].concatTokens() + \" ).\";\r\n contentFix = edit_helper_1.EditHelper.replaceRange(file, children[3].getLastToken().getEnd(), statement.getEnd(), fixText);\r\n }\r\n else {\r\n contentFix = edit_helper_1.EditHelper.replaceRange(file, children[3].getLastToken().getEnd(), statement.getEnd(), \"( ).\");\r\n }\r\n const replaceType = edit_helper_1.EditHelper.replaceToken(file, children[2].getFirstToken(), \"NEW\");\r\n return edit_helper_1.EditHelper.merge(contentFix, replaceType);\r\n }\r\n}\r\nexports.PreferRaiseExceptionNew = PreferRaiseExceptionNew;\r\n//# sourceMappingURL=prefer_raise_exception_new.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_raise_exception_new.js?");
12504
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferRaiseExceptionNew = exports.PreferRaiseExceptionNewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass PreferRaiseExceptionNewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferRaiseExceptionNewConf = PreferRaiseExceptionNewConf;\r\nclass PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferRaiseExceptionNewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_raise_exception_new\",\r\n title: \"Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE\",\r\n shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,\r\n extendedInformation: `\r\n https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,\r\n badExample: `RAISE EXCEPTION TYPE cx_generation_error\r\n EXPORTING\r\n previous = exception.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n if (this.reg.getConfig().getVersion() < __1.Version.v752) {\r\n return [];\r\n }\r\n const issues = [];\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof __1.Statements.Raise) {\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.includes(\" MESSAGE\")) {\r\n continue;\r\n }\r\n if (concat.startsWith(\"RAISE EXCEPTION TYPE \")) {\r\n const message = \"Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE\";\r\n const fix = this.getFix(file, statement, concat.includes(\" EXPORTING\") ? true : false);\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, withExporting) {\r\n const children = statement.getChildren();\r\n let contentFix = undefined;\r\n if (withExporting) {\r\n const fixText = \"( \" + children[5].concatTokens() + \" ).\";\r\n contentFix = edit_helper_1.EditHelper.replaceRange(file, children[3].getLastToken().getEnd(), statement.getEnd(), fixText);\r\n }\r\n else {\r\n contentFix = edit_helper_1.EditHelper.replaceRange(file, children[3].getLastToken().getEnd(), statement.getEnd(), \"( ).\");\r\n }\r\n const replaceType = edit_helper_1.EditHelper.replaceToken(file, children[2].getFirstToken(), \"NEW\");\r\n return edit_helper_1.EditHelper.merge(contentFix, replaceType);\r\n }\r\n}\r\nexports.PreferRaiseExceptionNew = PreferRaiseExceptionNew;\r\n//# sourceMappingURL=prefer_raise_exception_new.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_raise_exception_new.js?");
12505
12505
 
12506
12506
  /***/ }),
12507
12507
 
@@ -12512,7 +12512,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12512
12512
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12513
12513
 
12514
12514
  "use strict";
12515
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferReturningToExporting = exports.PreferReturningToExportingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass PreferReturningToExportingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferReturningToExportingConf = PreferReturningToExportingConf;\r\nclass PreferReturningToExporting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferReturningToExportingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_returning_to_exporting\",\r\n title: \"Prefer RETURNING to EXPORTING\",\r\n shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting\nhttps://docs.abapopenchecks.org/checks/44/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const ret = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const def of stru.findAllStatements(Statements.MethodDef)) {\r\n if (def.findFirstExpression(Expressions.MethodDefChanging)) {\r\n continue;\r\n }\r\n const exporting = def.findFirstExpression(Expressions.MethodDefExporting);\r\n if (exporting === undefined) {\r\n continue;\r\n }\r\n const returning = def.findFirstExpression(Expressions.MethodDefReturning);\r\n if (returning !== undefined) {\r\n continue;\r\n }\r\n const params = exporting.findDirectExpressions(Expressions.MethodParam);\r\n if (params.length !== 1) {\r\n continue;\r\n }\r\n const concat = params[0].concatTokens().toUpperCase();\r\n if (concat.endsWith(\"TYPE ANY\")\r\n || concat.endsWith(\"TYPE ANY TABLE\")\r\n || concat.endsWith(\"TYPE C\")\r\n || concat.endsWith(\"TYPE CLIKE\")\r\n || concat.endsWith(\"TYPE CSEQUENCE\")\r\n || concat.endsWith(\"TYPE DATA\")\r\n || concat.endsWith(\"TYPE DECFLOAT\")\r\n || concat.endsWith(\"TYPE HASHED TABLE\")\r\n || concat.endsWith(\"TYPE INDEX TABLE\")\r\n || concat.endsWith(\"TYPE N\")\r\n || concat.endsWith(\"TYPE NUMERIC\")\r\n || concat.endsWith(\"TYPE OBJECT\")\r\n || concat.endsWith(\"TYPE P\")\r\n || concat.endsWith(\"TYPE SIMPLE\")\r\n || concat.endsWith(\"TYPE SORTED TABLE\")\r\n || concat.endsWith(\"TYPE STANDARD TABLE\")\r\n || concat.endsWith(\"TYPE TABLE\")\r\n || concat.endsWith(\"TYPE X\")\r\n || concat.endsWith(\"TYPE XSEQUENCE\")) {\r\n continue;\r\n }\r\n const token = params[0].getFirstToken();\r\n const issue = issue_1.Issue.atToken(file, token, \"Prefer RETURNING to EXPORTING\", this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.PreferReturningToExporting = PreferReturningToExporting;\r\n//# sourceMappingURL=prefer_returning_to_exporting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_returning_to_exporting.js?");
12515
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferReturningToExporting = exports.PreferReturningToExportingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass PreferReturningToExportingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferReturningToExportingConf = PreferReturningToExportingConf;\r\nclass PreferReturningToExporting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferReturningToExportingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_returning_to_exporting\",\r\n title: \"Prefer RETURNING to EXPORTING\",\r\n shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting\r\nhttps://docs.abapopenchecks.org/checks/44/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const ret = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const def of stru.findAllStatements(Statements.MethodDef)) {\r\n if (def.findFirstExpression(Expressions.MethodDefChanging)) {\r\n continue;\r\n }\r\n const exporting = def.findFirstExpression(Expressions.MethodDefExporting);\r\n if (exporting === undefined) {\r\n continue;\r\n }\r\n const returning = def.findFirstExpression(Expressions.MethodDefReturning);\r\n if (returning !== undefined) {\r\n continue;\r\n }\r\n const params = exporting.findDirectExpressions(Expressions.MethodParam);\r\n if (params.length !== 1) {\r\n continue;\r\n }\r\n const concat = params[0].concatTokens().toUpperCase();\r\n if (concat.endsWith(\"TYPE ANY\")\r\n || concat.endsWith(\"TYPE ANY TABLE\")\r\n || concat.endsWith(\"TYPE C\")\r\n || concat.endsWith(\"TYPE CLIKE\")\r\n || concat.endsWith(\"TYPE CSEQUENCE\")\r\n || concat.endsWith(\"TYPE DATA\")\r\n || concat.endsWith(\"TYPE DECFLOAT\")\r\n || concat.endsWith(\"TYPE HASHED TABLE\")\r\n || concat.endsWith(\"TYPE INDEX TABLE\")\r\n || concat.endsWith(\"TYPE N\")\r\n || concat.endsWith(\"TYPE NUMERIC\")\r\n || concat.endsWith(\"TYPE OBJECT\")\r\n || concat.endsWith(\"TYPE P\")\r\n || concat.endsWith(\"TYPE SIMPLE\")\r\n || concat.endsWith(\"TYPE SORTED TABLE\")\r\n || concat.endsWith(\"TYPE STANDARD TABLE\")\r\n || concat.endsWith(\"TYPE TABLE\")\r\n || concat.endsWith(\"TYPE X\")\r\n || concat.endsWith(\"TYPE XSEQUENCE\")) {\r\n continue;\r\n }\r\n const token = params[0].getFirstToken();\r\n const issue = issue_1.Issue.atToken(file, token, \"Prefer RETURNING to EXPORTING\", this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.PreferReturningToExporting = PreferReturningToExporting;\r\n//# sourceMappingURL=prefer_returning_to_exporting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_returning_to_exporting.js?");
12516
12516
 
12517
12517
  /***/ }),
12518
12518
 
@@ -12523,7 +12523,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12523
12523
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12524
12524
 
12525
12525
  "use strict";
12526
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferXsdbool = exports.PreferXsdboolConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass PreferXsdboolConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferXsdboolConf = PreferXsdboolConf;\r\nclass PreferXsdbool extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferXsdboolConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_xsdbool\",\r\n title: \"Prefer xsdbool over boolc\",\r\n shortDescription: `Prefer xsdbool over boolc`,\r\n extendedInformation: `Activates if language version is v740sp08 or above.\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA(sdf) = boolc( 1 = 2 ).`,\r\n goodExample: `DATA(sdf) = xsdbool( 1 = 2 ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp08 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n for (const s of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Source)) || []) {\r\n if (s.concatTokens().toUpperCase().startsWith(\"BOOLC( \") === false) {\r\n continue;\r\n }\r\n const token = s.getFirstToken();\r\n const message = \"Prefer xsdbool over boolc\";\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"xsdbool\");\r\n issues.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.PreferXsdbool = PreferXsdbool;\r\n//# sourceMappingURL=prefer_xsdbool.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_xsdbool.js?");
12526
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferXsdbool = exports.PreferXsdboolConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass PreferXsdboolConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferXsdboolConf = PreferXsdboolConf;\r\nclass PreferXsdbool extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferXsdboolConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_xsdbool\",\r\n title: \"Prefer xsdbool over boolc\",\r\n shortDescription: `Prefer xsdbool over boolc`,\r\n extendedInformation: `Activates if language version is v740sp08 or above.\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA(sdf) = boolc( 1 = 2 ).`,\r\n goodExample: `DATA(sdf) = xsdbool( 1 = 2 ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp08 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n for (const s of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Source)) || []) {\r\n if (s.concatTokens().toUpperCase().startsWith(\"BOOLC( \") === false) {\r\n continue;\r\n }\r\n const token = s.getFirstToken();\r\n const message = \"Prefer xsdbool over boolc\";\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"xsdbool\");\r\n issues.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.PreferXsdbool = PreferXsdbool;\r\n//# sourceMappingURL=prefer_xsdbool.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_xsdbool.js?");
12527
12527
 
12528
12528
  /***/ }),
12529
12529
 
@@ -12578,7 +12578,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12578
12578
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12579
12579
 
12580
12580
  "use strict";
12581
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RemoveDescriptions = exports.RemoveDescriptionsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst fast_xml_parser_1 = __webpack_require__(/*! fast-xml-parser */ \"./node_modules/fast-xml-parser/src/fxp.js\");\r\nconst Objects = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst xml_utils_1 = __webpack_require__(/*! ../xml_utils */ \"./node_modules/@abaplint/core/build/src/xml_utils.js\");\r\nclass RemoveDescriptionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore global exception classes */\r\n this.ignoreExceptions = false;\r\n /** Ignore global workflow classes */\r\n this.ignoreWorkflow = true;\r\n }\r\n}\r\nexports.RemoveDescriptionsConf = RemoveDescriptionsConf;\r\nclass RemoveDescriptions {\r\n constructor() {\r\n this.conf = new RemoveDescriptionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"remove_descriptions\",\r\n title: \"Remove descriptions\",\r\n shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.\n\nClass descriptions are required, see rule description_empty.\n\nConsider using ABAP Doc for documentation.`,\r\n tags: [],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n // plan is omitting knowledge about descriptions in abaplint, so this rule must parse the XML\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof Objects.Class) {\r\n let def;\r\n try {\r\n def = obj.getClassDefinition();\r\n }\r\n catch (_a) {\r\n return [];\r\n }\r\n if (def === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(def, obj)) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreWorkflow === true && def.interfaces.find(e => e.name.toUpperCase() === \"IF_WORKFLOW\")) {\r\n return [];\r\n }\r\n return this.checkClass(obj);\r\n }\r\n else if (obj instanceof Objects.Interface) {\r\n return this.checkInterface(obj);\r\n }\r\n return [];\r\n }\r\n //////////////\r\n checkInterface(obj) {\r\n const xml = obj.getXML();\r\n if (xml === undefined) {\r\n return [];\r\n }\r\n const file = obj.getXMLFile();\r\n if (file === undefined) {\r\n return [];\r\n }\r\n return this.checkXML(xml, file);\r\n }\r\n checkClass(obj) {\r\n const xml = obj.getXML();\r\n if (xml === undefined) {\r\n return [];\r\n }\r\n const file = obj.getXMLFile();\r\n if (file === undefined) {\r\n return [];\r\n }\r\n return this.checkXML(xml, file);\r\n }\r\n checkXML(xml, file) {\r\n const parsed = new fast_xml_parser_1.XMLParser({ parseTagValue: false, ignoreAttributes: true, trimValues: false }).parse(xml);\r\n if (parsed === undefined || parsed.abapGit[\"asx:abap\"][\"asx:values\"] === undefined) {\r\n return [];\r\n }\r\n const desc = parsed.abapGit[\"asx:abap\"][\"asx:values\"].DESCRIPTIONS;\r\n if (desc === undefined) {\r\n return [];\r\n }\r\n const ret = [];\r\n for (const d of (0, xml_utils_1.xmlToArray)(desc.SEOCOMPOTX)) {\r\n const message = \"Remove description for \" + d.CMPNAME;\r\n const position = new position_1.Position(1, 1);\r\n const issue = issue_1.Issue.atPosition(file, position, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.RemoveDescriptions = RemoveDescriptions;\r\n//# sourceMappingURL=remove_descriptions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/remove_descriptions.js?");
12581
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RemoveDescriptions = exports.RemoveDescriptionsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst fast_xml_parser_1 = __webpack_require__(/*! fast-xml-parser */ \"./node_modules/fast-xml-parser/src/fxp.js\");\r\nconst Objects = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst xml_utils_1 = __webpack_require__(/*! ../xml_utils */ \"./node_modules/@abaplint/core/build/src/xml_utils.js\");\r\nclass RemoveDescriptionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore global exception classes */\r\n this.ignoreExceptions = false;\r\n /** Ignore global workflow classes */\r\n this.ignoreWorkflow = true;\r\n }\r\n}\r\nexports.RemoveDescriptionsConf = RemoveDescriptionsConf;\r\nclass RemoveDescriptions {\r\n constructor() {\r\n this.conf = new RemoveDescriptionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"remove_descriptions\",\r\n title: \"Remove descriptions\",\r\n shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.\r\n\r\nClass descriptions are required, see rule description_empty.\r\n\r\nConsider using ABAP Doc for documentation.`,\r\n tags: [],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n // plan is omitting knowledge about descriptions in abaplint, so this rule must parse the XML\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof Objects.Class) {\r\n let def;\r\n try {\r\n def = obj.getClassDefinition();\r\n }\r\n catch (_a) {\r\n return [];\r\n }\r\n if (def === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(def, obj)) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreWorkflow === true && def.interfaces.find(e => e.name.toUpperCase() === \"IF_WORKFLOW\")) {\r\n return [];\r\n }\r\n return this.checkClass(obj);\r\n }\r\n else if (obj instanceof Objects.Interface) {\r\n return this.checkInterface(obj);\r\n }\r\n return [];\r\n }\r\n //////////////\r\n checkInterface(obj) {\r\n const xml = obj.getXML();\r\n if (xml === undefined) {\r\n return [];\r\n }\r\n const file = obj.getXMLFile();\r\n if (file === undefined) {\r\n return [];\r\n }\r\n return this.checkXML(xml, file);\r\n }\r\n checkClass(obj) {\r\n const xml = obj.getXML();\r\n if (xml === undefined) {\r\n return [];\r\n }\r\n const file = obj.getXMLFile();\r\n if (file === undefined) {\r\n return [];\r\n }\r\n return this.checkXML(xml, file);\r\n }\r\n checkXML(xml, file) {\r\n const parsed = new fast_xml_parser_1.XMLParser({ parseTagValue: false, ignoreAttributes: true, trimValues: false }).parse(xml);\r\n if (parsed === undefined || parsed.abapGit[\"asx:abap\"][\"asx:values\"] === undefined) {\r\n return [];\r\n }\r\n const desc = parsed.abapGit[\"asx:abap\"][\"asx:values\"].DESCRIPTIONS;\r\n if (desc === undefined) {\r\n return [];\r\n }\r\n const ret = [];\r\n for (const d of (0, xml_utils_1.xmlToArray)(desc.SEOCOMPOTX)) {\r\n const message = \"Remove description for \" + d.CMPNAME;\r\n const position = new position_1.Position(1, 1);\r\n const issue = issue_1.Issue.atPosition(file, position, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.RemoveDescriptions = RemoveDescriptions;\r\n//# sourceMappingURL=remove_descriptions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/remove_descriptions.js?");
12582
12582
 
12583
12583
  /***/ }),
12584
12584
 
@@ -12589,7 +12589,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12589
12589
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12590
12590
 
12591
12591
  "use strict";
12592
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RFCErrorHandling = exports.RFCErrorHandlingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass RFCErrorHandlingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.RFCErrorHandlingConf = RFCErrorHandlingConf;\r\nclass RFCErrorHandling extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new RFCErrorHandlingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"rfc_error_handling\",\r\n title: \"RFC error handling\",\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,\r\n badExample: `\nCALL FUNCTION 'ZRFC'\n DESTINATION lv_rfc.`,\r\n goodExample: `\nCALL FUNCTION 'ZRFC'\n DESTINATION lv_rfc\n EXCEPTIONS\n system_failure = 1 MESSAGE msg\n communication_failure = 2 MESSAGE msg\n resource_failure = 3\n OTHERS = 4.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"RFC error handling: At least one unhandled exception from SYSTEM_FAILURE, COMMUNICATION_FAILURE, RESOURCE_FAILURE.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n for (const stat of file.getStatements()) {\r\n const token = stat.getFirstToken();\r\n if (!(stat.get() instanceof Statements.CallFunction)) {\r\n continue;\r\n }\r\n if (!stat.findFirstExpression(Expressions.Destination)) {\r\n continue;\r\n }\r\n const list = stat.findFirstExpression(Expressions.ParameterListExceptions);\r\n if (list === undefined) {\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n continue;\r\n }\r\n const parameters = list.findAllExpressions(Expressions.ParameterName);\r\n const names = [];\r\n for (const par of parameters) {\r\n names.push(par.getFirstToken().getStr().toUpperCase());\r\n }\r\n if (names.indexOf(\"SYSTEM_FAILURE\") < 0\r\n || names.indexOf(\"COMMUNICATION_FAILURE\") < 0\r\n || names.indexOf(\"RESOURCE_FAILURE\") < 0) {\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n continue;\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.RFCErrorHandling = RFCErrorHandling;\r\n//# sourceMappingURL=rfc_error_handling.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/rfc_error_handling.js?");
12592
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RFCErrorHandling = exports.RFCErrorHandlingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass RFCErrorHandlingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.RFCErrorHandlingConf = RFCErrorHandlingConf;\r\nclass RFCErrorHandling extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new RFCErrorHandlingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"rfc_error_handling\",\r\n title: \"RFC error handling\",\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,\r\n badExample: `\r\nCALL FUNCTION 'ZRFC'\r\n DESTINATION lv_rfc.`,\r\n goodExample: `\r\nCALL FUNCTION 'ZRFC'\r\n DESTINATION lv_rfc\r\n EXCEPTIONS\r\n system_failure = 1 MESSAGE msg\r\n communication_failure = 2 MESSAGE msg\r\n resource_failure = 3\r\n OTHERS = 4.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"RFC error handling: At least one unhandled exception from SYSTEM_FAILURE, COMMUNICATION_FAILURE, RESOURCE_FAILURE.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n for (const stat of file.getStatements()) {\r\n const token = stat.getFirstToken();\r\n if (!(stat.get() instanceof Statements.CallFunction)) {\r\n continue;\r\n }\r\n if (!stat.findFirstExpression(Expressions.Destination)) {\r\n continue;\r\n }\r\n const list = stat.findFirstExpression(Expressions.ParameterListExceptions);\r\n if (list === undefined) {\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n continue;\r\n }\r\n const parameters = list.findAllExpressions(Expressions.ParameterName);\r\n const names = [];\r\n for (const par of parameters) {\r\n names.push(par.getFirstToken().getStr().toUpperCase());\r\n }\r\n if (names.indexOf(\"SYSTEM_FAILURE\") < 0\r\n || names.indexOf(\"COMMUNICATION_FAILURE\") < 0\r\n || names.indexOf(\"RESOURCE_FAILURE\") < 0) {\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n continue;\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.RFCErrorHandling = RFCErrorHandling;\r\n//# sourceMappingURL=rfc_error_handling.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/rfc_error_handling.js?");
12593
12593
 
12594
12594
  /***/ }),
12595
12595
 
@@ -12600,7 +12600,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12600
12600
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12601
12601
 
12602
12602
  "use strict";
12603
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectAddOrderBy = exports.SelectAddOrderByConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass SelectAddOrderByConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SelectAddOrderByConf = SelectAddOrderByConf;\r\nclass SelectAddOrderBy {\r\n constructor() {\r\n this.conf = new SelectAddOrderByConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"select_add_order_by\",\r\n title: \"SELECT add ORDER BY\",\r\n shortDescription: `SELECTs add ORDER BY clause`,\r\n extendedInformation: `\nThis will make sure that the SELECT statement returns results in the same sequence on different databases\n\nadd ORDER BY PRIMARY KEY if in doubt\n\nIf the target is a sorted/hashed table, no issue is reported`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n var _a;\r\n const issues = [];\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues;\r\n }\r\n const selects = stru.findAllStatements(Statements.Select);\r\n selects.push(...stru.findAllStatements(Statements.SelectLoop));\r\n for (const s of selects) {\r\n const c = s.concatTokens().toUpperCase();\r\n if (c.startsWith(\"SELECT SINGLE \")) {\r\n continue;\r\n }\r\n // skip COUNT(*)\r\n const list = s.findFirstExpression(Expressions.SQLFieldList);\r\n if ((list === null || list === void 0 ? void 0 : list.getChildren().length) === 1 && ((_a = list.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SQLAggregation) {\r\n continue;\r\n }\r\n else if (s.findFirstExpression(Expressions.SQLOrderBy)) {\r\n continue;\r\n }\r\n if (this.isTargetSortedOrHashed(s, spaghetti, file)) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, s, \"Add ORDER BY\", this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n isTargetSortedOrHashed(s, spaghetti, file) {\r\n var _a, _b;\r\n const target = (_a = s.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.Target);\r\n if (target) {\r\n const start = target.getFirstToken().getStart();\r\n const scope = spaghetti.lookupPosition(start, file.getFilename());\r\n let type = (_b = scope === null || scope === void 0 ? void 0 : scope.findWriteReference(start)) === null || _b === void 0 ? void 0 : _b.getType();\r\n const children = target.getChildren();\r\n if (type instanceof basic_1.StructureType && children.length >= 3 && children[1].concatTokens() === \"-\") {\r\n const found = type.getComponentByName(children[2].concatTokens());\r\n if (found === undefined) {\r\n return false;\r\n }\r\n type = found;\r\n }\r\n if (type instanceof basic_1.TableType\r\n && ((type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.sorted || (type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.hashed)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.SelectAddOrderBy = SelectAddOrderBy;\r\n//# sourceMappingURL=select_add_order_by.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/select_add_order_by.js?");
12603
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectAddOrderBy = exports.SelectAddOrderByConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass SelectAddOrderByConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SelectAddOrderByConf = SelectAddOrderByConf;\r\nclass SelectAddOrderBy {\r\n constructor() {\r\n this.conf = new SelectAddOrderByConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"select_add_order_by\",\r\n title: \"SELECT add ORDER BY\",\r\n shortDescription: `SELECTs add ORDER BY clause`,\r\n extendedInformation: `\r\nThis will make sure that the SELECT statement returns results in the same sequence on different databases\r\n\r\nadd ORDER BY PRIMARY KEY if in doubt\r\n\r\nIf the target is a sorted/hashed table, no issue is reported`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n var _a;\r\n const issues = [];\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues;\r\n }\r\n const selects = stru.findAllStatements(Statements.Select);\r\n selects.push(...stru.findAllStatements(Statements.SelectLoop));\r\n for (const s of selects) {\r\n const c = s.concatTokens().toUpperCase();\r\n if (c.startsWith(\"SELECT SINGLE \")) {\r\n continue;\r\n }\r\n // skip COUNT(*)\r\n const list = s.findFirstExpression(Expressions.SQLFieldList);\r\n if ((list === null || list === void 0 ? void 0 : list.getChildren().length) === 1 && ((_a = list.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SQLAggregation) {\r\n continue;\r\n }\r\n else if (s.findFirstExpression(Expressions.SQLOrderBy)) {\r\n continue;\r\n }\r\n if (this.isTargetSortedOrHashed(s, spaghetti, file)) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, s, \"Add ORDER BY\", this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n isTargetSortedOrHashed(s, spaghetti, file) {\r\n var _a, _b;\r\n const target = (_a = s.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.Target);\r\n if (target) {\r\n const start = target.getFirstToken().getStart();\r\n const scope = spaghetti.lookupPosition(start, file.getFilename());\r\n let type = (_b = scope === null || scope === void 0 ? void 0 : scope.findWriteReference(start)) === null || _b === void 0 ? void 0 : _b.getType();\r\n const children = target.getChildren();\r\n if (type instanceof basic_1.StructureType && children.length >= 3 && children[1].concatTokens() === \"-\") {\r\n const found = type.getComponentByName(children[2].concatTokens());\r\n if (found === undefined) {\r\n return false;\r\n }\r\n type = found;\r\n }\r\n if (type instanceof basic_1.TableType\r\n && ((type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.sorted || (type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.hashed)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.SelectAddOrderBy = SelectAddOrderBy;\r\n//# sourceMappingURL=select_add_order_by.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/select_add_order_by.js?");
12604
12604
 
12605
12605
  /***/ }),
12606
12606
 
@@ -12611,7 +12611,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12611
12611
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12612
12612
 
12613
12613
  "use strict";
12614
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectPerformance = exports.SelectPerformanceConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst structure_type_1 = __webpack_require__(/*! ../abap/types/basic/structure_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/structure_type.js\");\r\nconst DEFAULT_COLUMNS = 10;\r\nclass SelectPerformanceConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects ENDSELECT */\r\n this.endSelect = true;\r\n /** Detects SELECT * */\r\n this.selectStar = true;\r\n /** \"SELECT\" * is considered okay if the table is less than X columns, the table must be known to the linter */\r\n this.starOkayIfFewColumns = DEFAULT_COLUMNS;\r\n }\r\n}\r\nexports.SelectPerformanceConf = SelectPerformanceConf;\r\nclass SelectPerformance {\r\n constructor() {\r\n this.conf = new SelectPerformanceConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"select_performance\",\r\n title: \"SELECT performance\",\r\n shortDescription: `Various checks regarding SELECT performance.`,\r\n extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE\n\nSELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],\r\n badExample: `SELECT field1, field2 FROM table\n INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.\nENDSELECT.`,\r\n goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS\n INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n if (this.conf.starOkayIfFewColumns === undefined) {\r\n this.conf.starOkayIfFewColumns = DEFAULT_COLUMNS;\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const issues = [];\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues;\r\n }\r\n if (this.conf.endSelect) {\r\n for (const s of stru.findAllStructures(Structures.Select) || []) {\r\n const select = s.findDirectStatement(Statements.SelectLoop);\r\n if (select === undefined || select.concatTokens().toUpperCase().includes(\"PACKAGE SIZE\")) {\r\n continue;\r\n }\r\n const message = \"Avoid use of ENDSELECT\";\r\n issues.push(issue_1.Issue.atStatement(file, select, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n if (this.conf.selectStar) {\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n const selects = stru.findAllStatements(Statements.Select);\r\n selects.push(...stru.findAllStatements(Statements.SelectLoop));\r\n for (const s of selects) {\r\n const concat = s.concatTokens().toUpperCase();\r\n if (concat.startsWith(\"SELECT * \") === false\r\n && concat.startsWith(\"SELECT SINGLE * \") === false) {\r\n continue;\r\n }\r\n else if (concat.includes(\" INTO CORRESPONDING FIELDS OF \")\r\n || concat.includes(\" APPENDING CORRESPONDING FIELDS OF \")) {\r\n continue;\r\n }\r\n const columnCount = this.findNumberOfColumns(s, file, spaghetti);\r\n if (columnCount\r\n && columnCount <= this.getConfig().starOkayIfFewColumns) {\r\n continue;\r\n }\r\n const message = \"Avoid use of SELECT *\";\r\n issues.push(issue_1.Issue.atToken(file, s.getFirstToken(), message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n findNumberOfColumns(s, file, spaghetti) {\r\n const dbnames = s.findAllExpressions(Expressions.DatabaseTable);\r\n if (dbnames.length === 1) {\r\n const start = dbnames[0].getFirstToken().getStart();\r\n const scope = spaghetti.lookupPosition(start, file.getFilename());\r\n const name = scope === null || scope === void 0 ? void 0 : scope.findTableReference(start);\r\n const tabl = this.reg.getObject(\"TABL\", name);\r\n const parsed = tabl === null || tabl === void 0 ? void 0 : tabl.parseType(this.reg);\r\n if (parsed instanceof structure_type_1.StructureType) {\r\n return parsed.getComponents().length;\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.SelectPerformance = SelectPerformance;\r\n//# sourceMappingURL=select_performance.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/select_performance.js?");
12614
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectPerformance = exports.SelectPerformanceConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst structure_type_1 = __webpack_require__(/*! ../abap/types/basic/structure_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/structure_type.js\");\r\nconst DEFAULT_COLUMNS = 10;\r\nclass SelectPerformanceConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects ENDSELECT */\r\n this.endSelect = true;\r\n /** Detects SELECT * */\r\n this.selectStar = true;\r\n /** \"SELECT\" * is considered okay if the table is less than X columns, the table must be known to the linter */\r\n this.starOkayIfFewColumns = DEFAULT_COLUMNS;\r\n }\r\n}\r\nexports.SelectPerformanceConf = SelectPerformanceConf;\r\nclass SelectPerformance {\r\n constructor() {\r\n this.conf = new SelectPerformanceConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"select_performance\",\r\n title: \"SELECT performance\",\r\n shortDescription: `Various checks regarding SELECT performance.`,\r\n extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE\r\n\r\nSELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],\r\n badExample: `SELECT field1, field2 FROM table\r\n INTO @DATA(structure) UP TO 1 ROWS ORDER BY field3 DESCENDING.\r\nENDSELECT.`,\r\n goodExample: `SELECT field1, field2 FROM table UP TO 1 ROWS\r\n INTO TABLE @DATA(table) ORDER BY field3 DESCENDING`,\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n if (this.conf.starOkayIfFewColumns === undefined) {\r\n this.conf.starOkayIfFewColumns = DEFAULT_COLUMNS;\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const issues = [];\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues;\r\n }\r\n if (this.conf.endSelect) {\r\n for (const s of stru.findAllStructures(Structures.Select) || []) {\r\n const select = s.findDirectStatement(Statements.SelectLoop);\r\n if (select === undefined || select.concatTokens().toUpperCase().includes(\"PACKAGE SIZE\")) {\r\n continue;\r\n }\r\n const message = \"Avoid use of ENDSELECT\";\r\n issues.push(issue_1.Issue.atStatement(file, select, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n if (this.conf.selectStar) {\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n const selects = stru.findAllStatements(Statements.Select);\r\n selects.push(...stru.findAllStatements(Statements.SelectLoop));\r\n for (const s of selects) {\r\n const concat = s.concatTokens().toUpperCase();\r\n if (concat.startsWith(\"SELECT * \") === false\r\n && concat.startsWith(\"SELECT SINGLE * \") === false) {\r\n continue;\r\n }\r\n else if (concat.includes(\" INTO CORRESPONDING FIELDS OF \")\r\n || concat.includes(\" APPENDING CORRESPONDING FIELDS OF \")) {\r\n continue;\r\n }\r\n const columnCount = this.findNumberOfColumns(s, file, spaghetti);\r\n if (columnCount\r\n && columnCount <= this.getConfig().starOkayIfFewColumns) {\r\n continue;\r\n }\r\n const message = \"Avoid use of SELECT *\";\r\n issues.push(issue_1.Issue.atToken(file, s.getFirstToken(), message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n findNumberOfColumns(s, file, spaghetti) {\r\n const dbnames = s.findAllExpressions(Expressions.DatabaseTable);\r\n if (dbnames.length === 1) {\r\n const start = dbnames[0].getFirstToken().getStart();\r\n const scope = spaghetti.lookupPosition(start, file.getFilename());\r\n const name = scope === null || scope === void 0 ? void 0 : scope.findTableReference(start);\r\n const tabl = this.reg.getObject(\"TABL\", name);\r\n const parsed = tabl === null || tabl === void 0 ? void 0 : tabl.parseType(this.reg);\r\n if (parsed instanceof structure_type_1.StructureType) {\r\n return parsed.getComponents().length;\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.SelectPerformance = SelectPerformance;\r\n//# sourceMappingURL=select_performance.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/select_performance.js?");
12615
12615
 
12616
12616
  /***/ }),
12617
12617
 
@@ -12655,7 +12655,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12655
12655
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12656
12656
 
12657
12657
  "use strict";
12658
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SICFConsistency = exports.SICFConsistencyConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass SICFConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SICFConsistencyConf = SICFConsistencyConf;\r\nclass SICFConsistency {\r\n constructor() {\r\n this.conf = new SICFConsistencyConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"sicf_consistency\",\r\n title: \"SICF consistency\",\r\n shortDescription: `Checks the validity of ICF services`,\r\n extendedInformation: `* Class defined in handler must exist\n* Class must not have any syntax errors\n* Class must implement interface IF_HTTP_EXTENSION`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n const issues = [];\r\n if (!(obj instanceof objects_1.ICFService)) {\r\n return [];\r\n }\r\n const handlers = obj.getHandlerList();\r\n if (handlers === undefined) {\r\n return [];\r\n }\r\n for (const h of handlers) {\r\n const clas = this.reg.getObject(\"CLAS\", h);\r\n if (clas === undefined) {\r\n const pattern = new RegExp(this.reg.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\r\n if (pattern.test(h) === true) {\r\n const message = \"Handler class \" + h + \" not found\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n continue;\r\n }\r\n const def = clas.getClassDefinition();\r\n if (def === undefined) {\r\n const message = \"Syntax error in class \" + h;\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n const implementing = this.findImplementing(def);\r\n if (implementing.findIndex((i) => { return i.name.toUpperCase() === \"IF_HTTP_EXTENSION\"; }) < 0) {\r\n const message = \"Handler class \" + h + \" must implement IF_HTTP_EXTENSION\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////////////\r\n findImplementing(def) {\r\n let ret = def.interfaces;\r\n let superName = def.superClassName;\r\n while (superName !== undefined) {\r\n const clas = this.reg.getObject(\"CLAS\", superName);\r\n if (clas === undefined) {\r\n break;\r\n }\r\n const superDef = clas.getClassDefinition();\r\n if (superDef === undefined) {\r\n break;\r\n }\r\n ret = ret.concat(superDef.interfaces);\r\n superName = superDef.superClassName;\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.SICFConsistency = SICFConsistency;\r\n//# sourceMappingURL=sicf_consistency.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/sicf_consistency.js?");
12658
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SICFConsistency = exports.SICFConsistencyConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass SICFConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SICFConsistencyConf = SICFConsistencyConf;\r\nclass SICFConsistency {\r\n constructor() {\r\n this.conf = new SICFConsistencyConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"sicf_consistency\",\r\n title: \"SICF consistency\",\r\n shortDescription: `Checks the validity of ICF services`,\r\n extendedInformation: `* Class defined in handler must exist\r\n* Class must not have any syntax errors\r\n* Class must implement interface IF_HTTP_EXTENSION`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n const issues = [];\r\n if (!(obj instanceof objects_1.ICFService)) {\r\n return [];\r\n }\r\n const handlers = obj.getHandlerList();\r\n if (handlers === undefined) {\r\n return [];\r\n }\r\n for (const h of handlers) {\r\n const clas = this.reg.getObject(\"CLAS\", h);\r\n if (clas === undefined) {\r\n const pattern = new RegExp(this.reg.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\r\n if (pattern.test(h) === true) {\r\n const message = \"Handler class \" + h + \" not found\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n continue;\r\n }\r\n const def = clas.getClassDefinition();\r\n if (def === undefined) {\r\n const message = \"Syntax error in class \" + h;\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n const implementing = this.findImplementing(def);\r\n if (implementing.findIndex((i) => { return i.name.toUpperCase() === \"IF_HTTP_EXTENSION\"; }) < 0) {\r\n const message = \"Handler class \" + h + \" must implement IF_HTTP_EXTENSION\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////////////\r\n findImplementing(def) {\r\n let ret = def.interfaces;\r\n let superName = def.superClassName;\r\n while (superName !== undefined) {\r\n const clas = this.reg.getObject(\"CLAS\", superName);\r\n if (clas === undefined) {\r\n break;\r\n }\r\n const superDef = clas.getClassDefinition();\r\n if (superDef === undefined) {\r\n break;\r\n }\r\n ret = ret.concat(superDef.interfaces);\r\n superName = superDef.superClassName;\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.SICFConsistency = SICFConsistency;\r\n//# sourceMappingURL=sicf_consistency.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/sicf_consistency.js?");
12659
12659
 
12660
12660
  /***/ }),
12661
12661
 
@@ -12688,7 +12688,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12688
12688
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12689
12689
 
12690
12690
  "use strict";
12691
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SpaceBeforeDot = exports.SpaceBeforeDotConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass SpaceBeforeDotConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.ignoreGlobalDefinition = true;\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.SpaceBeforeDotConf = SpaceBeforeDotConf;\r\nclass SpaceBeforeDot extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new SpaceBeforeDotConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"space_before_dot\",\r\n title: \"Space before dot\",\r\n shortDescription: `Checks for extra spaces before dots at the ends of statements`,\r\n extendedInformation: `\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `WRITE bar .`,\r\n goodExample: `WRITE bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Remove space before \\\",\\\" or \\\".\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n let prev = undefined;\r\n let startRow = 0;\r\n if (file.getStructure() === undefined) {\r\n // some parser error exists in file\r\n return [];\r\n }\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (this.conf.ignoreGlobalDefinition) {\r\n const structure = file.getStructure();\r\n if (obj instanceof objects_1.Class && structure !== undefined) {\r\n const endclass = structure.findFirstStatement(Statements.EndClass);\r\n if (endclass !== undefined) {\r\n startRow = endclass.getFirstToken().getRow();\r\n }\r\n const definition = obj.getClassDefinition();\r\n if (definition !== undefined && this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n else if (obj instanceof objects_1.Interface && structure !== undefined) {\r\n const endinterface = structure.findFirstStatement(Statements.EndInterface);\r\n if (endinterface !== undefined) {\r\n startRow = endinterface.getFirstToken().getRow();\r\n }\r\n }\r\n }\r\n for (const t of file.getTokens()) {\r\n if (t.getRow() < startRow) {\r\n continue;\r\n }\r\n if (prev !== undefined && t instanceof tokens_1.Punctuation && prev.getCol() + prev.getStr().length < t.getCol()) {\r\n const start = new position_1.Position(t.getStart().getRow(), prev.getEnd().getCol());\r\n const end = new position_1.Position(t.getStart().getRow(), t.getStart().getCol());\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, start, end);\r\n const issue = issue_1.Issue.atRange(file, start, end, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = t;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.SpaceBeforeDot = SpaceBeforeDot;\r\n//# sourceMappingURL=space_before_dot.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/space_before_dot.js?");
12691
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SpaceBeforeDot = exports.SpaceBeforeDotConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass SpaceBeforeDotConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.ignoreGlobalDefinition = true;\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.SpaceBeforeDotConf = SpaceBeforeDotConf;\r\nclass SpaceBeforeDot extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new SpaceBeforeDotConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"space_before_dot\",\r\n title: \"Space before dot\",\r\n shortDescription: `Checks for extra spaces before dots at the ends of statements`,\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `WRITE bar .`,\r\n goodExample: `WRITE bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Remove space before \\\",\\\" or \\\".\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n let prev = undefined;\r\n let startRow = 0;\r\n if (file.getStructure() === undefined) {\r\n // some parser error exists in file\r\n return [];\r\n }\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (this.conf.ignoreGlobalDefinition) {\r\n const structure = file.getStructure();\r\n if (obj instanceof objects_1.Class && structure !== undefined) {\r\n const endclass = structure.findFirstStatement(Statements.EndClass);\r\n if (endclass !== undefined) {\r\n startRow = endclass.getFirstToken().getRow();\r\n }\r\n const definition = obj.getClassDefinition();\r\n if (definition !== undefined && this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n else if (obj instanceof objects_1.Interface && structure !== undefined) {\r\n const endinterface = structure.findFirstStatement(Statements.EndInterface);\r\n if (endinterface !== undefined) {\r\n startRow = endinterface.getFirstToken().getRow();\r\n }\r\n }\r\n }\r\n for (const t of file.getTokens()) {\r\n if (t.getRow() < startRow) {\r\n continue;\r\n }\r\n if (prev !== undefined && t instanceof tokens_1.Punctuation && prev.getCol() + prev.getStr().length < t.getCol()) {\r\n const start = new position_1.Position(t.getStart().getRow(), prev.getEnd().getCol());\r\n const end = new position_1.Position(t.getStart().getRow(), t.getStart().getCol());\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, start, end);\r\n const issue = issue_1.Issue.atRange(file, start, end, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = t;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.SpaceBeforeDot = SpaceBeforeDot;\r\n//# sourceMappingURL=space_before_dot.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/space_before_dot.js?");
12692
12692
 
12693
12693
  /***/ }),
12694
12694
 
@@ -12710,7 +12710,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12710
12710
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12711
12711
 
12712
12712
  "use strict";
12713
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.StartAtTab = exports.StartAtTabConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass StartAtTabConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.StartAtTabConf = StartAtTabConf;\r\nclass StartAtTab extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new StartAtTabConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"start_at_tab\",\r\n title: \"Start at tab\",\r\n shortDescription: `Checks that statements start at tabstops.`,\r\n extendedInformation: `Reports max 100 issues per file\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: ` WRITE a.`,\r\n goodExample: ` WRITE a.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Start statement at tab position\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let inType = false;\r\n let previous = undefined;\r\n const raw = file.getRawRows();\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.get() instanceof statements_1.TypeBegin) {\r\n inType = true;\r\n }\r\n else if (statement.get() instanceof statements_1.TypeEnd) {\r\n inType = false;\r\n }\r\n else if (inType) {\r\n continue;\r\n }\r\n const pos = statement.getStart();\r\n if (previous !== undefined && pos.getRow() === previous.getRow()) {\r\n continue;\r\n }\r\n // just skip rows that contains tabs, this will be reported by the contains_tab rule\r\n if ((pos.getCol() - 1) % 2 !== 0 && raw[pos.getRow() - 1].includes(\"\\t\") === false) {\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n if (issues.length >= 100) {\r\n return issues; // only max 100 issues perfile\r\n }\r\n }\r\n previous = pos;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.StartAtTab = StartAtTab;\r\n//# sourceMappingURL=start_at_tab.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/start_at_tab.js?");
12713
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.StartAtTab = exports.StartAtTabConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass StartAtTabConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.StartAtTabConf = StartAtTabConf;\r\nclass StartAtTab extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new StartAtTabConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"start_at_tab\",\r\n title: \"Start at tab\",\r\n shortDescription: `Checks that statements start at tabstops.`,\r\n extendedInformation: `Reports max 100 issues per file\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: ` WRITE a.`,\r\n goodExample: ` WRITE a.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Start statement at tab position\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let inType = false;\r\n let previous = undefined;\r\n const raw = file.getRawRows();\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.get() instanceof statements_1.TypeBegin) {\r\n inType = true;\r\n }\r\n else if (statement.get() instanceof statements_1.TypeEnd) {\r\n inType = false;\r\n }\r\n else if (inType) {\r\n continue;\r\n }\r\n const pos = statement.getStart();\r\n if (previous !== undefined && pos.getRow() === previous.getRow()) {\r\n continue;\r\n }\r\n // just skip rows that contains tabs, this will be reported by the contains_tab rule\r\n if ((pos.getCol() - 1) % 2 !== 0 && raw[pos.getRow() - 1].includes(\"\\t\") === false) {\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n if (issues.length >= 100) {\r\n return issues; // only max 100 issues perfile\r\n }\r\n }\r\n previous = pos;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.StartAtTab = StartAtTab;\r\n//# sourceMappingURL=start_at_tab.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/start_at_tab.js?");
12714
12714
 
12715
12715
  /***/ }),
12716
12716
 
@@ -12754,7 +12754,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12754
12754
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12755
12755
 
12756
12756
  "use strict";
12757
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SyModification = exports.SyModificationConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass SyModificationConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SyModificationConf = SyModificationConf;\r\nclass SyModification extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new SyModificationConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"sy_modification\",\r\n title: \"Modification of SY fields\",\r\n shortDescription: `Finds modification of sy fields`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `\nsy-uname = 2.\nsy = sy.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a;\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const t of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Target)) || []) {\r\n const firstChild = t.getChildren()[0];\r\n if (firstChild.get() instanceof Expressions.TargetField\r\n && firstChild.getFirstToken().getStr().toUpperCase() === \"SY\") {\r\n const message = \"Modification of SY field\";\r\n const issue = issue_1.Issue.atToken(file, firstChild.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.SyModification = SyModification;\r\n//# sourceMappingURL=sy_modification.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/sy_modification.js?");
12757
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SyModification = exports.SyModificationConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass SyModificationConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SyModificationConf = SyModificationConf;\r\nclass SyModification extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new SyModificationConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"sy_modification\",\r\n title: \"Modification of SY fields\",\r\n shortDescription: `Finds modification of sy fields`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `\r\nsy-uname = 2.\r\nsy = sy.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a;\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const t of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Target)) || []) {\r\n const firstChild = t.getChildren()[0];\r\n if (firstChild.get() instanceof Expressions.TargetField\r\n && firstChild.getFirstToken().getStr().toUpperCase() === \"SY\") {\r\n const message = \"Modification of SY field\";\r\n const issue = issue_1.Issue.atToken(file, firstChild.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.SyModification = SyModification;\r\n//# sourceMappingURL=sy_modification.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/sy_modification.js?");
12758
12758
 
12759
12759
  /***/ }),
12760
12760
 
@@ -12765,7 +12765,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12765
12765
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12766
12766
 
12767
12767
  "use strict";
12768
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TABLEnhancementCategory = exports.TABLEnhancementCategoryConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass TABLEnhancementCategoryConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.TABLEnhancementCategoryConf = TABLEnhancementCategoryConf;\r\nclass TABLEnhancementCategory {\r\n constructor() {\r\n this.conf = new TABLEnhancementCategoryConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"tabl_enhancement_category\",\r\n title: \"TABL enhancement category must be set\",\r\n shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,\r\n extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.\n\nYou may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,\r\n tags: [],\r\n };\r\n }\r\n getDescription(name) {\r\n return \"TABL enhancement category not classified in \" + name;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof objects_1.Table)) {\r\n return [];\r\n }\r\n if (obj.getEnhancementCategory() === objects_1.EnhancementCategory.NotClassified) {\r\n const position = new position_1.Position(1, 1);\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, this.getDescription(obj.getName()), this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.TABLEnhancementCategory = TABLEnhancementCategory;\r\n//# sourceMappingURL=tabl_enhancement_category.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/tabl_enhancement_category.js?");
12768
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TABLEnhancementCategory = exports.TABLEnhancementCategoryConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass TABLEnhancementCategoryConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.TABLEnhancementCategoryConf = TABLEnhancementCategoryConf;\r\nclass TABLEnhancementCategory {\r\n constructor() {\r\n this.conf = new TABLEnhancementCategoryConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"tabl_enhancement_category\",\r\n title: \"TABL enhancement category must be set\",\r\n shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,\r\n extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.\r\n\r\nYou may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,\r\n tags: [],\r\n };\r\n }\r\n getDescription(name) {\r\n return \"TABL enhancement category not classified in \" + name;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof objects_1.Table)) {\r\n return [];\r\n }\r\n if (obj.getEnhancementCategory() === objects_1.EnhancementCategory.NotClassified) {\r\n const position = new position_1.Position(1, 1);\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, this.getDescription(obj.getName()), this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.TABLEnhancementCategory = TABLEnhancementCategory;\r\n//# sourceMappingURL=tabl_enhancement_category.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/tabl_enhancement_category.js?");
12769
12769
 
12770
12770
  /***/ }),
12771
12771
 
@@ -12820,7 +12820,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12820
12820
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12821
12821
 
12822
12822
  "use strict";
12823
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnknownTypes = exports.UnknownTypesConf = void 0;\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst BasicTypes = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass UnknownTypesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnknownTypesConf = UnknownTypesConf;\r\nclass UnknownTypes {\r\n constructor() {\r\n this.conf = new UnknownTypesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unknown_types\",\r\n title: \"Unknown types\",\r\n shortDescription: `Enables check for unknown data types, respects errorNamespace`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n const found = this.traverse(spaghetti.getTop());\r\n return this.removeDuplicates(found);\r\n }\r\n /////////////////////\r\n removeDuplicates(list) {\r\n const deduplicated = [];\r\n for (const result of list) {\r\n let cont = false;\r\n for (const d of deduplicated) {\r\n if (result.getStart().equals(d.getStart())) {\r\n cont = true;\r\n break;\r\n }\r\n }\r\n if (cont === true) {\r\n continue;\r\n }\r\n deduplicated.push(result);\r\n }\r\n return deduplicated;\r\n }\r\n traverse(node) {\r\n var _a;\r\n const ret = [];\r\n const nodeData = node.getData();\r\n for (const r of nodeData.references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedUnknownReference && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName)) {\r\n const message = r.extra.ooName + \" unknown\";\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n if (r.referenceType === _reference_1.ReferenceType.TypeReference\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier\r\n && r.resolved.getType() instanceof basic_1.UnknownType) {\r\n const message = r.resolved.getType().getError();\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.ClassImplementation) {\r\n const vars = nodeData.vars;\r\n for (const name in vars) {\r\n const identifier = vars[name];\r\n const found = this.containsUnknown(identifier.getType());\r\n if (found) {\r\n const message = \"Variable \\\"\" + name + \"\\\" contains unknown: \" + found;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n const types = nodeData.types;\r\n for (const name in types) {\r\n const identifier = types[name];\r\n const found = this.containsUnknown(identifier.getType());\r\n if (found) {\r\n const message = \"Type \\\"\" + name + \"\\\" contains unknown: \" + found;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n for (const v of nodeData.idefs) {\r\n const found = this.checkMethodParameters(v);\r\n if (found) {\r\n const message = \"Contains unknown, \" + found.found;\r\n ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const name in nodeData.cdefs) {\r\n const v = nodeData.cdefs[name];\r\n const found = this.checkMethodParameters(v);\r\n if (found) {\r\n const message = \"Contains unknown, \" + found.found;\r\n ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const n of node.getChildren()) {\r\n ret.push(...this.traverse(n));\r\n }\r\n return ret;\r\n }\r\n checkMethodParameters(idef) {\r\n var _a;\r\n for (const m of ((_a = idef.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {\r\n for (const p of m.getParameters().getAll()) {\r\n const found = this.containsUnknown(p.getType());\r\n if (found) {\r\n return { id: p, found };\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n containsUnknown(type) {\r\n if (type instanceof BasicTypes.UnknownType) {\r\n return type.getError();\r\n }\r\n else if (type instanceof BasicTypes.StructureType) {\r\n for (const c of type.getComponents()) {\r\n const found = this.containsUnknown(c.type instanceof _typed_identifier_1.TypedIdentifier ? c.type.getType() : c.type);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n }\r\n else if (type instanceof BasicTypes.TableType) {\r\n return this.containsUnknown(type.getRowType());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnknownTypes = UnknownTypes;\r\n//# sourceMappingURL=unknown_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unknown_types.js?");
12823
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnknownTypes = exports.UnknownTypesConf = void 0;\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst BasicTypes = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass UnknownTypesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnknownTypesConf = UnknownTypesConf;\r\nclass UnknownTypes {\r\n constructor() {\r\n this.conf = new UnknownTypesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unknown_types\",\r\n title: \"Unknown types\",\r\n shortDescription: `Enables check for unknown data types, respects errorNamespace`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n const found = this.traverse(spaghetti.getTop());\r\n return this.removeDuplicates(found);\r\n }\r\n /////////////////////\r\n removeDuplicates(list) {\r\n const deduplicated = [];\r\n for (const result of list) {\r\n let cont = false;\r\n for (const d of deduplicated) {\r\n if (result.getStart().equals(d.getStart())) {\r\n cont = true;\r\n break;\r\n }\r\n }\r\n if (cont === true) {\r\n continue;\r\n }\r\n deduplicated.push(result);\r\n }\r\n return deduplicated;\r\n }\r\n traverse(node) {\r\n var _a;\r\n const ret = [];\r\n const nodeData = node.getData();\r\n for (const r of nodeData.references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedUnknownReference && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName)) {\r\n const message = r.extra.ooName + \" unknown\";\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n if (r.referenceType === _reference_1.ReferenceType.TypeReference\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier\r\n && r.resolved.getType() instanceof basic_1.UnknownType) {\r\n const message = r.resolved.getType().getError();\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.ClassImplementation) {\r\n const vars = nodeData.vars;\r\n for (const name in vars) {\r\n const identifier = vars[name];\r\n const found = this.containsUnknown(identifier.getType());\r\n if (found) {\r\n const message = \"Variable \\\"\" + name + \"\\\" contains unknown: \" + found;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n const types = nodeData.types;\r\n for (const name in types) {\r\n const identifier = types[name];\r\n const found = this.containsUnknown(identifier.getType());\r\n if (found) {\r\n const message = \"Type \\\"\" + name + \"\\\" contains unknown: \" + found;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n for (const v of nodeData.idefs) {\r\n const found = this.checkParameters(v);\r\n if (found) {\r\n const message = \"Contains unknown, \" + found.found;\r\n ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const name in nodeData.cdefs) {\r\n const v = nodeData.cdefs[name];\r\n const found = this.checkParameters(v);\r\n if (found) {\r\n const message = \"Contains unknown, \" + found.found;\r\n ret.push(issue_1.Issue.atIdentifier(found.id, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const n of node.getChildren()) {\r\n ret.push(...this.traverse(n));\r\n }\r\n return ret;\r\n }\r\n checkParameters(idef) {\r\n var _a;\r\n for (const m of ((_a = idef.getMethodDefinitions()) === null || _a === void 0 ? void 0 : _a.getAll()) || []) {\r\n for (const p of m.getParameters().getAll()) {\r\n const found = this.containsUnknown(p.getType());\r\n if (found) {\r\n return { id: p, found };\r\n }\r\n }\r\n }\r\n for (const e of idef.getEvents() || []) {\r\n for (const p of e.getParameters()) {\r\n const found = this.containsUnknown(p.getType());\r\n if (found) {\r\n return { id: p, found };\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n containsUnknown(type) {\r\n if (type instanceof BasicTypes.UnknownType) {\r\n return type.getError();\r\n }\r\n else if (type instanceof BasicTypes.StructureType) {\r\n for (const c of type.getComponents()) {\r\n const found = this.containsUnknown(c.type instanceof _typed_identifier_1.TypedIdentifier ? c.type.getType() : c.type);\r\n if (found) {\r\n return found;\r\n }\r\n }\r\n }\r\n else if (type instanceof BasicTypes.TableType) {\r\n return this.containsUnknown(type.getRowType());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnknownTypes = UnknownTypes;\r\n//# sourceMappingURL=unknown_types.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unknown_types.js?");
12824
12824
 
12825
12825
  /***/ }),
12826
12826
 
@@ -12842,7 +12842,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12842
12842
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12843
12843
 
12844
12844
  "use strict";
12845
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnnecessaryPragma = exports.UnnecessaryPragmaConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass UnnecessaryPragmaConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnnecessaryPragmaConf = UnnecessaryPragmaConf;\r\nclass UnnecessaryPragma extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UnnecessaryPragmaConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unnecessary_pragma\",\r\n title: \"Unnecessary Pragma\",\r\n shortDescription: `Finds pragmas which can be removed`,\r\n extendedInformation: `* NO_HANDLER with handler\n\n* NEEDED without definition\n\n* NO_TEXT without texts\n\n* SUBRC_OK where sy-subrc is checked`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `TRY.\n ...\n CATCH zcx_abapgit_exception ##NO_HANDLER.\n RETURN. \" it has a handler\nENDTRY.\nMESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.\nSELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.\nIF sy-subrc <> 0.\nENDIF.`,\r\n goodExample: `TRY.\n ...\n CATCH zcx_abapgit_exception.\n RETURN.\nENDTRY.\nMESSAGE w125(zbar) WITH c_foo INTO message.\nSELECT SINGLE * FROM tadir INTO @DATA(sdfs).\nIF sy-subrc <> 0.\nENDIF.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let noHandler = false;\r\n const statements = file.getStatements();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n const nextStatement = statements[i + 1];\r\n if (statement.get() instanceof Statements.EndTry) {\r\n noHandler = false;\r\n }\r\n else if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (noHandler === true && !(statement.get() instanceof Statements.Catch)) {\r\n const message = \"NO_HANDLER pragma or pseudo comment can be removed\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n noHandler = false;\r\n }\r\n else {\r\n noHandler = this.containsNoHandler(statement, statements[i + 1]);\r\n }\r\n issues.push(...this.checkText(statement, file));\r\n issues.push(...this.checkNeeded(statement, file));\r\n issues.push(...this.checkSubrc(statement, nextStatement, file));\r\n }\r\n return issues;\r\n }\r\n checkText(statement, file) {\r\n const p = statement.getPragmas().find(t => t.getStr().toUpperCase() === \"##NO_TEXT\");\r\n if (p === undefined) {\r\n return [];\r\n }\r\n if (statement.findFirstExpression(Expressions.ConstantString) === undefined\r\n && statement.findFirstExpression(Expressions.StringTemplate) === undefined) {\r\n const message = \"There is no text, NO_TEXT can be removed\";\r\n return [issue_1.Issue.atToken(file, p, message, this.getMetadata().key, this.getConfig().severity)];\r\n }\r\n return [];\r\n }\r\n checkSubrc(statement, next, file) {\r\n const p = statement.getPragmas().find(t => t.getStr().toUpperCase() === \"##SUBRC_OK\");\r\n if (p === undefined) {\r\n return [];\r\n }\r\n const concat = next.concatTokens().toUpperCase();\r\n if (concat.includes(\" SY-SUBRC\")) {\r\n const message = \"SUBRC_OK can be removed as sy-subrc is checked\";\r\n return [issue_1.Issue.atToken(file, p, message, this.getMetadata().key, this.getConfig().severity)];\r\n }\r\n return [];\r\n }\r\n checkNeeded(statement, file) {\r\n const p = statement.getPragmas().find(t => t.getStr().toUpperCase() === \"##NEEDED\");\r\n if (p === undefined) {\r\n return [];\r\n }\r\n if (statement.findFirstExpression(Expressions.InlineData) === undefined\r\n && !(statement.get() instanceof Statements.Parameter)\r\n && !(statement.get() instanceof Statements.Data)\r\n && !(statement.get() instanceof Statements.DataEnd)\r\n && !(statement.get() instanceof Statements.Type)\r\n && !(statement.get() instanceof Statements.TypeEnd)\r\n && !(statement.get() instanceof Statements.Constant)\r\n && !(statement.get() instanceof Statements.ConstantEnd)\r\n && !(statement.get() instanceof Statements.TypeEnum)\r\n && !(statement.get() instanceof Statements.TypeEnumEnd)\r\n && !(statement.get() instanceof Statements.MethodImplementation)\r\n && !(statement.get() instanceof Statements.MethodDef)\r\n && statement.findFirstExpression(Expressions.InlineFS) === undefined) {\r\n const message = \"There is no data definition, NEEDED can be removed\";\r\n return [issue_1.Issue.atToken(file, p, message, this.getMetadata().key, this.getConfig().severity)];\r\n }\r\n return [];\r\n }\r\n containsNoHandler(statement, next) {\r\n for (const t of statement.getPragmas()) {\r\n if (t.getStr().toUpperCase() === \"##NO_HANDLER\") {\r\n return true;\r\n }\r\n }\r\n if (next\r\n && next.get() instanceof _statement_1.Comment\r\n && next.concatTokens().toUpperCase().includes(\"#EC NO_HANDLER\")) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\nexports.UnnecessaryPragma = UnnecessaryPragma;\r\n//# sourceMappingURL=unnecessary_pragma.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unnecessary_pragma.js?");
12845
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnnecessaryPragma = exports.UnnecessaryPragmaConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass UnnecessaryPragmaConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnnecessaryPragmaConf = UnnecessaryPragmaConf;\r\nclass UnnecessaryPragma extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UnnecessaryPragmaConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unnecessary_pragma\",\r\n title: \"Unnecessary Pragma\",\r\n shortDescription: `Finds pragmas which can be removed`,\r\n extendedInformation: `* NO_HANDLER with handler\r\n\r\n* NEEDED without definition\r\n\r\n* NO_TEXT without texts\r\n\r\n* SUBRC_OK where sy-subrc is checked`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `TRY.\r\n ...\r\n CATCH zcx_abapgit_exception ##NO_HANDLER.\r\n RETURN. \" it has a handler\r\nENDTRY.\r\nMESSAGE w125(zbar) WITH c_foo INTO message ##NEEDED ##NO_TEXT.\r\nSELECT SINGLE * FROM tadir INTO @DATA(sdfs) ##SUBRC_OK.\r\nIF sy-subrc <> 0.\r\nENDIF.`,\r\n goodExample: `TRY.\r\n ...\r\n CATCH zcx_abapgit_exception.\r\n RETURN.\r\nENDTRY.\r\nMESSAGE w125(zbar) WITH c_foo INTO message.\r\nSELECT SINGLE * FROM tadir INTO @DATA(sdfs).\r\nIF sy-subrc <> 0.\r\nENDIF.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let noHandler = false;\r\n const statements = file.getStatements();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n const nextStatement = statements[i + 1];\r\n if (statement.get() instanceof Statements.EndTry) {\r\n noHandler = false;\r\n }\r\n else if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (noHandler === true && !(statement.get() instanceof Statements.Catch)) {\r\n const message = \"NO_HANDLER pragma or pseudo comment can be removed\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n noHandler = false;\r\n }\r\n else {\r\n noHandler = this.containsNoHandler(statement, statements[i + 1]);\r\n }\r\n issues.push(...this.checkText(statement, file));\r\n issues.push(...this.checkNeeded(statement, file));\r\n issues.push(...this.checkSubrc(statement, nextStatement, file));\r\n }\r\n return issues;\r\n }\r\n checkText(statement, file) {\r\n const p = statement.getPragmas().find(t => t.getStr().toUpperCase() === \"##NO_TEXT\");\r\n if (p === undefined) {\r\n return [];\r\n }\r\n if (statement.findFirstExpression(Expressions.ConstantString) === undefined\r\n && statement.findFirstExpression(Expressions.StringTemplate) === undefined) {\r\n const message = \"There is no text, NO_TEXT can be removed\";\r\n return [issue_1.Issue.atToken(file, p, message, this.getMetadata().key, this.getConfig().severity)];\r\n }\r\n return [];\r\n }\r\n checkSubrc(statement, next, file) {\r\n const p = statement.getPragmas().find(t => t.getStr().toUpperCase() === \"##SUBRC_OK\");\r\n if (p === undefined) {\r\n return [];\r\n }\r\n const concat = next.concatTokens().toUpperCase();\r\n if (concat.includes(\" SY-SUBRC\")) {\r\n const message = \"SUBRC_OK can be removed as sy-subrc is checked\";\r\n return [issue_1.Issue.atToken(file, p, message, this.getMetadata().key, this.getConfig().severity)];\r\n }\r\n return [];\r\n }\r\n checkNeeded(statement, file) {\r\n const p = statement.getPragmas().find(t => t.getStr().toUpperCase() === \"##NEEDED\");\r\n if (p === undefined) {\r\n return [];\r\n }\r\n if (statement.findFirstExpression(Expressions.InlineData) === undefined\r\n && !(statement.get() instanceof Statements.Parameter)\r\n && !(statement.get() instanceof Statements.Data)\r\n && !(statement.get() instanceof Statements.DataEnd)\r\n && !(statement.get() instanceof Statements.Type)\r\n && !(statement.get() instanceof Statements.TypeEnd)\r\n && !(statement.get() instanceof Statements.Constant)\r\n && !(statement.get() instanceof Statements.ConstantEnd)\r\n && !(statement.get() instanceof Statements.TypeEnum)\r\n && !(statement.get() instanceof Statements.TypeEnumEnd)\r\n && !(statement.get() instanceof Statements.MethodImplementation)\r\n && !(statement.get() instanceof Statements.MethodDef)\r\n && statement.findFirstExpression(Expressions.InlineFS) === undefined) {\r\n const message = \"There is no data definition, NEEDED can be removed\";\r\n return [issue_1.Issue.atToken(file, p, message, this.getMetadata().key, this.getConfig().severity)];\r\n }\r\n return [];\r\n }\r\n containsNoHandler(statement, next) {\r\n for (const t of statement.getPragmas()) {\r\n if (t.getStr().toUpperCase() === \"##NO_HANDLER\") {\r\n return true;\r\n }\r\n }\r\n if (next\r\n && next.get() instanceof _statement_1.Comment\r\n && next.concatTokens().toUpperCase().includes(\"#EC NO_HANDLER\")) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\nexports.UnnecessaryPragma = UnnecessaryPragma;\r\n//# sourceMappingURL=unnecessary_pragma.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unnecessary_pragma.js?");
12846
12846
 
12847
12847
  /***/ }),
12848
12848
 
@@ -12886,7 +12886,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12886
12886
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12887
12887
 
12888
12888
  "use strict";
12889
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedMethods = exports.UnusedMethodsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass UnusedMethodsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnusedMethodsConf = UnusedMethodsConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.list = [];\r\n this.list = [];\r\n }\r\n push(id) {\r\n this.list.push(id);\r\n }\r\n removeIfExists(id) {\r\n for (let i = 0; i < this.list.length; i++) {\r\n if (id.equals(this.list[i].identifier)) {\r\n this.list.splice(i, 1);\r\n return;\r\n }\r\n }\r\n }\r\n containsProteted() {\r\n for (const m of this.list) {\r\n if (m.visibility === visibility_1.Visibility.Protected) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n getLength() {\r\n return this.list.length;\r\n }\r\n get() {\r\n return this.list;\r\n }\r\n}\r\n// todo: add possibility to also search public methods\r\n// todo: for protected methods, also search subclasses\r\nclass UnusedMethods {\r\n constructor() {\r\n this.conf = new UnusedMethodsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_methods\",\r\n title: \"Unused methods\",\r\n shortDescription: `Checks for unused methods`,\r\n extendedInformation: `Checks private and protected methods.\n\nSkips:\n* methods FOR TESTING\n* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses\n* class_constructor + constructor methods\n* event handlers\n* methods that are redefined\n* INCLUDEs\n`,\r\n tags: [],\r\n pragma: \"##CALLED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Program && obj.isInclude() === true) {\r\n return [];\r\n }\r\n // dont report anything when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.wa = new WorkArea();\r\n for (const file of obj.getABAPFiles()) {\r\n for (const def of file.getInfo().listClassDefinitions()) {\r\n for (const method of def.methods) {\r\n if (method.isForTesting === true\r\n || method.isRedefinition === true\r\n || method.isEventHandler === true) {\r\n continue;\r\n }\r\n else if (def.isForTesting === true\r\n && (method.name.toUpperCase() === \"SETUP\"\r\n || method.name.toUpperCase() === \"CLASS_SETUP\"\r\n || method.name.toUpperCase() === \"TEARDOWN\"\r\n || method.name.toUpperCase() === \"CLASS_TEARDOWN\")) {\r\n continue;\r\n }\r\n else if (method.name.toUpperCase() === \"CONSTRUCTOR\"\r\n || method.name.toUpperCase() === \"CLASS_CONSTRUCTOR\") {\r\n continue;\r\n }\r\n if (method.visibility === visibility_1.Visibility.Private\r\n || method.visibility === visibility_1.Visibility.Protected) {\r\n this.wa.push(method);\r\n }\r\n }\r\n }\r\n }\r\n this.traverse(syntax.spaghetti.getTop());\r\n this.searchGlobalSubclasses(obj);\r\n const issues = [];\r\n for (const i of this.wa.get()) {\r\n const file = obj.getABAPFileByName(i.identifier.getFilename());\r\n if (file === undefined) {\r\n continue;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(i.identifier.getToken(), file);\r\n if (statement === undefined) {\r\n continue;\r\n }\r\n if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {\r\n continue;\r\n }\r\n const message = \"Method \\\"\" + i.identifier.getName() + \"\\\" not used\";\r\n issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n return issues;\r\n }\r\n searchGlobalSubclasses(obj) {\r\n var _a, _b;\r\n if (this.wa.getLength() === 0\r\n || !(obj instanceof objects_1.Class)\r\n || this.wa.containsProteted() === false) {\r\n return;\r\n }\r\n const sup = obj.getDefinition();\r\n if (sup === undefined) {\r\n return;\r\n }\r\n for (const r of this.reg.getObjects()) {\r\n if (r instanceof objects_1.Class\r\n && ((_b = (_a = r.getDefinition()) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === sup.getName().toUpperCase()) {\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, r).run();\r\n this.traverse(syntax.spaghetti.getTop());\r\n // recurse to sub-sub-* classes\r\n this.searchGlobalSubclasses(r);\r\n }\r\n }\r\n }\r\n traverse(node) {\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n this.checkNode(node);\r\n }\r\n for (const c of node.getChildren()) {\r\n this.traverse(c);\r\n }\r\n }\r\n checkNode(node) {\r\n for (const v of node.getData().references) {\r\n if (v.referenceType === _reference_1.ReferenceType.MethodReference && v.resolved) {\r\n this.wa.removeIfExists(v.resolved);\r\n }\r\n }\r\n }\r\n}\r\nexports.UnusedMethods = UnusedMethods;\r\n//# sourceMappingURL=unused_methods.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_methods.js?");
12889
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedMethods = exports.UnusedMethodsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass UnusedMethodsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnusedMethodsConf = UnusedMethodsConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.list = [];\r\n this.list = [];\r\n }\r\n push(id) {\r\n this.list.push(id);\r\n }\r\n removeIfExists(id) {\r\n for (let i = 0; i < this.list.length; i++) {\r\n if (id.equals(this.list[i].identifier)) {\r\n this.list.splice(i, 1);\r\n return;\r\n }\r\n }\r\n }\r\n containsProteted() {\r\n for (const m of this.list) {\r\n if (m.visibility === visibility_1.Visibility.Protected) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n getLength() {\r\n return this.list.length;\r\n }\r\n get() {\r\n return this.list;\r\n }\r\n}\r\n// todo: add possibility to also search public methods\r\n// todo: for protected methods, also search subclasses\r\nclass UnusedMethods {\r\n constructor() {\r\n this.conf = new UnusedMethodsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_methods\",\r\n title: \"Unused methods\",\r\n shortDescription: `Checks for unused methods`,\r\n extendedInformation: `Checks private and protected methods.\r\n\r\nSkips:\r\n* methods FOR TESTING\r\n* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses\r\n* class_constructor + constructor methods\r\n* event handlers\r\n* methods that are redefined\r\n* INCLUDEs\r\n`,\r\n tags: [],\r\n pragma: \"##CALLED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Program && obj.isInclude() === true) {\r\n return [];\r\n }\r\n // dont report anything when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.wa = new WorkArea();\r\n for (const file of obj.getABAPFiles()) {\r\n for (const def of file.getInfo().listClassDefinitions()) {\r\n for (const method of def.methods) {\r\n if (method.isForTesting === true\r\n || method.isRedefinition === true\r\n || method.isEventHandler === true) {\r\n continue;\r\n }\r\n else if (def.isForTesting === true\r\n && (method.name.toUpperCase() === \"SETUP\"\r\n || method.name.toUpperCase() === \"CLASS_SETUP\"\r\n || method.name.toUpperCase() === \"TEARDOWN\"\r\n || method.name.toUpperCase() === \"CLASS_TEARDOWN\")) {\r\n continue;\r\n }\r\n else if (method.name.toUpperCase() === \"CONSTRUCTOR\"\r\n || method.name.toUpperCase() === \"CLASS_CONSTRUCTOR\") {\r\n continue;\r\n }\r\n if (method.visibility === visibility_1.Visibility.Private\r\n || method.visibility === visibility_1.Visibility.Protected) {\r\n this.wa.push(method);\r\n }\r\n }\r\n }\r\n }\r\n this.traverse(syntax.spaghetti.getTop());\r\n this.searchGlobalSubclasses(obj);\r\n const issues = [];\r\n for (const i of this.wa.get()) {\r\n const file = obj.getABAPFileByName(i.identifier.getFilename());\r\n if (file === undefined) {\r\n continue;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(i.identifier.getToken(), file);\r\n if (statement === undefined) {\r\n continue;\r\n }\r\n if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {\r\n continue;\r\n }\r\n const message = \"Method \\\"\" + i.identifier.getName() + \"\\\" not used\";\r\n issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n return issues;\r\n }\r\n searchGlobalSubclasses(obj) {\r\n var _a, _b;\r\n if (this.wa.getLength() === 0\r\n || !(obj instanceof objects_1.Class)\r\n || this.wa.containsProteted() === false) {\r\n return;\r\n }\r\n const sup = obj.getDefinition();\r\n if (sup === undefined) {\r\n return;\r\n }\r\n for (const r of this.reg.getObjects()) {\r\n if (r instanceof objects_1.Class\r\n && ((_b = (_a = r.getDefinition()) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === sup.getName().toUpperCase()) {\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, r).run();\r\n this.traverse(syntax.spaghetti.getTop());\r\n // recurse to sub-sub-* classes\r\n this.searchGlobalSubclasses(r);\r\n }\r\n }\r\n }\r\n traverse(node) {\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n this.checkNode(node);\r\n }\r\n for (const c of node.getChildren()) {\r\n this.traverse(c);\r\n }\r\n }\r\n checkNode(node) {\r\n for (const v of node.getData().references) {\r\n if (v.referenceType === _reference_1.ReferenceType.MethodReference && v.resolved) {\r\n this.wa.removeIfExists(v.resolved);\r\n }\r\n }\r\n }\r\n}\r\nexports.UnusedMethods = UnusedMethods;\r\n//# sourceMappingURL=unused_methods.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_methods.js?");
12890
12890
 
12891
12891
  /***/ }),
12892
12892
 
@@ -12908,7 +12908,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12908
12908
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12909
12909
 
12910
12910
  "use strict";
12911
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedVariables = exports.UnusedVariablesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.UnusedVariablesConf = UnusedVariablesConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.workarea = [];\r\n }\r\n push(id, count = 1) {\r\n for (const w of this.workarea) {\r\n if (id.equals(w.id)) {\r\n return;\r\n }\r\n }\r\n this.workarea.push({ id, count });\r\n }\r\n removeIfExists(id) {\r\n if (id === undefined) {\r\n return;\r\n }\r\n for (let i = 0; i < this.workarea.length; i++) {\r\n if (id.equals(this.workarea[i].id)) {\r\n this.workarea[i].count--;\r\n if (this.workarea[i].count === 0) {\r\n this.workarea.splice(i, 1);\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n get() {\r\n return this.workarea;\r\n }\r\n count() {\r\n return this.workarea.length;\r\n }\r\n}\r\nclass UnusedVariables {\r\n constructor() {\r\n this.conf = new UnusedVariablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_variables\",\r\n title: \"Unused variables\",\r\n shortDescription: `Checks for unused variables and constants`,\r\n extendedInformation: `WARNING: slow\n\nSkips event parameters.\n\nNote that this currently does not work if the source code uses macros.\n\nUnused variables are not reported if the object contains syntax errors. Errors found in INCLUDES are reported for the main program.`,\r\n tags: [_irule_1.RuleTag.Quickfix],\r\n pragma: \"##NEEDED\",\r\n pseudoComment: \"EC NEEDED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n // dont report unused variables when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.workarea = new WorkArea();\r\n const top = syntax.spaghetti.getTop();\r\n this.buildWorkarea(top, obj);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n this.findUses(top, obj);\r\n for (const o of this.reg.getObjects()) {\r\n if (o === obj) {\r\n continue;\r\n }\r\n else if (o instanceof _abap_object_1.ABAPObject) {\r\n if (this.reg.isDependency(o)) {\r\n continue; // do not search in dependencies\r\n }\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, o).run();\r\n this.findUses(syntax.spaghetti.getTop(), o);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n }\r\n }\r\n return this.buildIssues(obj);\r\n }\r\n findUses(node, obj) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.DataReadReference\r\n || r.referenceType === _reference_1.ReferenceType.DataWriteReference\r\n || r.referenceType === _reference_1.ReferenceType.TypeReference) {\r\n this.workarea.removeIfExists(r.resolved);\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n this.findUses(c, obj);\r\n }\r\n }\r\n buildWorkarea(node, obj) {\r\n const stype = node.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.OpenSQL) {\r\n return;\r\n }\r\n for (const c of node.getChildren()) {\r\n this.buildWorkarea(c, obj);\r\n }\r\n if (stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const meta = vars[name].getMeta();\r\n if (this.conf.skipNames\r\n && this.conf.skipNames.length > 0\r\n && this.conf.skipNames.some((a) => a.toUpperCase() === name)) {\r\n continue;\r\n }\r\n else if (name === \"ME\"\r\n || name === \"SUPER\"\r\n || meta.includes(\"selection_screen_tab\" /* IdentifierMeta.SelectionScreenTab */)\r\n || meta.includes(\"event_parameter\" /* IdentifierMeta.EventParameter */)) {\r\n // todo, workaround for \"me\" and \"super\", these should somehow be typed to built-in\r\n continue;\r\n }\r\n const isInline = meta.includes(\"inline\" /* IdentifierMeta.InlineDefinition */);\r\n this.workarea.push(vars[name], isInline ? 2 : 1);\r\n }\r\n }\r\n }\r\n buildIssues(obj) {\r\n const ret = [];\r\n for (const w of this.workarea.get()) {\r\n const filename = w.id.getFilename();\r\n if (this.reg.isFileDependency(filename) === true) {\r\n continue;\r\n }\r\n else if (obj instanceof objects_1.Program === false && obj.containsFile(filename) === false) {\r\n continue;\r\n }\r\n const statement = this.findStatement(w.id);\r\n if (statement === null || statement === void 0 ? void 0 : statement.getPragmas().map(t => t.getStr()).includes(this.getMetadata().pragma + \"\")) {\r\n continue;\r\n }\r\n else if (this.suppressedbyPseudo(statement, w.id, obj)) {\r\n continue;\r\n }\r\n const name = w.id.getName();\r\n const message = \"Variable \\\"\" + name.toLowerCase() + \"\\\" not used\";\r\n const fix = this.buildFix(w.id, obj);\r\n ret.push(issue_1.Issue.atIdentifier(w.id, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n suppressedbyPseudo(statement, v, obj) {\r\n if (statement === undefined) {\r\n return false;\r\n }\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return false;\r\n }\r\n let next = false;\r\n for (const s of file.getStatements()) {\r\n if (next === true && s.get() instanceof _statement_1.Comment) {\r\n return s.concatTokens().includes(this.getMetadata().pseudoComment + \"\");\r\n }\r\n if (s === statement) {\r\n next = true;\r\n }\r\n }\r\n return false;\r\n }\r\n findStatement(v) {\r\n const file = this.reg.getFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const object = this.reg.findObjectForFile(file);\r\n if (!(object instanceof _abap_object_1.ABAPObject)) {\r\n return undefined;\r\n }\r\n const abapfile = object.getABAPFileByName(v.getFilename());\r\n if (abapfile === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), abapfile);\r\n return statement;\r\n }\r\n buildFix(v, obj) {\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), file);\r\n if (statement === undefined) {\r\n return undefined;\r\n }\r\n else if (statement.get() instanceof Statements.Data) {\r\n return edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnusedVariables = UnusedVariables;\r\n//# sourceMappingURL=unused_variables.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_variables.js?");
12911
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedVariables = exports.UnusedVariablesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.UnusedVariablesConf = UnusedVariablesConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.workarea = [];\r\n }\r\n push(id, count = 1) {\r\n for (const w of this.workarea) {\r\n if (id.equals(w.id)) {\r\n return;\r\n }\r\n }\r\n this.workarea.push({ id, count });\r\n }\r\n removeIfExists(id) {\r\n if (id === undefined) {\r\n return;\r\n }\r\n for (let i = 0; i < this.workarea.length; i++) {\r\n if (id.equals(this.workarea[i].id)) {\r\n this.workarea[i].count--;\r\n if (this.workarea[i].count === 0) {\r\n this.workarea.splice(i, 1);\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n get() {\r\n return this.workarea;\r\n }\r\n count() {\r\n return this.workarea.length;\r\n }\r\n}\r\nclass UnusedVariables {\r\n constructor() {\r\n this.conf = new UnusedVariablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_variables\",\r\n title: \"Unused variables\",\r\n shortDescription: `Checks for unused variables and constants`,\r\n extendedInformation: `WARNING: slow\r\n\r\nSkips event parameters.\r\n\r\nNote that this currently does not work if the source code uses macros.\r\n\r\nUnused variables are not reported if the object contains syntax errors. Errors found in INCLUDES are reported for the main program.`,\r\n tags: [_irule_1.RuleTag.Quickfix],\r\n pragma: \"##NEEDED\",\r\n pseudoComment: \"EC NEEDED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n // dont report unused variables when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.workarea = new WorkArea();\r\n const top = syntax.spaghetti.getTop();\r\n this.buildWorkarea(top, obj);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n this.findUses(top, obj);\r\n for (const o of this.reg.getObjects()) {\r\n if (o === obj) {\r\n continue;\r\n }\r\n else if (o instanceof _abap_object_1.ABAPObject) {\r\n if (this.reg.isDependency(o)) {\r\n continue; // do not search in dependencies\r\n }\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, o).run();\r\n this.findUses(syntax.spaghetti.getTop(), o);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n }\r\n }\r\n return this.buildIssues(obj);\r\n }\r\n findUses(node, obj) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.DataReadReference\r\n || r.referenceType === _reference_1.ReferenceType.DataWriteReference\r\n || r.referenceType === _reference_1.ReferenceType.TypeReference) {\r\n this.workarea.removeIfExists(r.resolved);\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n this.findUses(c, obj);\r\n }\r\n }\r\n buildWorkarea(node, obj) {\r\n const stype = node.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.OpenSQL) {\r\n return;\r\n }\r\n for (const c of node.getChildren()) {\r\n this.buildWorkarea(c, obj);\r\n }\r\n if (stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const meta = vars[name].getMeta();\r\n if (this.conf.skipNames\r\n && this.conf.skipNames.length > 0\r\n && this.conf.skipNames.some((a) => a.toUpperCase() === name)) {\r\n continue;\r\n }\r\n else if (name === \"ME\"\r\n || name === \"SUPER\"\r\n || meta.includes(\"selection_screen_tab\" /* IdentifierMeta.SelectionScreenTab */)\r\n || meta.includes(\"event_parameter\" /* IdentifierMeta.EventParameter */)) {\r\n // todo, workaround for \"me\" and \"super\", these should somehow be typed to built-in\r\n continue;\r\n }\r\n const isInline = meta.includes(\"inline\" /* IdentifierMeta.InlineDefinition */);\r\n this.workarea.push(vars[name], isInline ? 2 : 1);\r\n }\r\n }\r\n }\r\n buildIssues(obj) {\r\n const ret = [];\r\n for (const w of this.workarea.get()) {\r\n const filename = w.id.getFilename();\r\n if (this.reg.isFileDependency(filename) === true) {\r\n continue;\r\n }\r\n else if (obj instanceof objects_1.Program === false && obj.containsFile(filename) === false) {\r\n continue;\r\n }\r\n const statement = this.findStatement(w.id);\r\n if (statement === null || statement === void 0 ? void 0 : statement.getPragmas().map(t => t.getStr()).includes(this.getMetadata().pragma + \"\")) {\r\n continue;\r\n }\r\n else if (this.suppressedbyPseudo(statement, w.id, obj)) {\r\n continue;\r\n }\r\n const name = w.id.getName();\r\n const message = \"Variable \\\"\" + name.toLowerCase() + \"\\\" not used\";\r\n const fix = this.buildFix(w.id, obj);\r\n ret.push(issue_1.Issue.atIdentifier(w.id, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n suppressedbyPseudo(statement, v, obj) {\r\n if (statement === undefined) {\r\n return false;\r\n }\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return false;\r\n }\r\n let next = false;\r\n for (const s of file.getStatements()) {\r\n if (next === true && s.get() instanceof _statement_1.Comment) {\r\n return s.concatTokens().includes(this.getMetadata().pseudoComment + \"\");\r\n }\r\n if (s === statement) {\r\n next = true;\r\n }\r\n }\r\n return false;\r\n }\r\n findStatement(v) {\r\n const file = this.reg.getFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const object = this.reg.findObjectForFile(file);\r\n if (!(object instanceof _abap_object_1.ABAPObject)) {\r\n return undefined;\r\n }\r\n const abapfile = object.getABAPFileByName(v.getFilename());\r\n if (abapfile === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), abapfile);\r\n return statement;\r\n }\r\n buildFix(v, obj) {\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), file);\r\n if (statement === undefined) {\r\n return undefined;\r\n }\r\n else if (statement.get() instanceof Statements.Data) {\r\n return edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnusedVariables = UnusedVariables;\r\n//# sourceMappingURL=unused_variables.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_variables.js?");
12912
12912
 
12913
12913
  /***/ }),
12914
12914
 
@@ -12919,7 +12919,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12919
12919
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12920
12920
 
12921
12921
  "use strict";
12922
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseBoolExpression = exports.UseBoolExpressionConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\n// note this rule assumes abap_true and abap_false is used for boolean variables\r\n// some other rule will in the future find assignments to abap_bool that are not abap_true/abap_false/abap_undefined\r\nclass UseBoolExpressionConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseBoolExpressionConf = UseBoolExpressionConf;\r\nclass UseBoolExpression extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseBoolExpressionConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_bool_expression\",\r\n title: \"Use boolean expression\",\r\n shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `IF line IS INITIAL.\n has_entries = abap_false.\nELSE.\n has_entries = abap_true.\nENDIF.\n\nDATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,\r\n goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).\n\nDATA(fsdf) = xsdbool( foo <> bar ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n const issues = [];\r\n const stru = file.getStructure();\r\n const version = this.reg.getConfig().getVersion();\r\n if (stru === undefined || (version < version_1.Version.v702 && version !== version_1.Version.Cloud)) {\r\n return [];\r\n }\r\n for (const i of stru.findAllStructures(Structures.If)) {\r\n if (i.findDirectStructure(Structures.ElseIf) !== undefined) {\r\n continue;\r\n }\r\n const bodyNodes = (_a = i.findDirectStructure(Structures.Body)) === null || _a === void 0 ? void 0 : _a.findAllStatementNodes();\r\n if (bodyNodes === undefined || bodyNodes.length !== 1) {\r\n continue;\r\n }\r\n const bodyStatement = bodyNodes[0];\r\n if (!(bodyStatement.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n const elseNodes = (_c = (_b = i.findDirectStructure(Structures.Else)) === null || _b === void 0 ? void 0 : _b.findDirectStructure(Structures.Body)) === null || _c === void 0 ? void 0 : _c.findAllStatementNodes();\r\n if (elseNodes === undefined || elseNodes.length !== 1) {\r\n continue;\r\n }\r\n const elseStatement = elseNodes[0];\r\n if (!(elseStatement.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n let bodyTarget = (_d = bodyStatement.findFirstExpression(Expressions.Target)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n if (bodyTarget === null || bodyTarget === void 0 ? void 0 : bodyTarget.startsWith(\"DATA(\")) {\r\n bodyTarget = bodyTarget.substr(5, bodyTarget.length - 6);\r\n }\r\n const elseTarget = (_e = elseStatement.findFirstExpression(Expressions.Target)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n if (bodyTarget === undefined\r\n || elseTarget === undefined\r\n || bodyTarget.toUpperCase() !== elseTarget.toUpperCase()) {\r\n continue;\r\n }\r\n const bodySource = (_f = bodyStatement.findFirstExpression(Expressions.Source)) === null || _f === void 0 ? void 0 : _f.concatTokens().toUpperCase();\r\n const elseSource = (_g = elseStatement.findFirstExpression(Expressions.Source)) === null || _g === void 0 ? void 0 : _g.concatTokens().toUpperCase();\r\n if ((bodySource === \"ABAP_TRUE\" && elseSource === \"ABAP_FALSE\")\r\n || (bodySource === \"ABAP_FALSE\" && elseSource === \"ABAP_TRUE\")) {\r\n const func = (this.reg.getConfig().getVersion() >= version_1.Version.v740sp08\r\n || this.reg.getConfig().getVersion() === version_1.Version.Cloud) ? \"xsdbool\" : \"boolc\";\r\n const negate = bodySource === \"ABAP_FALSE\";\r\n const message = `Use ${func} instead of IF` + (negate ? \", negate expression\" : \"\");\r\n const start = i.getFirstToken().getStart();\r\n const end = i.getLastToken().getEnd();\r\n const statement = bodyTarget + \" = \" + func + \"( \" +\r\n (negate ? \"NOT ( \" : \"\") +\r\n ((_j = (_h = i.findFirstStatement(Statements.If)) === null || _h === void 0 ? void 0 : _h.findFirstExpression(Expressions.Cond)) === null || _j === void 0 ? void 0 : _j.concatTokens()) +\r\n (negate ? \" )\" : \"\") +\r\n \" ).\";\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, start, end, statement);\r\n issues.push(issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n if (version >= version_1.Version.v740sp08 || version === version_1.Version.Cloud) {\r\n for (const b of stru.findAllExpressions(Expressions.CondBody)) {\r\n const concat = b.concatTokens().toUpperCase();\r\n if (concat.endsWith(\" THEN ABAP_TRUE ELSE ABAP_FALSE\")\r\n || concat.endsWith(\" THEN ABAP_TRUE\")\r\n || concat.endsWith(\" THEN ABAP_FALSE ELSE ABAP_TRUE\")) {\r\n const message = \"Use xsdbool\";\r\n // eslint-disable-next-line max-len\r\n issues.push(issue_1.Issue.atRange(file, b.getFirstToken().getStart(), b.getLastToken().getEnd(), message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.UseBoolExpression = UseBoolExpression;\r\n//# sourceMappingURL=use_bool_expression.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_bool_expression.js?");
12922
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseBoolExpression = exports.UseBoolExpressionConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\n// note this rule assumes abap_true and abap_false is used for boolean variables\r\n// some other rule will in the future find assignments to abap_bool that are not abap_true/abap_false/abap_undefined\r\nclass UseBoolExpressionConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseBoolExpressionConf = UseBoolExpressionConf;\r\nclass UseBoolExpression extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseBoolExpressionConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_bool_expression\",\r\n title: \"Use boolean expression\",\r\n shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `IF line IS INITIAL.\r\n has_entries = abap_false.\r\nELSE.\r\n has_entries = abap_true.\r\nENDIF.\r\n\r\nDATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,\r\n goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).\r\n\r\nDATA(fsdf) = xsdbool( foo <> bar ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n const issues = [];\r\n const stru = file.getStructure();\r\n const version = this.reg.getConfig().getVersion();\r\n if (stru === undefined || (version < version_1.Version.v702 && version !== version_1.Version.Cloud)) {\r\n return [];\r\n }\r\n for (const i of stru.findAllStructures(Structures.If)) {\r\n if (i.findDirectStructure(Structures.ElseIf) !== undefined) {\r\n continue;\r\n }\r\n const bodyNodes = (_a = i.findDirectStructure(Structures.Body)) === null || _a === void 0 ? void 0 : _a.findAllStatementNodes();\r\n if (bodyNodes === undefined || bodyNodes.length !== 1) {\r\n continue;\r\n }\r\n const bodyStatement = bodyNodes[0];\r\n if (!(bodyStatement.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n const elseNodes = (_c = (_b = i.findDirectStructure(Structures.Else)) === null || _b === void 0 ? void 0 : _b.findDirectStructure(Structures.Body)) === null || _c === void 0 ? void 0 : _c.findAllStatementNodes();\r\n if (elseNodes === undefined || elseNodes.length !== 1) {\r\n continue;\r\n }\r\n const elseStatement = elseNodes[0];\r\n if (!(elseStatement.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n let bodyTarget = (_d = bodyStatement.findFirstExpression(Expressions.Target)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n if (bodyTarget === null || bodyTarget === void 0 ? void 0 : bodyTarget.startsWith(\"DATA(\")) {\r\n bodyTarget = bodyTarget.substr(5, bodyTarget.length - 6);\r\n }\r\n const elseTarget = (_e = elseStatement.findFirstExpression(Expressions.Target)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n if (bodyTarget === undefined\r\n || elseTarget === undefined\r\n || bodyTarget.toUpperCase() !== elseTarget.toUpperCase()) {\r\n continue;\r\n }\r\n const bodySource = (_f = bodyStatement.findFirstExpression(Expressions.Source)) === null || _f === void 0 ? void 0 : _f.concatTokens().toUpperCase();\r\n const elseSource = (_g = elseStatement.findFirstExpression(Expressions.Source)) === null || _g === void 0 ? void 0 : _g.concatTokens().toUpperCase();\r\n if ((bodySource === \"ABAP_TRUE\" && elseSource === \"ABAP_FALSE\")\r\n || (bodySource === \"ABAP_FALSE\" && elseSource === \"ABAP_TRUE\")) {\r\n const func = (this.reg.getConfig().getVersion() >= version_1.Version.v740sp08\r\n || this.reg.getConfig().getVersion() === version_1.Version.Cloud) ? \"xsdbool\" : \"boolc\";\r\n const negate = bodySource === \"ABAP_FALSE\";\r\n const message = `Use ${func} instead of IF` + (negate ? \", negate expression\" : \"\");\r\n const start = i.getFirstToken().getStart();\r\n const end = i.getLastToken().getEnd();\r\n const statement = bodyTarget + \" = \" + func + \"( \" +\r\n (negate ? \"NOT ( \" : \"\") +\r\n ((_j = (_h = i.findFirstStatement(Statements.If)) === null || _h === void 0 ? void 0 : _h.findFirstExpression(Expressions.Cond)) === null || _j === void 0 ? void 0 : _j.concatTokens()) +\r\n (negate ? \" )\" : \"\") +\r\n \" ).\";\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, start, end, statement);\r\n issues.push(issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n if (version >= version_1.Version.v740sp08 || version === version_1.Version.Cloud) {\r\n for (const b of stru.findAllExpressions(Expressions.CondBody)) {\r\n const concat = b.concatTokens().toUpperCase();\r\n if (concat.endsWith(\" THEN ABAP_TRUE ELSE ABAP_FALSE\")\r\n || concat.endsWith(\" THEN ABAP_TRUE\")\r\n || concat.endsWith(\" THEN ABAP_FALSE ELSE ABAP_TRUE\")) {\r\n const message = \"Use xsdbool\";\r\n // eslint-disable-next-line max-len\r\n issues.push(issue_1.Issue.atRange(file, b.getFirstToken().getStart(), b.getLastToken().getEnd(), message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.UseBoolExpression = UseBoolExpression;\r\n//# sourceMappingURL=use_bool_expression.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_bool_expression.js?");
12923
12923
 
12924
12924
  /***/ }),
12925
12925
 
@@ -12941,7 +12941,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12941
12941
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12942
12942
 
12943
12943
  "use strict";
12944
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseLineExists = exports.UseLineExistsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass UseLineExistsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseLineExistsConf = UseLineExistsConf;\r\nclass UseLineExists extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseLineExistsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_line_exists\",\r\n title: \"Use line_exists\",\r\n shortDescription: `Use line_exists, from 740sp02 and up`,\r\n extendedInformation: `\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at\n\nNot reported if the READ TABLE statement contains BINARY SEARCH.`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.\nIF sy-subrc = 0.\nENDIF.`,\r\n goodExample: `IF line_exists( my_table[ key = 'A' ] ).\nENDIF.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const vers = this.reg.getConfig().getVersion();\r\n if (vers === version_1.Version.OpenABAP) {\r\n return [];\r\n }\r\n else if (vers < version_1.Version.v740sp02 && vers !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n const statements = file.getStatements();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n if (!(statement.get() instanceof Statements.ReadTable)) {\r\n continue;\r\n }\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.includes(\" TRANSPORTING NO FIELDS\") === true\r\n && concat.includes(\" BINARY SEARCH\") === false\r\n && this.checksSubrc(i, statements) === true\r\n && this.usesTabix(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, \"Use line_exists\", this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////////\r\n checksSubrc(index, statements) {\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n for (const c of statement.findAllExpressions(Expressions.Cond)) {\r\n for (const s of c.findAllExpressions(Expressions.Source)) {\r\n if (s.concatTokens().toUpperCase() === \"SY-SUBRC\") {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n return false;\r\n }\r\n // this is a heuristic, data flow analysis is required to get the correct result\r\n usesTabix(index, statements) {\r\n for (let i = index + 1; i < index + 5; i++) {\r\n const statement = statements[i];\r\n if (statement === undefined) {\r\n break;\r\n }\r\n else if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.concatTokens().toUpperCase().includes(\" SY-TABIX\")) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.UseLineExists = UseLineExists;\r\n//# sourceMappingURL=use_line_exists.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_line_exists.js?");
12944
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseLineExists = exports.UseLineExistsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass UseLineExistsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseLineExistsConf = UseLineExistsConf;\r\nclass UseLineExists extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseLineExistsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_line_exists\",\r\n title: \"Use line_exists\",\r\n shortDescription: `Use line_exists, from 740sp02 and up`,\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at\r\n\r\nNot reported if the READ TABLE statement contains BINARY SEARCH.`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.\r\nIF sy-subrc = 0.\r\nENDIF.`,\r\n goodExample: `IF line_exists( my_table[ key = 'A' ] ).\r\nENDIF.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const vers = this.reg.getConfig().getVersion();\r\n if (vers === version_1.Version.OpenABAP) {\r\n return [];\r\n }\r\n else if (vers < version_1.Version.v740sp02 && vers !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n const statements = file.getStatements();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n if (!(statement.get() instanceof Statements.ReadTable)) {\r\n continue;\r\n }\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.includes(\" TRANSPORTING NO FIELDS\") === true\r\n && concat.includes(\" BINARY SEARCH\") === false\r\n && this.checksSubrc(i, statements) === true\r\n && this.usesTabix(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, \"Use line_exists\", this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////////\r\n checksSubrc(index, statements) {\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n for (const c of statement.findAllExpressions(Expressions.Cond)) {\r\n for (const s of c.findAllExpressions(Expressions.Source)) {\r\n if (s.concatTokens().toUpperCase() === \"SY-SUBRC\") {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n return false;\r\n }\r\n // this is a heuristic, data flow analysis is required to get the correct result\r\n usesTabix(index, statements) {\r\n for (let i = index + 1; i < index + 5; i++) {\r\n const statement = statements[i];\r\n if (statement === undefined) {\r\n break;\r\n }\r\n else if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.concatTokens().toUpperCase().includes(\" SY-TABIX\")) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.UseLineExists = UseLineExists;\r\n//# sourceMappingURL=use_line_exists.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_line_exists.js?");
12945
12945
 
12946
12946
  /***/ }),
12947
12947
 
@@ -12952,7 +12952,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12952
12952
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12953
12953
 
12954
12954
  "use strict";
12955
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseNew = exports.UseNewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass UseNewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseNewConf = UseNewConf;\r\nclass UseNew extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseNewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_new\",\r\n title: \"Use NEW\",\r\n shortDescription: `Checks for deprecated CREATE OBJECT statements.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object\n\nIf the target variable is referenced in the CREATE OBJECT statement, no errors are issued\n\nApplicable from v740sp02 and up`,\r\n badExample: `CREATE OBJECT ref.`,\r\n goodExample: `ref = NEW #( ).`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Use NEW #( ) to instantiate object.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a;\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof Statements.CreateObject) {\r\n if (statement.findFirstExpression(expressions_1.Dynamic)) {\r\n continue;\r\n }\r\n else if (statement.findDirectExpression(expressions_1.ParameterListExceptions)) {\r\n continue;\r\n }\r\n else if (statement.findDirectTokenByText(\"AREA\")) {\r\n continue;\r\n }\r\n const target = ((_a = statement.findDirectExpression(expressions_1.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + \"->\";\r\n if (statement.concatTokens().includes(target)) {\r\n continue;\r\n }\r\n const fix = this.buildFix(file, statement);\r\n const issue = issue_1.Issue.atPosition(file, statement.getStart(), this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n buildFix(file, statement) {\r\n var _a, _b;\r\n const target = (_a = statement.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const parameters = statement.findDirectExpression(Expressions.ParameterListS);\r\n const param = parameters ? parameters.concatTokens() + \" \" : \"\";\r\n let type = (_b = statement.findDirectExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n if (type === undefined) {\r\n type = \"#\";\r\n }\r\n const string = `${target} = NEW ${type}( ${param}).`;\r\n return edit_helper_1.EditHelper.replaceRange(file, statement.getStart(), statement.getEnd(), string);\r\n }\r\n}\r\nexports.UseNew = UseNew;\r\n//# sourceMappingURL=use_new.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_new.js?");
12955
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseNew = exports.UseNewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass UseNewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseNewConf = UseNewConf;\r\nclass UseNew extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseNewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_new\",\r\n title: \"Use NEW\",\r\n shortDescription: `Checks for deprecated CREATE OBJECT statements.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object\r\n\r\nIf the target variable is referenced in the CREATE OBJECT statement, no errors are issued\r\n\r\nApplicable from v740sp02 and up`,\r\n badExample: `CREATE OBJECT ref.`,\r\n goodExample: `ref = NEW #( ).`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Use NEW #( ) to instantiate object.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a;\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof Statements.CreateObject) {\r\n if (statement.findFirstExpression(expressions_1.Dynamic)) {\r\n continue;\r\n }\r\n else if (statement.findDirectExpression(expressions_1.ParameterListExceptions)) {\r\n continue;\r\n }\r\n else if (statement.findDirectTokenByText(\"AREA\")) {\r\n continue;\r\n }\r\n const target = ((_a = statement.findDirectExpression(expressions_1.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + \"->\";\r\n if (statement.concatTokens().includes(target)) {\r\n continue;\r\n }\r\n const fix = this.buildFix(file, statement);\r\n const issue = issue_1.Issue.atPosition(file, statement.getStart(), this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n buildFix(file, statement) {\r\n var _a, _b;\r\n const target = (_a = statement.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const parameters = statement.findDirectExpression(Expressions.ParameterListS);\r\n const param = parameters ? parameters.concatTokens() + \" \" : \"\";\r\n let type = (_b = statement.findDirectExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n if (type === undefined) {\r\n type = \"#\";\r\n }\r\n const string = `${target} = NEW ${type}( ${param}).`;\r\n return edit_helper_1.EditHelper.replaceRange(file, statement.getStart(), statement.getEnd(), string);\r\n }\r\n}\r\nexports.UseNew = UseNew;\r\n//# sourceMappingURL=use_new.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_new.js?");
12956
12956
 
12957
12957
  /***/ }),
12958
12958
 
@@ -12963,7 +12963,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
12963
12963
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
12964
12964
 
12965
12965
  "use strict";
12966
- eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhenOthersLast = exports.WhenOthersLastConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass WhenOthersLastConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.WhenOthersLastConf = WhenOthersLastConf;\r\nclass WhenOthersLast extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new WhenOthersLastConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"when_others_last\",\r\n title: \"WHEN OTHERS last\",\r\n shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `CASE bar.\n WHEN OTHERS.\n WHEN 2.\nENDCASE.`,\r\n goodExample: `CASE bar.\n WHEN 2.\n WHEN OTHERS.\nENDCASE.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"WHEN OTHERS should be the last branch in a CASE statement.\";\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return [];\r\n }\r\n const cases = struc.findAllStructures(Structures.Case);\r\n for (const c of cases) {\r\n const whentop = c.findDirectStructures(Structures.When);\r\n for (let i = 0; i < whentop.length - 1; i++) {\r\n const whens = whentop[i].findDirectStatements(Statements.When).concat(whentop[i].findDirectStatements(Statements.WhenOthers));\r\n for (const when of whens) {\r\n if (when.get() instanceof Statements.WhenOthers) {\r\n const start = when.getFirstToken().getStart();\r\n const issue = issue_1.Issue.atPosition(file, start, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n}\r\nexports.WhenOthersLast = WhenOthersLast;\r\n//# sourceMappingURL=when_others_last.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/when_others_last.js?");
12966
+ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhenOthersLast = exports.WhenOthersLastConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass WhenOthersLastConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.WhenOthersLastConf = WhenOthersLastConf;\r\nclass WhenOthersLast extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new WhenOthersLastConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"when_others_last\",\r\n title: \"WHEN OTHERS last\",\r\n shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `CASE bar.\r\n WHEN OTHERS.\r\n WHEN 2.\r\nENDCASE.`,\r\n goodExample: `CASE bar.\r\n WHEN 2.\r\n WHEN OTHERS.\r\nENDCASE.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"WHEN OTHERS should be the last branch in a CASE statement.\";\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return [];\r\n }\r\n const cases = struc.findAllStructures(Structures.Case);\r\n for (const c of cases) {\r\n const whentop = c.findDirectStructures(Structures.When);\r\n for (let i = 0; i < whentop.length - 1; i++) {\r\n const whens = whentop[i].findDirectStatements(Statements.When).concat(whentop[i].findDirectStatements(Statements.WhenOthers));\r\n for (const when of whens) {\r\n if (when.get() instanceof Statements.WhenOthers) {\r\n const start = when.getFirstToken().getStart();\r\n const issue = issue_1.Issue.atPosition(file, start, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n}\r\nexports.WhenOthersLast = WhenOthersLast;\r\n//# sourceMappingURL=when_others_last.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/when_others_last.js?");
12967
12967
 
12968
12968
  /***/ }),
12969
12969
 
@@ -13415,7 +13415,7 @@ eval("const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;\nconst numRegex = /^([\\-\\+])?(
13415
13415
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
13416
13416
 
13417
13417
  "use strict";
13418
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AnnotatedTextEdit\": () => (/* binding */ AnnotatedTextEdit),\n/* harmony export */ \"ChangeAnnotation\": () => (/* binding */ ChangeAnnotation),\n/* harmony export */ \"ChangeAnnotationIdentifier\": () => (/* binding */ ChangeAnnotationIdentifier),\n/* harmony export */ \"CodeAction\": () => (/* binding */ CodeAction),\n/* harmony export */ \"CodeActionContext\": () => (/* binding */ CodeActionContext),\n/* harmony export */ \"CodeActionKind\": () => (/* binding */ CodeActionKind),\n/* harmony export */ \"CodeActionTriggerKind\": () => (/* binding */ CodeActionTriggerKind),\n/* harmony export */ \"CodeDescription\": () => (/* binding */ CodeDescription),\n/* harmony export */ \"CodeLens\": () => (/* binding */ CodeLens),\n/* harmony export */ \"Color\": () => (/* binding */ Color),\n/* harmony export */ \"ColorInformation\": () => (/* binding */ ColorInformation),\n/* harmony export */ \"ColorPresentation\": () => (/* binding */ ColorPresentation),\n/* harmony export */ \"Command\": () => (/* binding */ Command),\n/* harmony export */ \"CompletionItem\": () => (/* binding */ CompletionItem),\n/* harmony export */ \"CompletionItemKind\": () => (/* binding */ CompletionItemKind),\n/* harmony export */ \"CompletionItemLabelDetails\": () => (/* binding */ CompletionItemLabelDetails),\n/* harmony export */ \"CompletionItemTag\": () => (/* binding */ CompletionItemTag),\n/* harmony export */ \"CompletionList\": () => (/* binding */ CompletionList),\n/* harmony export */ \"CreateFile\": () => (/* binding */ CreateFile),\n/* harmony export */ \"DeleteFile\": () => (/* binding */ DeleteFile),\n/* harmony export */ \"Diagnostic\": () => (/* binding */ Diagnostic),\n/* harmony export */ \"DiagnosticRelatedInformation\": () => (/* binding */ DiagnosticRelatedInformation),\n/* harmony export */ \"DiagnosticSeverity\": () => (/* binding */ DiagnosticSeverity),\n/* harmony export */ \"DiagnosticTag\": () => (/* binding */ DiagnosticTag),\n/* harmony export */ \"DocumentHighlight\": () => (/* binding */ DocumentHighlight),\n/* harmony export */ \"DocumentHighlightKind\": () => (/* binding */ DocumentHighlightKind),\n/* harmony export */ \"DocumentLink\": () => (/* binding */ DocumentLink),\n/* harmony export */ \"DocumentSymbol\": () => (/* binding */ DocumentSymbol),\n/* harmony export */ \"DocumentUri\": () => (/* binding */ DocumentUri),\n/* harmony export */ \"EOL\": () => (/* binding */ EOL),\n/* harmony export */ \"FoldingRange\": () => (/* binding */ FoldingRange),\n/* harmony export */ \"FoldingRangeKind\": () => (/* binding */ FoldingRangeKind),\n/* harmony export */ \"FormattingOptions\": () => (/* binding */ FormattingOptions),\n/* harmony export */ \"Hover\": () => (/* binding */ Hover),\n/* harmony export */ \"InlayHint\": () => (/* binding */ InlayHint),\n/* harmony export */ \"InlayHintKind\": () => (/* binding */ InlayHintKind),\n/* harmony export */ \"InlayHintLabelPart\": () => (/* binding */ InlayHintLabelPart),\n/* harmony export */ \"InlineValueContext\": () => (/* binding */ InlineValueContext),\n/* harmony export */ \"InlineValueEvaluatableExpression\": () => (/* binding */ InlineValueEvaluatableExpression),\n/* harmony export */ \"InlineValueText\": () => (/* binding */ InlineValueText),\n/* harmony export */ \"InlineValueVariableLookup\": () => (/* binding */ InlineValueVariableLookup),\n/* harmony export */ \"InsertReplaceEdit\": () => (/* binding */ InsertReplaceEdit),\n/* harmony export */ \"InsertTextFormat\": () => (/* binding */ InsertTextFormat),\n/* harmony export */ \"InsertTextMode\": () => (/* binding */ InsertTextMode),\n/* harmony export */ \"Location\": () => (/* binding */ Location),\n/* harmony export */ \"LocationLink\": () => (/* binding */ LocationLink),\n/* harmony export */ \"MarkedString\": () => (/* binding */ MarkedString),\n/* harmony export */ \"MarkupContent\": () => (/* binding */ MarkupContent),\n/* harmony export */ \"MarkupKind\": () => (/* binding */ MarkupKind),\n/* harmony export */ \"OptionalVersionedTextDocumentIdentifier\": () => (/* binding */ OptionalVersionedTextDocumentIdentifier),\n/* harmony export */ \"ParameterInformation\": () => (/* binding */ ParameterInformation),\n/* harmony export */ \"Position\": () => (/* binding */ Position),\n/* harmony export */ \"Range\": () => (/* binding */ Range),\n/* harmony export */ \"RenameFile\": () => (/* binding */ RenameFile),\n/* harmony export */ \"SelectionRange\": () => (/* binding */ SelectionRange),\n/* harmony export */ \"SemanticTokenModifiers\": () => (/* binding */ SemanticTokenModifiers),\n/* harmony export */ \"SemanticTokenTypes\": () => (/* binding */ SemanticTokenTypes),\n/* harmony export */ \"SemanticTokens\": () => (/* binding */ SemanticTokens),\n/* harmony export */ \"SignatureInformation\": () => (/* binding */ SignatureInformation),\n/* harmony export */ \"SymbolInformation\": () => (/* binding */ SymbolInformation),\n/* harmony export */ \"SymbolKind\": () => (/* binding */ SymbolKind),\n/* harmony export */ \"SymbolTag\": () => (/* binding */ SymbolTag),\n/* harmony export */ \"TextDocument\": () => (/* binding */ TextDocument),\n/* harmony export */ \"TextDocumentEdit\": () => (/* binding */ TextDocumentEdit),\n/* harmony export */ \"TextDocumentIdentifier\": () => (/* binding */ TextDocumentIdentifier),\n/* harmony export */ \"TextDocumentItem\": () => (/* binding */ TextDocumentItem),\n/* harmony export */ \"TextEdit\": () => (/* binding */ TextEdit),\n/* harmony export */ \"URI\": () => (/* binding */ URI),\n/* harmony export */ \"VersionedTextDocumentIdentifier\": () => (/* binding */ VersionedTextDocumentIdentifier),\n/* harmony export */ \"WorkspaceChange\": () => (/* binding */ WorkspaceChange),\n/* harmony export */ \"WorkspaceEdit\": () => (/* binding */ WorkspaceEdit),\n/* harmony export */ \"WorkspaceFolder\": () => (/* binding */ WorkspaceFolder),\n/* harmony export */ \"WorkspaceSymbol\": () => (/* binding */ WorkspaceSymbol),\n/* harmony export */ \"integer\": () => (/* binding */ integer),\n/* harmony export */ \"uinteger\": () => (/* binding */ uinteger)\n/* harmony export */ });\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n\nvar DocumentUri;\n(function (DocumentUri) {\n function is(value) {\n return typeof value === 'string';\n }\n DocumentUri.is = is;\n})(DocumentUri || (DocumentUri = {}));\nvar URI;\n(function (URI) {\n function is(value) {\n return typeof value === 'string';\n }\n URI.is = is;\n})(URI || (URI = {}));\nvar integer;\n(function (integer) {\n integer.MIN_VALUE = -2147483648;\n integer.MAX_VALUE = 2147483647;\n function is(value) {\n return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;\n }\n integer.is = is;\n})(integer || (integer = {}));\nvar uinteger;\n(function (uinteger) {\n uinteger.MIN_VALUE = 0;\n uinteger.MAX_VALUE = 2147483647;\n function is(value) {\n return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;\n }\n uinteger.is = is;\n})(uinteger || (uinteger = {}));\n/**\n * The Position namespace provides helper functions to work with\n * [Position](#Position) literals.\n */\nvar Position;\n(function (Position) {\n /**\n * Creates a new Position literal from the given line and character.\n * @param line The position's line.\n * @param character The position's character.\n */\n function create(line, character) {\n if (line === Number.MAX_VALUE) {\n line = uinteger.MAX_VALUE;\n }\n if (character === Number.MAX_VALUE) {\n character = uinteger.MAX_VALUE;\n }\n return { line: line, character: character };\n }\n Position.create = create;\n /**\n * Checks whether the given literal conforms to the [Position](#Position) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);\n }\n Position.is = is;\n})(Position || (Position = {}));\n/**\n * The Range namespace provides helper functions to work with\n * [Range](#Range) literals.\n */\nvar Range;\n(function (Range) {\n function create(one, two, three, four) {\n if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {\n return { start: Position.create(one, two), end: Position.create(three, four) };\n }\n else if (Position.is(one) && Position.is(two)) {\n return { start: one, end: two };\n }\n else {\n throw new Error(\"Range#create called with invalid arguments[\".concat(one, \", \").concat(two, \", \").concat(three, \", \").concat(four, \"]\"));\n }\n }\n Range.create = create;\n /**\n * Checks whether the given literal conforms to the [Range](#Range) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }\n Range.is = is;\n})(Range || (Range = {}));\n/**\n * The Location namespace provides helper functions to work with\n * [Location](#Location) literals.\n */\nvar Location;\n(function (Location) {\n /**\n * Creates a Location literal.\n * @param uri The location's uri.\n * @param range The location's range.\n */\n function create(uri, range) {\n return { uri: uri, range: range };\n }\n Location.create = create;\n /**\n * Checks whether the given literal conforms to the [Location](#Location) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\n }\n Location.is = is;\n})(Location || (Location = {}));\n/**\n * The LocationLink namespace provides helper functions to work with\n * [LocationLink](#LocationLink) literals.\n */\nvar LocationLink;\n(function (LocationLink) {\n /**\n * Creates a LocationLink literal.\n * @param targetUri The definition's uri.\n * @param targetRange The full range of the definition.\n * @param targetSelectionRange The span of the symbol definition at the target.\n * @param originSelectionRange The span of the symbol being defined in the originating source file.\n */\n function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\n return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\n }\n LocationLink.create = create;\n /**\n * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\n && Range.is(candidate.targetSelectionRange)\n && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\n }\n LocationLink.is = is;\n})(LocationLink || (LocationLink = {}));\n/**\n * The Color namespace provides helper functions to work with\n * [Color](#Color) literals.\n */\nvar Color;\n(function (Color) {\n /**\n * Creates a new Color literal.\n */\n function create(red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n }\n Color.create = create;\n /**\n * Checks whether the given literal conforms to the [Color](#Color) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1)\n && Is.numberRange(candidate.green, 0, 1)\n && Is.numberRange(candidate.blue, 0, 1)\n && Is.numberRange(candidate.alpha, 0, 1);\n }\n Color.is = is;\n})(Color || (Color = {}));\n/**\n * The ColorInformation namespace provides helper functions to work with\n * [ColorInformation](#ColorInformation) literals.\n */\nvar ColorInformation;\n(function (ColorInformation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(range, color) {\n return {\n range: range,\n color: color,\n };\n }\n ColorInformation.create = create;\n /**\n * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);\n }\n ColorInformation.is = is;\n})(ColorInformation || (ColorInformation = {}));\n/**\n * The Color namespace provides helper functions to work with\n * [ColorPresentation](#ColorPresentation) literals.\n */\nvar ColorPresentation;\n(function (ColorPresentation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(label, textEdit, additionalTextEdits) {\n return {\n label: label,\n textEdit: textEdit,\n additionalTextEdits: additionalTextEdits,\n };\n }\n ColorPresentation.create = create;\n /**\n * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.label)\n && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\n && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\n }\n ColorPresentation.is = is;\n})(ColorPresentation || (ColorPresentation = {}));\n/**\n * A set of predefined range kinds.\n */\nvar FoldingRangeKind;\n(function (FoldingRangeKind) {\n /**\n * Folding range for a comment\n */\n FoldingRangeKind.Comment = 'comment';\n /**\n * Folding range for a imports or includes\n */\n FoldingRangeKind.Imports = 'imports';\n /**\n * Folding range for a region (e.g. `#region`)\n */\n FoldingRangeKind.Region = 'region';\n})(FoldingRangeKind || (FoldingRangeKind = {}));\n/**\n * The folding range namespace provides helper functions to work with\n * [FoldingRange](#FoldingRange) literals.\n */\nvar FoldingRange;\n(function (FoldingRange) {\n /**\n * Creates a new FoldingRange literal.\n */\n function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {\n var result = {\n startLine: startLine,\n endLine: endLine\n };\n if (Is.defined(startCharacter)) {\n result.startCharacter = startCharacter;\n }\n if (Is.defined(endCharacter)) {\n result.endCharacter = endCharacter;\n }\n if (Is.defined(kind)) {\n result.kind = kind;\n }\n if (Is.defined(collapsedText)) {\n result.collapsedText = collapsedText;\n }\n return result;\n }\n FoldingRange.create = create;\n /**\n * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)\n && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))\n && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))\n && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\n }\n FoldingRange.is = is;\n})(FoldingRange || (FoldingRange = {}));\n/**\n * The DiagnosticRelatedInformation namespace provides helper functions to work with\n * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.\n */\nvar DiagnosticRelatedInformation;\n(function (DiagnosticRelatedInformation) {\n /**\n * Creates a new DiagnosticRelatedInformation literal.\n */\n function create(location, message) {\n return {\n location: location,\n message: message\n };\n }\n DiagnosticRelatedInformation.create = create;\n /**\n * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\n }\n DiagnosticRelatedInformation.is = is;\n})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));\n/**\n * The diagnostic's severity.\n */\nvar DiagnosticSeverity;\n(function (DiagnosticSeverity) {\n /**\n * Reports an error.\n */\n DiagnosticSeverity.Error = 1;\n /**\n * Reports a warning.\n */\n DiagnosticSeverity.Warning = 2;\n /**\n * Reports an information.\n */\n DiagnosticSeverity.Information = 3;\n /**\n * Reports a hint.\n */\n DiagnosticSeverity.Hint = 4;\n})(DiagnosticSeverity || (DiagnosticSeverity = {}));\n/**\n * The diagnostic tags.\n *\n * @since 3.15.0\n */\nvar DiagnosticTag;\n(function (DiagnosticTag) {\n /**\n * Unused or unnecessary code.\n *\n * Clients are allowed to render diagnostics with this tag faded out instead of having\n * an error squiggle.\n */\n DiagnosticTag.Unnecessary = 1;\n /**\n * Deprecated or obsolete code.\n *\n * Clients are allowed to rendered diagnostics with this tag strike through.\n */\n DiagnosticTag.Deprecated = 2;\n})(DiagnosticTag || (DiagnosticTag = {}));\n/**\n * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.\n *\n * @since 3.16.0\n */\nvar CodeDescription;\n(function (CodeDescription) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.href);\n }\n CodeDescription.is = is;\n})(CodeDescription || (CodeDescription = {}));\n/**\n * The Diagnostic namespace provides helper functions to work with\n * [Diagnostic](#Diagnostic) literals.\n */\nvar Diagnostic;\n(function (Diagnostic) {\n /**\n * Creates a new Diagnostic literal.\n */\n function create(range, message, severity, code, source, relatedInformation) {\n var result = { range: range, message: message };\n if (Is.defined(severity)) {\n result.severity = severity;\n }\n if (Is.defined(code)) {\n result.code = code;\n }\n if (Is.defined(source)) {\n result.source = source;\n }\n if (Is.defined(relatedInformation)) {\n result.relatedInformation = relatedInformation;\n }\n return result;\n }\n Diagnostic.create = create;\n /**\n * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.\n */\n function is(value) {\n var _a;\n var candidate = value;\n return Is.defined(candidate)\n && Range.is(candidate.range)\n && Is.string(candidate.message)\n && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\n && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\n && (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))\n && (Is.string(candidate.source) || Is.undefined(candidate.source))\n && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\n }\n Diagnostic.is = is;\n})(Diagnostic || (Diagnostic = {}));\n/**\n * The Command namespace provides helper functions to work with\n * [Command](#Command) literals.\n */\nvar Command;\n(function (Command) {\n /**\n * Creates a new Command literal.\n */\n function create(title, command) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var result = { title: title, command: command };\n if (Is.defined(args) && args.length > 0) {\n result.arguments = args;\n }\n return result;\n }\n Command.create = create;\n /**\n * Checks whether the given literal conforms to the [Command](#Command) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\n }\n Command.is = is;\n})(Command || (Command = {}));\n/**\n * The TextEdit namespace provides helper function to create replace,\n * insert and delete edits more easily.\n */\nvar TextEdit;\n(function (TextEdit) {\n /**\n * Creates a replace text edit.\n * @param range The range of text to be replaced.\n * @param newText The new text.\n */\n function replace(range, newText) {\n return { range: range, newText: newText };\n }\n TextEdit.replace = replace;\n /**\n * Creates a insert text edit.\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n */\n function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }\n TextEdit.insert = insert;\n /**\n * Creates a delete text edit.\n * @param range The range of text to be deleted.\n */\n function del(range) {\n return { range: range, newText: '' };\n }\n TextEdit.del = del;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && Is.string(candidate.newText)\n && Range.is(candidate.range);\n }\n TextEdit.is = is;\n})(TextEdit || (TextEdit = {}));\nvar ChangeAnnotation;\n(function (ChangeAnnotation) {\n function create(label, needsConfirmation, description) {\n var result = { label: label };\n if (needsConfirmation !== undefined) {\n result.needsConfirmation = needsConfirmation;\n }\n if (description !== undefined) {\n result.description = description;\n }\n return result;\n }\n ChangeAnnotation.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.label) &&\n (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n ChangeAnnotation.is = is;\n})(ChangeAnnotation || (ChangeAnnotation = {}));\nvar ChangeAnnotationIdentifier;\n(function (ChangeAnnotationIdentifier) {\n function is(value) {\n var candidate = value;\n return Is.string(candidate);\n }\n ChangeAnnotationIdentifier.is = is;\n})(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));\nvar AnnotatedTextEdit;\n(function (AnnotatedTextEdit) {\n /**\n * Creates an annotated replace text edit.\n *\n * @param range The range of text to be replaced.\n * @param newText The new text.\n * @param annotation The annotation.\n */\n function replace(range, newText, annotation) {\n return { range: range, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.replace = replace;\n /**\n * Creates an annotated insert text edit.\n *\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n * @param annotation The annotation.\n */\n function insert(position, newText, annotation) {\n return { range: { start: position, end: position }, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.insert = insert;\n /**\n * Creates an annotated delete text edit.\n *\n * @param range The range of text to be deleted.\n * @param annotation The annotation.\n */\n function del(range, annotation) {\n return { range: range, newText: '', annotationId: annotation };\n }\n AnnotatedTextEdit.del = del;\n function is(value) {\n var candidate = value;\n return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n AnnotatedTextEdit.is = is;\n})(AnnotatedTextEdit || (AnnotatedTextEdit = {}));\n/**\n * The TextDocumentEdit namespace provides helper function to create\n * an edit that manipulates a text document.\n */\nvar TextDocumentEdit;\n(function (TextDocumentEdit) {\n /**\n * Creates a new `TextDocumentEdit`\n */\n function create(textDocument, edits) {\n return { textDocument: textDocument, edits: edits };\n }\n TextDocumentEdit.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate)\n && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)\n && Array.isArray(candidate.edits);\n }\n TextDocumentEdit.is = is;\n})(TextDocumentEdit || (TextDocumentEdit = {}));\nvar CreateFile;\n(function (CreateFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'create',\n uri: uri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n CreateFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n CreateFile.is = is;\n})(CreateFile || (CreateFile = {}));\nvar RenameFile;\n(function (RenameFile) {\n function create(oldUri, newUri, options, annotation) {\n var result = {\n kind: 'rename',\n oldUri: oldUri,\n newUri: newUri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n RenameFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n RenameFile.is = is;\n})(RenameFile || (RenameFile = {}));\nvar DeleteFile;\n(function (DeleteFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'delete',\n uri: uri\n };\n if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n DeleteFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n DeleteFile.is = is;\n})(DeleteFile || (DeleteFile = {}));\nvar WorkspaceEdit;\n(function (WorkspaceEdit) {\n function is(value) {\n var candidate = value;\n return candidate &&\n (candidate.changes !== undefined || candidate.documentChanges !== undefined) &&\n (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {\n if (Is.string(change.kind)) {\n return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\n }\n else {\n return TextDocumentEdit.is(change);\n }\n }));\n }\n WorkspaceEdit.is = is;\n})(WorkspaceEdit || (WorkspaceEdit = {}));\nvar TextEditChangeImpl = /** @class */ (function () {\n function TextEditChangeImpl(edits, changeAnnotations) {\n this.edits = edits;\n this.changeAnnotations = changeAnnotations;\n }\n TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.insert(position, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.insert(position, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.insert(position, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.replace(range, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.replace(range, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.replace(range, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.delete = function (range, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.del(range);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.del(range, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.del(range, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.add = function (edit) {\n this.edits.push(edit);\n };\n TextEditChangeImpl.prototype.all = function () {\n return this.edits;\n };\n TextEditChangeImpl.prototype.clear = function () {\n this.edits.splice(0, this.edits.length);\n };\n TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {\n if (value === undefined) {\n throw new Error(\"Text edit change is not configured to manage change annotations.\");\n }\n };\n return TextEditChangeImpl;\n}());\n/**\n * A helper class\n */\nvar ChangeAnnotations = /** @class */ (function () {\n function ChangeAnnotations(annotations) {\n this._annotations = annotations === undefined ? Object.create(null) : annotations;\n this._counter = 0;\n this._size = 0;\n }\n ChangeAnnotations.prototype.all = function () {\n return this._annotations;\n };\n Object.defineProperty(ChangeAnnotations.prototype, \"size\", {\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {\n var id;\n if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {\n id = idOrAnnotation;\n }\n else {\n id = this.nextId();\n annotation = idOrAnnotation;\n }\n if (this._annotations[id] !== undefined) {\n throw new Error(\"Id \".concat(id, \" is already in use.\"));\n }\n if (annotation === undefined) {\n throw new Error(\"No annotation provided for id \".concat(id));\n }\n this._annotations[id] = annotation;\n this._size++;\n return id;\n };\n ChangeAnnotations.prototype.nextId = function () {\n this._counter++;\n return this._counter.toString();\n };\n return ChangeAnnotations;\n}());\n/**\n * A workspace change helps constructing changes to a workspace.\n */\nvar WorkspaceChange = /** @class */ (function () {\n function WorkspaceChange(workspaceEdit) {\n var _this = this;\n this._textEditChanges = Object.create(null);\n if (workspaceEdit !== undefined) {\n this._workspaceEdit = workspaceEdit;\n if (workspaceEdit.documentChanges) {\n this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);\n workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n workspaceEdit.documentChanges.forEach(function (change) {\n if (TextDocumentEdit.is(change)) {\n var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);\n _this._textEditChanges[change.textDocument.uri] = textEditChange;\n }\n });\n }\n else if (workspaceEdit.changes) {\n Object.keys(workspaceEdit.changes).forEach(function (key) {\n var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\n _this._textEditChanges[key] = textEditChange;\n });\n }\n }\n else {\n this._workspaceEdit = {};\n }\n }\n Object.defineProperty(WorkspaceChange.prototype, \"edit\", {\n /**\n * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal\n * use to be returned from a workspace edit operation like rename.\n */\n get: function () {\n this.initDocumentChanges();\n if (this._changeAnnotations !== undefined) {\n if (this._changeAnnotations.size === 0) {\n this._workspaceEdit.changeAnnotations = undefined;\n }\n else {\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n }\n return this._workspaceEdit;\n },\n enumerable: false,\n configurable: true\n });\n WorkspaceChange.prototype.getTextEditChange = function (key) {\n if (OptionalVersionedTextDocumentIdentifier.is(key)) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var textDocument = { uri: key.uri, version: key.version };\n var result = this._textEditChanges[textDocument.uri];\n if (!result) {\n var edits = [];\n var textDocumentEdit = {\n textDocument: textDocument,\n edits: edits\n };\n this._workspaceEdit.documentChanges.push(textDocumentEdit);\n result = new TextEditChangeImpl(edits, this._changeAnnotations);\n this._textEditChanges[textDocument.uri] = result;\n }\n return result;\n }\n else {\n this.initChanges();\n if (this._workspaceEdit.changes === undefined) {\n throw new Error('Workspace edit is not configured for normal text edit changes.');\n }\n var result = this._textEditChanges[key];\n if (!result) {\n var edits = [];\n this._workspaceEdit.changes[key] = edits;\n result = new TextEditChangeImpl(edits);\n this._textEditChanges[key] = result;\n }\n return result;\n }\n };\n WorkspaceChange.prototype.initDocumentChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._changeAnnotations = new ChangeAnnotations();\n this._workspaceEdit.documentChanges = [];\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n };\n WorkspaceChange.prototype.initChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._workspaceEdit.changes = Object.create(null);\n }\n };\n WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = CreateFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = CreateFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = RenameFile.create(oldUri, newUri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = RenameFile.create(oldUri, newUri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = DeleteFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = DeleteFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n return WorkspaceChange;\n}());\n\n/**\n * The TextDocumentIdentifier namespace provides helper functions to work with\n * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.\n */\nvar TextDocumentIdentifier;\n(function (TextDocumentIdentifier) {\n /**\n * Creates a new TextDocumentIdentifier literal.\n * @param uri The document's uri.\n */\n function create(uri) {\n return { uri: uri };\n }\n TextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }\n TextDocumentIdentifier.is = is;\n})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));\n/**\n * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\n * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.\n */\nvar VersionedTextDocumentIdentifier;\n(function (VersionedTextDocumentIdentifier) {\n /**\n * Creates a new VersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param version The document's version.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n VersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);\n }\n VersionedTextDocumentIdentifier.is = is;\n})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));\n/**\n * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with\n * [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) literals.\n */\nvar OptionalVersionedTextDocumentIdentifier;\n(function (OptionalVersionedTextDocumentIdentifier) {\n /**\n * Creates a new OptionalVersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param version The document's version.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n OptionalVersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));\n }\n OptionalVersionedTextDocumentIdentifier.is = is;\n})(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));\n/**\n * The TextDocumentItem namespace provides helper functions to work with\n * [TextDocumentItem](#TextDocumentItem) literals.\n */\nvar TextDocumentItem;\n(function (TextDocumentItem) {\n /**\n * Creates a new TextDocumentItem literal.\n * @param uri The document's uri.\n * @param languageId The document's language identifier.\n * @param version The document's version number.\n * @param text The document's text.\n */\n function create(uri, languageId, version, text) {\n return { uri: uri, languageId: languageId, version: version, text: text };\n }\n TextDocumentItem.create = create;\n /**\n * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);\n }\n TextDocumentItem.is = is;\n})(TextDocumentItem || (TextDocumentItem = {}));\n/**\n * Describes the content type that a client supports in various\n * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n *\n * Please note that `MarkupKinds` must not start with a `$`. This kinds\n * are reserved for internal usage.\n */\nvar MarkupKind;\n(function (MarkupKind) {\n /**\n * Plain text is supported as a content format\n */\n MarkupKind.PlainText = 'plaintext';\n /**\n * Markdown is supported as a content format\n */\n MarkupKind.Markdown = 'markdown';\n /**\n * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.\n */\n function is(value) {\n var candidate = value;\n return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\n }\n MarkupKind.is = is;\n})(MarkupKind || (MarkupKind = {}));\nvar MarkupContent;\n(function (MarkupContent) {\n /**\n * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }\n MarkupContent.is = is;\n})(MarkupContent || (MarkupContent = {}));\n/**\n * The kind of a completion entry.\n */\nvar CompletionItemKind;\n(function (CompletionItemKind) {\n CompletionItemKind.Text = 1;\n CompletionItemKind.Method = 2;\n CompletionItemKind.Function = 3;\n CompletionItemKind.Constructor = 4;\n CompletionItemKind.Field = 5;\n CompletionItemKind.Variable = 6;\n CompletionItemKind.Class = 7;\n CompletionItemKind.Interface = 8;\n CompletionItemKind.Module = 9;\n CompletionItemKind.Property = 10;\n CompletionItemKind.Unit = 11;\n CompletionItemKind.Value = 12;\n CompletionItemKind.Enum = 13;\n CompletionItemKind.Keyword = 14;\n CompletionItemKind.Snippet = 15;\n CompletionItemKind.Color = 16;\n CompletionItemKind.File = 17;\n CompletionItemKind.Reference = 18;\n CompletionItemKind.Folder = 19;\n CompletionItemKind.EnumMember = 20;\n CompletionItemKind.Constant = 21;\n CompletionItemKind.Struct = 22;\n CompletionItemKind.Event = 23;\n CompletionItemKind.Operator = 24;\n CompletionItemKind.TypeParameter = 25;\n})(CompletionItemKind || (CompletionItemKind = {}));\n/**\n * Defines whether the insert text in a completion item should be interpreted as\n * plain text or a snippet.\n */\nvar InsertTextFormat;\n(function (InsertTextFormat) {\n /**\n * The primary text to be inserted is treated as a plain string.\n */\n InsertTextFormat.PlainText = 1;\n /**\n * The primary text to be inserted is treated as a snippet.\n *\n * A snippet can define tab stops and placeholders with `$1`, `$2`\n * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\n * the end of the snippet. Placeholders with equal identifiers are linked,\n * that is typing in one will update others too.\n *\n * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax\n */\n InsertTextFormat.Snippet = 2;\n})(InsertTextFormat || (InsertTextFormat = {}));\n/**\n * Completion item tags are extra annotations that tweak the rendering of a completion\n * item.\n *\n * @since 3.15.0\n */\nvar CompletionItemTag;\n(function (CompletionItemTag) {\n /**\n * Render a completion as obsolete, usually using a strike-out.\n */\n CompletionItemTag.Deprecated = 1;\n})(CompletionItemTag || (CompletionItemTag = {}));\n/**\n * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.\n *\n * @since 3.16.0\n */\nvar InsertReplaceEdit;\n(function (InsertReplaceEdit) {\n /**\n * Creates a new insert / replace edit\n */\n function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }\n InsertReplaceEdit.create = create;\n /**\n * Checks whether the given literal conforms to the [InsertReplaceEdit](#InsertReplaceEdit) interface.\n */\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);\n }\n InsertReplaceEdit.is = is;\n})(InsertReplaceEdit || (InsertReplaceEdit = {}));\n/**\n * How whitespace and indentation is handled during completion\n * item insertion.\n *\n * @since 3.16.0\n */\nvar InsertTextMode;\n(function (InsertTextMode) {\n /**\n * The insertion or replace strings is taken as it is. If the\n * value is multi line the lines below the cursor will be\n * inserted using the indentation defined in the string value.\n * The client will not apply any kind of adjustments to the\n * string.\n */\n InsertTextMode.asIs = 1;\n /**\n * The editor adjusts leading whitespace of new lines so that\n * they match the indentation up to the cursor of the line for\n * which the item is accepted.\n *\n * Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a\n * multi line completion item is indented using 2 tabs and all\n * following lines inserted will be indented using 2 tabs as well.\n */\n InsertTextMode.adjustIndentation = 2;\n})(InsertTextMode || (InsertTextMode = {}));\nvar CompletionItemLabelDetails;\n(function (CompletionItemLabelDetails) {\n function is(value) {\n var candidate = value;\n return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n CompletionItemLabelDetails.is = is;\n})(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));\n/**\n * The CompletionItem namespace provides functions to deal with\n * completion items.\n */\nvar CompletionItem;\n(function (CompletionItem) {\n /**\n * Create a completion item and seed it with a label.\n * @param label The completion item's label\n */\n function create(label) {\n return { label: label };\n }\n CompletionItem.create = create;\n})(CompletionItem || (CompletionItem = {}));\n/**\n * The CompletionList namespace provides functions to deal with\n * completion lists.\n */\nvar CompletionList;\n(function (CompletionList) {\n /**\n * Creates a new completion list.\n *\n * @param items The completion items.\n * @param isIncomplete The list is not complete.\n */\n function create(items, isIncomplete) {\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\n }\n CompletionList.create = create;\n})(CompletionList || (CompletionList = {}));\nvar MarkedString;\n(function (MarkedString) {\n /**\n * Creates a marked string from plain text.\n *\n * @param plainText The plain text.\n */\n function fromPlainText(plainText) {\n return plainText.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n }\n MarkedString.fromPlainText = fromPlainText;\n /**\n * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.\n */\n function is(value) {\n var candidate = value;\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\n }\n MarkedString.is = is;\n})(MarkedString || (MarkedString = {}));\nvar Hover;\n(function (Hover) {\n /**\n * Checks whether the given value conforms to the [Hover](#Hover) interface.\n */\n function is(value) {\n var candidate = value;\n return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\n MarkedString.is(candidate.contents) ||\n Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));\n }\n Hover.is = is;\n})(Hover || (Hover = {}));\n/**\n * The ParameterInformation namespace provides helper functions to work with\n * [ParameterInformation](#ParameterInformation) literals.\n */\nvar ParameterInformation;\n(function (ParameterInformation) {\n /**\n * Creates a new parameter information literal.\n *\n * @param label A label string.\n * @param documentation A doc string.\n */\n function create(label, documentation) {\n return documentation ? { label: label, documentation: documentation } : { label: label };\n }\n ParameterInformation.create = create;\n})(ParameterInformation || (ParameterInformation = {}));\n/**\n * The SignatureInformation namespace provides helper functions to work with\n * [SignatureInformation](#SignatureInformation) literals.\n */\nvar SignatureInformation;\n(function (SignatureInformation) {\n function create(label, documentation) {\n var parameters = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n parameters[_i - 2] = arguments[_i];\n }\n var result = { label: label };\n if (Is.defined(documentation)) {\n result.documentation = documentation;\n }\n if (Is.defined(parameters)) {\n result.parameters = parameters;\n }\n else {\n result.parameters = [];\n }\n return result;\n }\n SignatureInformation.create = create;\n})(SignatureInformation || (SignatureInformation = {}));\n/**\n * A document highlight kind.\n */\nvar DocumentHighlightKind;\n(function (DocumentHighlightKind) {\n /**\n * A textual occurrence.\n */\n DocumentHighlightKind.Text = 1;\n /**\n * Read-access of a symbol, like reading a variable.\n */\n DocumentHighlightKind.Read = 2;\n /**\n * Write-access of a symbol, like writing to a variable.\n */\n DocumentHighlightKind.Write = 3;\n})(DocumentHighlightKind || (DocumentHighlightKind = {}));\n/**\n * DocumentHighlight namespace to provide helper functions to work with\n * [DocumentHighlight](#DocumentHighlight) literals.\n */\nvar DocumentHighlight;\n(function (DocumentHighlight) {\n /**\n * Create a DocumentHighlight object.\n * @param range The range the highlight applies to.\n * @param kind The highlight kind\n */\n function create(range, kind) {\n var result = { range: range };\n if (Is.number(kind)) {\n result.kind = kind;\n }\n return result;\n }\n DocumentHighlight.create = create;\n})(DocumentHighlight || (DocumentHighlight = {}));\n/**\n * A symbol kind.\n */\nvar SymbolKind;\n(function (SymbolKind) {\n SymbolKind.File = 1;\n SymbolKind.Module = 2;\n SymbolKind.Namespace = 3;\n SymbolKind.Package = 4;\n SymbolKind.Class = 5;\n SymbolKind.Method = 6;\n SymbolKind.Property = 7;\n SymbolKind.Field = 8;\n SymbolKind.Constructor = 9;\n SymbolKind.Enum = 10;\n SymbolKind.Interface = 11;\n SymbolKind.Function = 12;\n SymbolKind.Variable = 13;\n SymbolKind.Constant = 14;\n SymbolKind.String = 15;\n SymbolKind.Number = 16;\n SymbolKind.Boolean = 17;\n SymbolKind.Array = 18;\n SymbolKind.Object = 19;\n SymbolKind.Key = 20;\n SymbolKind.Null = 21;\n SymbolKind.EnumMember = 22;\n SymbolKind.Struct = 23;\n SymbolKind.Event = 24;\n SymbolKind.Operator = 25;\n SymbolKind.TypeParameter = 26;\n})(SymbolKind || (SymbolKind = {}));\n/**\n * Symbol tags are extra annotations that tweak the rendering of a symbol.\n * @since 3.16\n */\nvar SymbolTag;\n(function (SymbolTag) {\n /**\n * Render a symbol as obsolete, usually using a strike-out.\n */\n SymbolTag.Deprecated = 1;\n})(SymbolTag || (SymbolTag = {}));\nvar SymbolInformation;\n(function (SymbolInformation) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the location of the symbol.\n * @param uri The resource of the location of symbol.\n * @param containerName The name of the symbol containing the symbol.\n */\n function create(name, kind, range, uri, containerName) {\n var result = {\n name: name,\n kind: kind,\n location: { uri: uri, range: range }\n };\n if (containerName) {\n result.containerName = containerName;\n }\n return result;\n }\n SymbolInformation.create = create;\n})(SymbolInformation || (SymbolInformation = {}));\nvar WorkspaceSymbol;\n(function (WorkspaceSymbol) {\n /**\n * Create a new workspace symbol.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param uri The resource of the location of the symbol.\n * @param range An options range of the location.\n * @returns A WorkspaceSymbol.\n */\n function create(name, kind, uri, range) {\n return range !== undefined\n ? { name: name, kind: kind, location: { uri: uri, range: range } }\n : { name: name, kind: kind, location: { uri: uri } };\n }\n WorkspaceSymbol.create = create;\n})(WorkspaceSymbol || (WorkspaceSymbol = {}));\nvar DocumentSymbol;\n(function (DocumentSymbol) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param detail The detail of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the symbol.\n * @param selectionRange The selectionRange of the symbol.\n * @param children Children of the symbol.\n */\n function create(name, detail, kind, range, selectionRange, children) {\n var result = {\n name: name,\n detail: detail,\n kind: kind,\n range: range,\n selectionRange: selectionRange\n };\n if (children !== undefined) {\n result.children = children;\n }\n return result;\n }\n DocumentSymbol.create = create;\n /**\n * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.\n */\n function is(value) {\n var candidate = value;\n return candidate &&\n Is.string(candidate.name) && Is.number(candidate.kind) &&\n Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\n (candidate.detail === undefined || Is.string(candidate.detail)) &&\n (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&\n (candidate.children === undefined || Array.isArray(candidate.children)) &&\n (candidate.tags === undefined || Array.isArray(candidate.tags));\n }\n DocumentSymbol.is = is;\n})(DocumentSymbol || (DocumentSymbol = {}));\n/**\n * A set of predefined code action kinds\n */\nvar CodeActionKind;\n(function (CodeActionKind) {\n /**\n * Empty kind.\n */\n CodeActionKind.Empty = '';\n /**\n * Base kind for quickfix actions: 'quickfix'\n */\n CodeActionKind.QuickFix = 'quickfix';\n /**\n * Base kind for refactoring actions: 'refactor'\n */\n CodeActionKind.Refactor = 'refactor';\n /**\n * Base kind for refactoring extraction actions: 'refactor.extract'\n *\n * Example extract actions:\n *\n * - Extract method\n * - Extract function\n * - Extract variable\n * - Extract interface from class\n * - ...\n */\n CodeActionKind.RefactorExtract = 'refactor.extract';\n /**\n * Base kind for refactoring inline actions: 'refactor.inline'\n *\n * Example inline actions:\n *\n * - Inline function\n * - Inline variable\n * - Inline constant\n * - ...\n */\n CodeActionKind.RefactorInline = 'refactor.inline';\n /**\n * Base kind for refactoring rewrite actions: 'refactor.rewrite'\n *\n * Example rewrite actions:\n *\n * - Convert JavaScript function to class\n * - Add or remove parameter\n * - Encapsulate field\n * - Make method static\n * - Move method to base class\n * - ...\n */\n CodeActionKind.RefactorRewrite = 'refactor.rewrite';\n /**\n * Base kind for source actions: `source`\n *\n * Source code actions apply to the entire file.\n */\n CodeActionKind.Source = 'source';\n /**\n * Base kind for an organize imports source action: `source.organizeImports`\n */\n CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\n /**\n * Base kind for auto-fix source actions: `source.fixAll`.\n *\n * Fix all actions automatically fix errors that have a clear fix that do not require user input.\n * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\n *\n * @since 3.15.0\n */\n CodeActionKind.SourceFixAll = 'source.fixAll';\n})(CodeActionKind || (CodeActionKind = {}));\n/**\n * The reason why code actions were requested.\n *\n * @since 3.17.0\n */\nvar CodeActionTriggerKind;\n(function (CodeActionTriggerKind) {\n /**\n * Code actions were explicitly requested by the user or by an extension.\n */\n CodeActionTriggerKind.Invoked = 1;\n /**\n * Code actions were requested automatically.\n *\n * This typically happens when current selection in a file changes, but can\n * also be triggered when file content changes.\n */\n CodeActionTriggerKind.Automatic = 2;\n})(CodeActionTriggerKind || (CodeActionTriggerKind = {}));\n/**\n * The CodeActionContext namespace provides helper functions to work with\n * [CodeActionContext](#CodeActionContext) literals.\n */\nvar CodeActionContext;\n(function (CodeActionContext) {\n /**\n * Creates a new CodeActionContext literal.\n */\n function create(diagnostics, only, triggerKind) {\n var result = { diagnostics: diagnostics };\n if (only !== undefined && only !== null) {\n result.only = only;\n }\n if (triggerKind !== undefined && triggerKind !== null) {\n result.triggerKind = triggerKind;\n }\n return result;\n }\n CodeActionContext.create = create;\n /**\n * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is)\n && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string))\n && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);\n }\n CodeActionContext.is = is;\n})(CodeActionContext || (CodeActionContext = {}));\nvar CodeAction;\n(function (CodeAction) {\n function create(title, kindOrCommandOrEdit, kind) {\n var result = { title: title };\n var checkKind = true;\n if (typeof kindOrCommandOrEdit === 'string') {\n checkKind = false;\n result.kind = kindOrCommandOrEdit;\n }\n else if (Command.is(kindOrCommandOrEdit)) {\n result.command = kindOrCommandOrEdit;\n }\n else {\n result.edit = kindOrCommandOrEdit;\n }\n if (checkKind && kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n CodeAction.create = create;\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.title) &&\n (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\n (candidate.kind === undefined || Is.string(candidate.kind)) &&\n (candidate.edit !== undefined || candidate.command !== undefined) &&\n (candidate.command === undefined || Command.is(candidate.command)) &&\n (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&\n (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));\n }\n CodeAction.is = is;\n})(CodeAction || (CodeAction = {}));\n/**\n * The CodeLens namespace provides helper functions to work with\n * [CodeLens](#CodeLens) literals.\n */\nvar CodeLens;\n(function (CodeLens) {\n /**\n * Creates a new CodeLens literal.\n */\n function create(range, data) {\n var result = { range: range };\n if (Is.defined(data)) {\n result.data = data;\n }\n return result;\n }\n CodeLens.create = create;\n /**\n * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\n }\n CodeLens.is = is;\n})(CodeLens || (CodeLens = {}));\n/**\n * The FormattingOptions namespace provides helper functions to work with\n * [FormattingOptions](#FormattingOptions) literals.\n */\nvar FormattingOptions;\n(function (FormattingOptions) {\n /**\n * Creates a new FormattingOptions literal.\n */\n function create(tabSize, insertSpaces) {\n return { tabSize: tabSize, insertSpaces: insertSpaces };\n }\n FormattingOptions.create = create;\n /**\n * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\n }\n FormattingOptions.is = is;\n})(FormattingOptions || (FormattingOptions = {}));\n/**\n * The DocumentLink namespace provides helper functions to work with\n * [DocumentLink](#DocumentLink) literals.\n */\nvar DocumentLink;\n(function (DocumentLink) {\n /**\n * Creates a new DocumentLink literal.\n */\n function create(range, target, data) {\n return { range: range, target: target, data: data };\n }\n DocumentLink.create = create;\n /**\n * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\n }\n DocumentLink.is = is;\n})(DocumentLink || (DocumentLink = {}));\n/**\n * The SelectionRange namespace provides helper function to work with\n * SelectionRange literals.\n */\nvar SelectionRange;\n(function (SelectionRange) {\n /**\n * Creates a new SelectionRange\n * @param range the range.\n * @param parent an optional parent.\n */\n function create(range, parent) {\n return { range: range, parent: parent };\n }\n SelectionRange.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\n }\n SelectionRange.is = is;\n})(SelectionRange || (SelectionRange = {}));\n/**\n * A set of predefined token types. This set is not fixed\n * an clients can specify additional token types via the\n * corresponding client capabilities.\n *\n * @since 3.16.0\n */\nvar SemanticTokenTypes;\n(function (SemanticTokenTypes) {\n SemanticTokenTypes[\"namespace\"] = \"namespace\";\n /**\n * Represents a generic type. Acts as a fallback for types which can't be mapped to\n * a specific type like class or enum.\n */\n SemanticTokenTypes[\"type\"] = \"type\";\n SemanticTokenTypes[\"class\"] = \"class\";\n SemanticTokenTypes[\"enum\"] = \"enum\";\n SemanticTokenTypes[\"interface\"] = \"interface\";\n SemanticTokenTypes[\"struct\"] = \"struct\";\n SemanticTokenTypes[\"typeParameter\"] = \"typeParameter\";\n SemanticTokenTypes[\"parameter\"] = \"parameter\";\n SemanticTokenTypes[\"variable\"] = \"variable\";\n SemanticTokenTypes[\"property\"] = \"property\";\n SemanticTokenTypes[\"enumMember\"] = \"enumMember\";\n SemanticTokenTypes[\"event\"] = \"event\";\n SemanticTokenTypes[\"function\"] = \"function\";\n SemanticTokenTypes[\"method\"] = \"method\";\n SemanticTokenTypes[\"macro\"] = \"macro\";\n SemanticTokenTypes[\"keyword\"] = \"keyword\";\n SemanticTokenTypes[\"modifier\"] = \"modifier\";\n SemanticTokenTypes[\"comment\"] = \"comment\";\n SemanticTokenTypes[\"string\"] = \"string\";\n SemanticTokenTypes[\"number\"] = \"number\";\n SemanticTokenTypes[\"regexp\"] = \"regexp\";\n SemanticTokenTypes[\"operator\"] = \"operator\";\n /**\n * @since 3.17.0\n */\n SemanticTokenTypes[\"decorator\"] = \"decorator\";\n})(SemanticTokenTypes || (SemanticTokenTypes = {}));\n/**\n * A set of predefined token modifiers. This set is not fixed\n * an clients can specify additional token types via the\n * corresponding client capabilities.\n *\n * @since 3.16.0\n */\nvar SemanticTokenModifiers;\n(function (SemanticTokenModifiers) {\n SemanticTokenModifiers[\"declaration\"] = \"declaration\";\n SemanticTokenModifiers[\"definition\"] = \"definition\";\n SemanticTokenModifiers[\"readonly\"] = \"readonly\";\n SemanticTokenModifiers[\"static\"] = \"static\";\n SemanticTokenModifiers[\"deprecated\"] = \"deprecated\";\n SemanticTokenModifiers[\"abstract\"] = \"abstract\";\n SemanticTokenModifiers[\"async\"] = \"async\";\n SemanticTokenModifiers[\"modification\"] = \"modification\";\n SemanticTokenModifiers[\"documentation\"] = \"documentation\";\n SemanticTokenModifiers[\"defaultLibrary\"] = \"defaultLibrary\";\n})(SemanticTokenModifiers || (SemanticTokenModifiers = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokens;\n(function (SemanticTokens) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&\n Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');\n }\n SemanticTokens.is = is;\n})(SemanticTokens || (SemanticTokens = {}));\n/**\n * The InlineValueText namespace provides functions to deal with InlineValueTexts.\n *\n * @since 3.17.0\n */\nvar InlineValueText;\n(function (InlineValueText) {\n /**\n * Creates a new InlineValueText literal.\n */\n function create(range, text) {\n return { range: range, text: text };\n }\n InlineValueText.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);\n }\n InlineValueText.is = is;\n})(InlineValueText || (InlineValueText = {}));\n/**\n * The InlineValueVariableLookup namespace provides functions to deal with InlineValueVariableLookups.\n *\n * @since 3.17.0\n */\nvar InlineValueVariableLookup;\n(function (InlineValueVariableLookup) {\n /**\n * Creates a new InlineValueText literal.\n */\n function create(range, variableName, caseSensitiveLookup) {\n return { range: range, variableName: variableName, caseSensitiveLookup: caseSensitiveLookup };\n }\n InlineValueVariableLookup.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup)\n && (Is.string(candidate.variableName) || candidate.variableName === undefined);\n }\n InlineValueVariableLookup.is = is;\n})(InlineValueVariableLookup || (InlineValueVariableLookup = {}));\n/**\n * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression.\n *\n * @since 3.17.0\n */\nvar InlineValueEvaluatableExpression;\n(function (InlineValueEvaluatableExpression) {\n /**\n * Creates a new InlineValueEvaluatableExpression literal.\n */\n function create(range, expression) {\n return { range: range, expression: expression };\n }\n InlineValueEvaluatableExpression.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range)\n && (Is.string(candidate.expression) || candidate.expression === undefined);\n }\n InlineValueEvaluatableExpression.is = is;\n})(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));\n/**\n * The InlineValueContext namespace provides helper functions to work with\n * [InlineValueContext](#InlineValueContext) literals.\n *\n * @since 3.17.0\n */\nvar InlineValueContext;\n(function (InlineValueContext) {\n /**\n * Creates a new InlineValueContext literal.\n */\n function create(frameId, stoppedLocation) {\n return { frameId: frameId, stoppedLocation: stoppedLocation };\n }\n InlineValueContext.create = create;\n /**\n * Checks whether the given literal conforms to the [InlineValueContext](#InlineValueContext) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(value.stoppedLocation);\n }\n InlineValueContext.is = is;\n})(InlineValueContext || (InlineValueContext = {}));\n/**\n * Inlay hint kinds.\n *\n * @since 3.17.0\n */\nvar InlayHintKind;\n(function (InlayHintKind) {\n /**\n * An inlay hint that for a type annotation.\n */\n InlayHintKind.Type = 1;\n /**\n * An inlay hint that is for a parameter.\n */\n InlayHintKind.Parameter = 2;\n function is(value) {\n return value === 1 || value === 2;\n }\n InlayHintKind.is = is;\n})(InlayHintKind || (InlayHintKind = {}));\nvar InlayHintLabelPart;\n(function (InlayHintLabelPart) {\n function create(value) {\n return { value: value };\n }\n InlayHintLabelPart.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))\n && (candidate.location === undefined || Location.is(candidate.location))\n && (candidate.command === undefined || Command.is(candidate.command));\n }\n InlayHintLabelPart.is = is;\n})(InlayHintLabelPart || (InlayHintLabelPart = {}));\nvar InlayHint;\n(function (InlayHint) {\n function create(position, label, kind) {\n var result = { position: position, label: label };\n if (kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n InlayHint.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.position)\n && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is))\n && (candidate.kind === undefined || InlayHintKind.is(candidate.kind))\n && (candidate.textEdits === undefined) || Is.typedArray(candidate.textEdits, TextEdit.is)\n && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))\n && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft))\n && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight));\n }\n InlayHint.is = is;\n})(InlayHint || (InlayHint = {}));\nvar WorkspaceFolder;\n(function (WorkspaceFolder) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);\n }\n WorkspaceFolder.is = is;\n})(WorkspaceFolder || (WorkspaceFolder = {}));\nvar EOL = ['\\n', '\\r\\n', '\\r'];\n/**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\nvar TextDocument;\n(function (TextDocument) {\n /**\n * Creates a new ITextDocument literal from the given uri and content.\n * @param uri The document's uri.\n * @param languageId The document's language Id.\n * @param version The document's version.\n * @param content The document's content.\n */\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument.create = create;\n /**\n * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }\n TextDocument.is = is;\n function applyEdits(document, edits) {\n var text = document.getText();\n var sortedEdits = mergeSort(edits, function (a, b) {\n var diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n var lastModifiedOffset = text.length;\n for (var i = sortedEdits.length - 1; i >= 0; i--) {\n var e = sortedEdits[i];\n var startOffset = document.offsetAt(e.range.start);\n var endOffset = document.offsetAt(e.range.end);\n if (endOffset <= lastModifiedOffset) {\n text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\n }\n else {\n throw new Error('Overlapping edit');\n }\n lastModifiedOffset = startOffset;\n }\n return text;\n }\n TextDocument.applyEdits = applyEdits;\n function mergeSort(data, compare) {\n if (data.length <= 1) {\n // sorted\n return data;\n }\n var p = (data.length / 2) | 0;\n var left = data.slice(0, p);\n var right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n var leftIdx = 0;\n var rightIdx = 0;\n var i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n var ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n // smaller_equal -> take left to preserve order\n data[i++] = left[leftIdx++];\n }\n else {\n // greater -> take right\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n }\n})(TextDocument || (TextDocument = {}));\n/**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\nvar FullTextDocument = /** @class */ (function () {\n function FullTextDocument(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = undefined;\n }\n Object.defineProperty(FullTextDocument.prototype, \"uri\", {\n get: function () {\n return this._uri;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"languageId\", {\n get: function () {\n return this._languageId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"version\", {\n get: function () {\n return this._version;\n },\n enumerable: false,\n configurable: true\n });\n FullTextDocument.prototype.getText = function (range) {\n if (range) {\n var start = this.offsetAt(range.start);\n var end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n };\n FullTextDocument.prototype.update = function (event, version) {\n this._content = event.text;\n this._version = version;\n this._lineOffsets = undefined;\n };\n FullTextDocument.prototype.getLineOffsets = function () {\n if (this._lineOffsets === undefined) {\n var lineOffsets = [];\n var text = this._content;\n var isLineStart = true;\n for (var i = 0; i < text.length; i++) {\n if (isLineStart) {\n lineOffsets.push(i);\n isLineStart = false;\n }\n var ch = text.charAt(i);\n isLineStart = (ch === '\\r' || ch === '\\n');\n if (ch === '\\r' && i + 1 < text.length && text.charAt(i + 1) === '\\n') {\n i++;\n }\n }\n if (isLineStart && text.length > 0) {\n lineOffsets.push(text.length);\n }\n this._lineOffsets = lineOffsets;\n }\n return this._lineOffsets;\n };\n FullTextDocument.prototype.positionAt = function (offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n var lineOffsets = this.getLineOffsets();\n var low = 0, high = lineOffsets.length;\n if (high === 0) {\n return Position.create(0, offset);\n }\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n // low is the least x for which the line offset is larger than the current offset\n // or array.length if no line offset is larger than the current offset\n var line = low - 1;\n return Position.create(line, offset - lineOffsets[line]);\n };\n FullTextDocument.prototype.offsetAt = function (position) {\n var lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n }\n else if (position.line < 0) {\n return 0;\n }\n var lineOffset = lineOffsets[position.line];\n var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\n };\n Object.defineProperty(FullTextDocument.prototype, \"lineCount\", {\n get: function () {\n return this.getLineOffsets().length;\n },\n enumerable: false,\n configurable: true\n });\n return FullTextDocument;\n}());\nvar Is;\n(function (Is) {\n var toString = Object.prototype.toString;\n function defined(value) {\n return typeof value !== 'undefined';\n }\n Is.defined = defined;\n function undefined(value) {\n return typeof value === 'undefined';\n }\n Is.undefined = undefined;\n function boolean(value) {\n return value === true || value === false;\n }\n Is.boolean = boolean;\n function string(value) {\n return toString.call(value) === '[object String]';\n }\n Is.string = string;\n function number(value) {\n return toString.call(value) === '[object Number]';\n }\n Is.number = number;\n function numberRange(value, min, max) {\n return toString.call(value) === '[object Number]' && min <= value && value <= max;\n }\n Is.numberRange = numberRange;\n function integer(value) {\n return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;\n }\n Is.integer = integer;\n function uinteger(value) {\n return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;\n }\n Is.uinteger = uinteger;\n function func(value) {\n return toString.call(value) === '[object Function]';\n }\n Is.func = func;\n function objectLiteral(value) {\n // Strictly speaking class instances pass this check as well. Since the LSP\n // doesn't use classes we ignore this for now. If we do we need to add something\n // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\n return value !== null && typeof value === 'object';\n }\n Is.objectLiteral = objectLiteral;\n function typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n }\n Is.typedArray = typedArray;\n})(Is || (Is = {}));\n\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/vscode-languageserver-types/lib/esm/main.js?");
13418
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AnnotatedTextEdit\": () => (/* binding */ AnnotatedTextEdit),\n/* harmony export */ \"ChangeAnnotation\": () => (/* binding */ ChangeAnnotation),\n/* harmony export */ \"ChangeAnnotationIdentifier\": () => (/* binding */ ChangeAnnotationIdentifier),\n/* harmony export */ \"CodeAction\": () => (/* binding */ CodeAction),\n/* harmony export */ \"CodeActionContext\": () => (/* binding */ CodeActionContext),\n/* harmony export */ \"CodeActionKind\": () => (/* binding */ CodeActionKind),\n/* harmony export */ \"CodeActionTriggerKind\": () => (/* binding */ CodeActionTriggerKind),\n/* harmony export */ \"CodeDescription\": () => (/* binding */ CodeDescription),\n/* harmony export */ \"CodeLens\": () => (/* binding */ CodeLens),\n/* harmony export */ \"Color\": () => (/* binding */ Color),\n/* harmony export */ \"ColorInformation\": () => (/* binding */ ColorInformation),\n/* harmony export */ \"ColorPresentation\": () => (/* binding */ ColorPresentation),\n/* harmony export */ \"Command\": () => (/* binding */ Command),\n/* harmony export */ \"CompletionItem\": () => (/* binding */ CompletionItem),\n/* harmony export */ \"CompletionItemKind\": () => (/* binding */ CompletionItemKind),\n/* harmony export */ \"CompletionItemLabelDetails\": () => (/* binding */ CompletionItemLabelDetails),\n/* harmony export */ \"CompletionItemTag\": () => (/* binding */ CompletionItemTag),\n/* harmony export */ \"CompletionList\": () => (/* binding */ CompletionList),\n/* harmony export */ \"CreateFile\": () => (/* binding */ CreateFile),\n/* harmony export */ \"DeleteFile\": () => (/* binding */ DeleteFile),\n/* harmony export */ \"Diagnostic\": () => (/* binding */ Diagnostic),\n/* harmony export */ \"DiagnosticRelatedInformation\": () => (/* binding */ DiagnosticRelatedInformation),\n/* harmony export */ \"DiagnosticSeverity\": () => (/* binding */ DiagnosticSeverity),\n/* harmony export */ \"DiagnosticTag\": () => (/* binding */ DiagnosticTag),\n/* harmony export */ \"DocumentHighlight\": () => (/* binding */ DocumentHighlight),\n/* harmony export */ \"DocumentHighlightKind\": () => (/* binding */ DocumentHighlightKind),\n/* harmony export */ \"DocumentLink\": () => (/* binding */ DocumentLink),\n/* harmony export */ \"DocumentSymbol\": () => (/* binding */ DocumentSymbol),\n/* harmony export */ \"DocumentUri\": () => (/* binding */ DocumentUri),\n/* harmony export */ \"EOL\": () => (/* binding */ EOL),\n/* harmony export */ \"FoldingRange\": () => (/* binding */ FoldingRange),\n/* harmony export */ \"FoldingRangeKind\": () => (/* binding */ FoldingRangeKind),\n/* harmony export */ \"FormattingOptions\": () => (/* binding */ FormattingOptions),\n/* harmony export */ \"Hover\": () => (/* binding */ Hover),\n/* harmony export */ \"InlayHint\": () => (/* binding */ InlayHint),\n/* harmony export */ \"InlayHintKind\": () => (/* binding */ InlayHintKind),\n/* harmony export */ \"InlayHintLabelPart\": () => (/* binding */ InlayHintLabelPart),\n/* harmony export */ \"InlineValueContext\": () => (/* binding */ InlineValueContext),\n/* harmony export */ \"InlineValueEvaluatableExpression\": () => (/* binding */ InlineValueEvaluatableExpression),\n/* harmony export */ \"InlineValueText\": () => (/* binding */ InlineValueText),\n/* harmony export */ \"InlineValueVariableLookup\": () => (/* binding */ InlineValueVariableLookup),\n/* harmony export */ \"InsertReplaceEdit\": () => (/* binding */ InsertReplaceEdit),\n/* harmony export */ \"InsertTextFormat\": () => (/* binding */ InsertTextFormat),\n/* harmony export */ \"InsertTextMode\": () => (/* binding */ InsertTextMode),\n/* harmony export */ \"Location\": () => (/* binding */ Location),\n/* harmony export */ \"LocationLink\": () => (/* binding */ LocationLink),\n/* harmony export */ \"MarkedString\": () => (/* binding */ MarkedString),\n/* harmony export */ \"MarkupContent\": () => (/* binding */ MarkupContent),\n/* harmony export */ \"MarkupKind\": () => (/* binding */ MarkupKind),\n/* harmony export */ \"OptionalVersionedTextDocumentIdentifier\": () => (/* binding */ OptionalVersionedTextDocumentIdentifier),\n/* harmony export */ \"ParameterInformation\": () => (/* binding */ ParameterInformation),\n/* harmony export */ \"Position\": () => (/* binding */ Position),\n/* harmony export */ \"Range\": () => (/* binding */ Range),\n/* harmony export */ \"RenameFile\": () => (/* binding */ RenameFile),\n/* harmony export */ \"SelectionRange\": () => (/* binding */ SelectionRange),\n/* harmony export */ \"SemanticTokenModifiers\": () => (/* binding */ SemanticTokenModifiers),\n/* harmony export */ \"SemanticTokenTypes\": () => (/* binding */ SemanticTokenTypes),\n/* harmony export */ \"SemanticTokens\": () => (/* binding */ SemanticTokens),\n/* harmony export */ \"SignatureInformation\": () => (/* binding */ SignatureInformation),\n/* harmony export */ \"SymbolInformation\": () => (/* binding */ SymbolInformation),\n/* harmony export */ \"SymbolKind\": () => (/* binding */ SymbolKind),\n/* harmony export */ \"SymbolTag\": () => (/* binding */ SymbolTag),\n/* harmony export */ \"TextDocument\": () => (/* binding */ TextDocument),\n/* harmony export */ \"TextDocumentEdit\": () => (/* binding */ TextDocumentEdit),\n/* harmony export */ \"TextDocumentIdentifier\": () => (/* binding */ TextDocumentIdentifier),\n/* harmony export */ \"TextDocumentItem\": () => (/* binding */ TextDocumentItem),\n/* harmony export */ \"TextEdit\": () => (/* binding */ TextEdit),\n/* harmony export */ \"URI\": () => (/* binding */ URI),\n/* harmony export */ \"VersionedTextDocumentIdentifier\": () => (/* binding */ VersionedTextDocumentIdentifier),\n/* harmony export */ \"WorkspaceChange\": () => (/* binding */ WorkspaceChange),\n/* harmony export */ \"WorkspaceEdit\": () => (/* binding */ WorkspaceEdit),\n/* harmony export */ \"WorkspaceFolder\": () => (/* binding */ WorkspaceFolder),\n/* harmony export */ \"WorkspaceSymbol\": () => (/* binding */ WorkspaceSymbol),\n/* harmony export */ \"integer\": () => (/* binding */ integer),\n/* harmony export */ \"uinteger\": () => (/* binding */ uinteger)\n/* harmony export */ });\n/* --------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n * ------------------------------------------------------------------------------------------ */\n\nvar DocumentUri;\n(function (DocumentUri) {\n function is(value) {\n return typeof value === 'string';\n }\n DocumentUri.is = is;\n})(DocumentUri || (DocumentUri = {}));\nvar URI;\n(function (URI) {\n function is(value) {\n return typeof value === 'string';\n }\n URI.is = is;\n})(URI || (URI = {}));\nvar integer;\n(function (integer) {\n integer.MIN_VALUE = -2147483648;\n integer.MAX_VALUE = 2147483647;\n function is(value) {\n return typeof value === 'number' && integer.MIN_VALUE <= value && value <= integer.MAX_VALUE;\n }\n integer.is = is;\n})(integer || (integer = {}));\nvar uinteger;\n(function (uinteger) {\n uinteger.MIN_VALUE = 0;\n uinteger.MAX_VALUE = 2147483647;\n function is(value) {\n return typeof value === 'number' && uinteger.MIN_VALUE <= value && value <= uinteger.MAX_VALUE;\n }\n uinteger.is = is;\n})(uinteger || (uinteger = {}));\n/**\n * The Position namespace provides helper functions to work with\n * [Position](#Position) literals.\n */\nvar Position;\n(function (Position) {\n /**\n * Creates a new Position literal from the given line and character.\n * @param line The position's line.\n * @param character The position's character.\n */\n function create(line, character) {\n if (line === Number.MAX_VALUE) {\n line = uinteger.MAX_VALUE;\n }\n if (character === Number.MAX_VALUE) {\n character = uinteger.MAX_VALUE;\n }\n return { line: line, character: character };\n }\n Position.create = create;\n /**\n * Checks whether the given literal conforms to the [Position](#Position) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.line) && Is.uinteger(candidate.character);\n }\n Position.is = is;\n})(Position || (Position = {}));\n/**\n * The Range namespace provides helper functions to work with\n * [Range](#Range) literals.\n */\nvar Range;\n(function (Range) {\n function create(one, two, three, four) {\n if (Is.uinteger(one) && Is.uinteger(two) && Is.uinteger(three) && Is.uinteger(four)) {\n return { start: Position.create(one, two), end: Position.create(three, four) };\n }\n else if (Position.is(one) && Position.is(two)) {\n return { start: one, end: two };\n }\n else {\n throw new Error(\"Range#create called with invalid arguments[\".concat(one, \", \").concat(two, \", \").concat(three, \", \").concat(four, \"]\"));\n }\n }\n Range.create = create;\n /**\n * Checks whether the given literal conforms to the [Range](#Range) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.start) && Position.is(candidate.end);\n }\n Range.is = is;\n})(Range || (Range = {}));\n/**\n * The Location namespace provides helper functions to work with\n * [Location](#Location) literals.\n */\nvar Location;\n(function (Location) {\n /**\n * Creates a Location literal.\n * @param uri The location's uri.\n * @param range The location's range.\n */\n function create(uri, range) {\n return { uri: uri, range: range };\n }\n Location.create = create;\n /**\n * Checks whether the given literal conforms to the [Location](#Location) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && (Is.string(candidate.uri) || Is.undefined(candidate.uri));\n }\n Location.is = is;\n})(Location || (Location = {}));\n/**\n * The LocationLink namespace provides helper functions to work with\n * [LocationLink](#LocationLink) literals.\n */\nvar LocationLink;\n(function (LocationLink) {\n /**\n * Creates a LocationLink literal.\n * @param targetUri The definition's uri.\n * @param targetRange The full range of the definition.\n * @param targetSelectionRange The span of the symbol definition at the target.\n * @param originSelectionRange The span of the symbol being defined in the originating source file.\n */\n function create(targetUri, targetRange, targetSelectionRange, originSelectionRange) {\n return { targetUri: targetUri, targetRange: targetRange, targetSelectionRange: targetSelectionRange, originSelectionRange: originSelectionRange };\n }\n LocationLink.create = create;\n /**\n * Checks whether the given literal conforms to the [LocationLink](#LocationLink) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.targetRange) && Is.string(candidate.targetUri)\n && Range.is(candidate.targetSelectionRange)\n && (Range.is(candidate.originSelectionRange) || Is.undefined(candidate.originSelectionRange));\n }\n LocationLink.is = is;\n})(LocationLink || (LocationLink = {}));\n/**\n * The Color namespace provides helper functions to work with\n * [Color](#Color) literals.\n */\nvar Color;\n(function (Color) {\n /**\n * Creates a new Color literal.\n */\n function create(red, green, blue, alpha) {\n return {\n red: red,\n green: green,\n blue: blue,\n alpha: alpha,\n };\n }\n Color.create = create;\n /**\n * Checks whether the given literal conforms to the [Color](#Color) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.numberRange(candidate.red, 0, 1)\n && Is.numberRange(candidate.green, 0, 1)\n && Is.numberRange(candidate.blue, 0, 1)\n && Is.numberRange(candidate.alpha, 0, 1);\n }\n Color.is = is;\n})(Color || (Color = {}));\n/**\n * The ColorInformation namespace provides helper functions to work with\n * [ColorInformation](#ColorInformation) literals.\n */\nvar ColorInformation;\n(function (ColorInformation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(range, color) {\n return {\n range: range,\n color: color,\n };\n }\n ColorInformation.create = create;\n /**\n * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && Color.is(candidate.color);\n }\n ColorInformation.is = is;\n})(ColorInformation || (ColorInformation = {}));\n/**\n * The Color namespace provides helper functions to work with\n * [ColorPresentation](#ColorPresentation) literals.\n */\nvar ColorPresentation;\n(function (ColorPresentation) {\n /**\n * Creates a new ColorInformation literal.\n */\n function create(label, textEdit, additionalTextEdits) {\n return {\n label: label,\n textEdit: textEdit,\n additionalTextEdits: additionalTextEdits,\n };\n }\n ColorPresentation.create = create;\n /**\n * Checks whether the given literal conforms to the [ColorInformation](#ColorInformation) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.label)\n && (Is.undefined(candidate.textEdit) || TextEdit.is(candidate))\n && (Is.undefined(candidate.additionalTextEdits) || Is.typedArray(candidate.additionalTextEdits, TextEdit.is));\n }\n ColorPresentation.is = is;\n})(ColorPresentation || (ColorPresentation = {}));\n/**\n * A set of predefined range kinds.\n */\nvar FoldingRangeKind;\n(function (FoldingRangeKind) {\n /**\n * Folding range for a comment\n */\n FoldingRangeKind.Comment = 'comment';\n /**\n * Folding range for an import or include\n */\n FoldingRangeKind.Imports = 'imports';\n /**\n * Folding range for a region (e.g. `#region`)\n */\n FoldingRangeKind.Region = 'region';\n})(FoldingRangeKind || (FoldingRangeKind = {}));\n/**\n * The folding range namespace provides helper functions to work with\n * [FoldingRange](#FoldingRange) literals.\n */\nvar FoldingRange;\n(function (FoldingRange) {\n /**\n * Creates a new FoldingRange literal.\n */\n function create(startLine, endLine, startCharacter, endCharacter, kind, collapsedText) {\n var result = {\n startLine: startLine,\n endLine: endLine\n };\n if (Is.defined(startCharacter)) {\n result.startCharacter = startCharacter;\n }\n if (Is.defined(endCharacter)) {\n result.endCharacter = endCharacter;\n }\n if (Is.defined(kind)) {\n result.kind = kind;\n }\n if (Is.defined(collapsedText)) {\n result.collapsedText = collapsedText;\n }\n return result;\n }\n FoldingRange.create = create;\n /**\n * Checks whether the given literal conforms to the [FoldingRange](#FoldingRange) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.uinteger(candidate.startLine) && Is.uinteger(candidate.startLine)\n && (Is.undefined(candidate.startCharacter) || Is.uinteger(candidate.startCharacter))\n && (Is.undefined(candidate.endCharacter) || Is.uinteger(candidate.endCharacter))\n && (Is.undefined(candidate.kind) || Is.string(candidate.kind));\n }\n FoldingRange.is = is;\n})(FoldingRange || (FoldingRange = {}));\n/**\n * The DiagnosticRelatedInformation namespace provides helper functions to work with\n * [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) literals.\n */\nvar DiagnosticRelatedInformation;\n(function (DiagnosticRelatedInformation) {\n /**\n * Creates a new DiagnosticRelatedInformation literal.\n */\n function create(location, message) {\n return {\n location: location,\n message: message\n };\n }\n DiagnosticRelatedInformation.create = create;\n /**\n * Checks whether the given literal conforms to the [DiagnosticRelatedInformation](#DiagnosticRelatedInformation) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Location.is(candidate.location) && Is.string(candidate.message);\n }\n DiagnosticRelatedInformation.is = is;\n})(DiagnosticRelatedInformation || (DiagnosticRelatedInformation = {}));\n/**\n * The diagnostic's severity.\n */\nvar DiagnosticSeverity;\n(function (DiagnosticSeverity) {\n /**\n * Reports an error.\n */\n DiagnosticSeverity.Error = 1;\n /**\n * Reports a warning.\n */\n DiagnosticSeverity.Warning = 2;\n /**\n * Reports an information.\n */\n DiagnosticSeverity.Information = 3;\n /**\n * Reports a hint.\n */\n DiagnosticSeverity.Hint = 4;\n})(DiagnosticSeverity || (DiagnosticSeverity = {}));\n/**\n * The diagnostic tags.\n *\n * @since 3.15.0\n */\nvar DiagnosticTag;\n(function (DiagnosticTag) {\n /**\n * Unused or unnecessary code.\n *\n * Clients are allowed to render diagnostics with this tag faded out instead of having\n * an error squiggle.\n */\n DiagnosticTag.Unnecessary = 1;\n /**\n * Deprecated or obsolete code.\n *\n * Clients are allowed to rendered diagnostics with this tag strike through.\n */\n DiagnosticTag.Deprecated = 2;\n})(DiagnosticTag || (DiagnosticTag = {}));\n/**\n * The CodeDescription namespace provides functions to deal with descriptions for diagnostic codes.\n *\n * @since 3.16.0\n */\nvar CodeDescription;\n(function (CodeDescription) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.href);\n }\n CodeDescription.is = is;\n})(CodeDescription || (CodeDescription = {}));\n/**\n * The Diagnostic namespace provides helper functions to work with\n * [Diagnostic](#Diagnostic) literals.\n */\nvar Diagnostic;\n(function (Diagnostic) {\n /**\n * Creates a new Diagnostic literal.\n */\n function create(range, message, severity, code, source, relatedInformation) {\n var result = { range: range, message: message };\n if (Is.defined(severity)) {\n result.severity = severity;\n }\n if (Is.defined(code)) {\n result.code = code;\n }\n if (Is.defined(source)) {\n result.source = source;\n }\n if (Is.defined(relatedInformation)) {\n result.relatedInformation = relatedInformation;\n }\n return result;\n }\n Diagnostic.create = create;\n /**\n * Checks whether the given literal conforms to the [Diagnostic](#Diagnostic) interface.\n */\n function is(value) {\n var _a;\n var candidate = value;\n return Is.defined(candidate)\n && Range.is(candidate.range)\n && Is.string(candidate.message)\n && (Is.number(candidate.severity) || Is.undefined(candidate.severity))\n && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code))\n && (Is.undefined(candidate.codeDescription) || (Is.string((_a = candidate.codeDescription) === null || _a === void 0 ? void 0 : _a.href)))\n && (Is.string(candidate.source) || Is.undefined(candidate.source))\n && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));\n }\n Diagnostic.is = is;\n})(Diagnostic || (Diagnostic = {}));\n/**\n * The Command namespace provides helper functions to work with\n * [Command](#Command) literals.\n */\nvar Command;\n(function (Command) {\n /**\n * Creates a new Command literal.\n */\n function create(title, command) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var result = { title: title, command: command };\n if (Is.defined(args) && args.length > 0) {\n result.arguments = args;\n }\n return result;\n }\n Command.create = create;\n /**\n * Checks whether the given literal conforms to the [Command](#Command) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.title) && Is.string(candidate.command);\n }\n Command.is = is;\n})(Command || (Command = {}));\n/**\n * The TextEdit namespace provides helper function to create replace,\n * insert and delete edits more easily.\n */\nvar TextEdit;\n(function (TextEdit) {\n /**\n * Creates a replace text edit.\n * @param range The range of text to be replaced.\n * @param newText The new text.\n */\n function replace(range, newText) {\n return { range: range, newText: newText };\n }\n TextEdit.replace = replace;\n /**\n * Creates an insert text edit.\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n */\n function insert(position, newText) {\n return { range: { start: position, end: position }, newText: newText };\n }\n TextEdit.insert = insert;\n /**\n * Creates a delete text edit.\n * @param range The range of text to be deleted.\n */\n function del(range) {\n return { range: range, newText: '' };\n }\n TextEdit.del = del;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && Is.string(candidate.newText)\n && Range.is(candidate.range);\n }\n TextEdit.is = is;\n})(TextEdit || (TextEdit = {}));\nvar ChangeAnnotation;\n(function (ChangeAnnotation) {\n function create(label, needsConfirmation, description) {\n var result = { label: label };\n if (needsConfirmation !== undefined) {\n result.needsConfirmation = needsConfirmation;\n }\n if (description !== undefined) {\n result.description = description;\n }\n return result;\n }\n ChangeAnnotation.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Is.string(candidate.label) &&\n (Is.boolean(candidate.needsConfirmation) || candidate.needsConfirmation === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n ChangeAnnotation.is = is;\n})(ChangeAnnotation || (ChangeAnnotation = {}));\nvar ChangeAnnotationIdentifier;\n(function (ChangeAnnotationIdentifier) {\n function is(value) {\n var candidate = value;\n return Is.string(candidate);\n }\n ChangeAnnotationIdentifier.is = is;\n})(ChangeAnnotationIdentifier || (ChangeAnnotationIdentifier = {}));\nvar AnnotatedTextEdit;\n(function (AnnotatedTextEdit) {\n /**\n * Creates an annotated replace text edit.\n *\n * @param range The range of text to be replaced.\n * @param newText The new text.\n * @param annotation The annotation.\n */\n function replace(range, newText, annotation) {\n return { range: range, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.replace = replace;\n /**\n * Creates an annotated insert text edit.\n *\n * @param position The position to insert the text at.\n * @param newText The text to be inserted.\n * @param annotation The annotation.\n */\n function insert(position, newText, annotation) {\n return { range: { start: position, end: position }, newText: newText, annotationId: annotation };\n }\n AnnotatedTextEdit.insert = insert;\n /**\n * Creates an annotated delete text edit.\n *\n * @param range The range of text to be deleted.\n * @param annotation The annotation.\n */\n function del(range, annotation) {\n return { range: range, newText: '', annotationId: annotation };\n }\n AnnotatedTextEdit.del = del;\n function is(value) {\n var candidate = value;\n return TextEdit.is(candidate) && (ChangeAnnotation.is(candidate.annotationId) || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n AnnotatedTextEdit.is = is;\n})(AnnotatedTextEdit || (AnnotatedTextEdit = {}));\n/**\n * The TextDocumentEdit namespace provides helper function to create\n * an edit that manipulates a text document.\n */\nvar TextDocumentEdit;\n(function (TextDocumentEdit) {\n /**\n * Creates a new `TextDocumentEdit`\n */\n function create(textDocument, edits) {\n return { textDocument: textDocument, edits: edits };\n }\n TextDocumentEdit.create = create;\n function is(value) {\n var candidate = value;\n return Is.defined(candidate)\n && OptionalVersionedTextDocumentIdentifier.is(candidate.textDocument)\n && Array.isArray(candidate.edits);\n }\n TextDocumentEdit.is = is;\n})(TextDocumentEdit || (TextDocumentEdit = {}));\nvar CreateFile;\n(function (CreateFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'create',\n uri: uri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n CreateFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'create' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n CreateFile.is = is;\n})(CreateFile || (CreateFile = {}));\nvar RenameFile;\n(function (RenameFile) {\n function create(oldUri, newUri, options, annotation) {\n var result = {\n kind: 'rename',\n oldUri: oldUri,\n newUri: newUri\n };\n if (options !== undefined && (options.overwrite !== undefined || options.ignoreIfExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n RenameFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'rename' && Is.string(candidate.oldUri) && Is.string(candidate.newUri) && (candidate.options === undefined ||\n ((candidate.options.overwrite === undefined || Is.boolean(candidate.options.overwrite)) && (candidate.options.ignoreIfExists === undefined || Is.boolean(candidate.options.ignoreIfExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n RenameFile.is = is;\n})(RenameFile || (RenameFile = {}));\nvar DeleteFile;\n(function (DeleteFile) {\n function create(uri, options, annotation) {\n var result = {\n kind: 'delete',\n uri: uri\n };\n if (options !== undefined && (options.recursive !== undefined || options.ignoreIfNotExists !== undefined)) {\n result.options = options;\n }\n if (annotation !== undefined) {\n result.annotationId = annotation;\n }\n return result;\n }\n DeleteFile.create = create;\n function is(value) {\n var candidate = value;\n return candidate && candidate.kind === 'delete' && Is.string(candidate.uri) && (candidate.options === undefined ||\n ((candidate.options.recursive === undefined || Is.boolean(candidate.options.recursive)) && (candidate.options.ignoreIfNotExists === undefined || Is.boolean(candidate.options.ignoreIfNotExists)))) && (candidate.annotationId === undefined || ChangeAnnotationIdentifier.is(candidate.annotationId));\n }\n DeleteFile.is = is;\n})(DeleteFile || (DeleteFile = {}));\nvar WorkspaceEdit;\n(function (WorkspaceEdit) {\n function is(value) {\n var candidate = value;\n return candidate &&\n (candidate.changes !== undefined || candidate.documentChanges !== undefined) &&\n (candidate.documentChanges === undefined || candidate.documentChanges.every(function (change) {\n if (Is.string(change.kind)) {\n return CreateFile.is(change) || RenameFile.is(change) || DeleteFile.is(change);\n }\n else {\n return TextDocumentEdit.is(change);\n }\n }));\n }\n WorkspaceEdit.is = is;\n})(WorkspaceEdit || (WorkspaceEdit = {}));\nvar TextEditChangeImpl = /** @class */ (function () {\n function TextEditChangeImpl(edits, changeAnnotations) {\n this.edits = edits;\n this.changeAnnotations = changeAnnotations;\n }\n TextEditChangeImpl.prototype.insert = function (position, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.insert(position, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.insert(position, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.insert(position, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.replace = function (range, newText, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.replace(range, newText);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.replace(range, newText, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.replace(range, newText, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.delete = function (range, annotation) {\n var edit;\n var id;\n if (annotation === undefined) {\n edit = TextEdit.del(range);\n }\n else if (ChangeAnnotationIdentifier.is(annotation)) {\n id = annotation;\n edit = AnnotatedTextEdit.del(range, annotation);\n }\n else {\n this.assertChangeAnnotations(this.changeAnnotations);\n id = this.changeAnnotations.manage(annotation);\n edit = AnnotatedTextEdit.del(range, id);\n }\n this.edits.push(edit);\n if (id !== undefined) {\n return id;\n }\n };\n TextEditChangeImpl.prototype.add = function (edit) {\n this.edits.push(edit);\n };\n TextEditChangeImpl.prototype.all = function () {\n return this.edits;\n };\n TextEditChangeImpl.prototype.clear = function () {\n this.edits.splice(0, this.edits.length);\n };\n TextEditChangeImpl.prototype.assertChangeAnnotations = function (value) {\n if (value === undefined) {\n throw new Error(\"Text edit change is not configured to manage change annotations.\");\n }\n };\n return TextEditChangeImpl;\n}());\n/**\n * A helper class\n */\nvar ChangeAnnotations = /** @class */ (function () {\n function ChangeAnnotations(annotations) {\n this._annotations = annotations === undefined ? Object.create(null) : annotations;\n this._counter = 0;\n this._size = 0;\n }\n ChangeAnnotations.prototype.all = function () {\n return this._annotations;\n };\n Object.defineProperty(ChangeAnnotations.prototype, \"size\", {\n get: function () {\n return this._size;\n },\n enumerable: false,\n configurable: true\n });\n ChangeAnnotations.prototype.manage = function (idOrAnnotation, annotation) {\n var id;\n if (ChangeAnnotationIdentifier.is(idOrAnnotation)) {\n id = idOrAnnotation;\n }\n else {\n id = this.nextId();\n annotation = idOrAnnotation;\n }\n if (this._annotations[id] !== undefined) {\n throw new Error(\"Id \".concat(id, \" is already in use.\"));\n }\n if (annotation === undefined) {\n throw new Error(\"No annotation provided for id \".concat(id));\n }\n this._annotations[id] = annotation;\n this._size++;\n return id;\n };\n ChangeAnnotations.prototype.nextId = function () {\n this._counter++;\n return this._counter.toString();\n };\n return ChangeAnnotations;\n}());\n/**\n * A workspace change helps constructing changes to a workspace.\n */\nvar WorkspaceChange = /** @class */ (function () {\n function WorkspaceChange(workspaceEdit) {\n var _this = this;\n this._textEditChanges = Object.create(null);\n if (workspaceEdit !== undefined) {\n this._workspaceEdit = workspaceEdit;\n if (workspaceEdit.documentChanges) {\n this._changeAnnotations = new ChangeAnnotations(workspaceEdit.changeAnnotations);\n workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n workspaceEdit.documentChanges.forEach(function (change) {\n if (TextDocumentEdit.is(change)) {\n var textEditChange = new TextEditChangeImpl(change.edits, _this._changeAnnotations);\n _this._textEditChanges[change.textDocument.uri] = textEditChange;\n }\n });\n }\n else if (workspaceEdit.changes) {\n Object.keys(workspaceEdit.changes).forEach(function (key) {\n var textEditChange = new TextEditChangeImpl(workspaceEdit.changes[key]);\n _this._textEditChanges[key] = textEditChange;\n });\n }\n }\n else {\n this._workspaceEdit = {};\n }\n }\n Object.defineProperty(WorkspaceChange.prototype, \"edit\", {\n /**\n * Returns the underlying [WorkspaceEdit](#WorkspaceEdit) literal\n * use to be returned from a workspace edit operation like rename.\n */\n get: function () {\n this.initDocumentChanges();\n if (this._changeAnnotations !== undefined) {\n if (this._changeAnnotations.size === 0) {\n this._workspaceEdit.changeAnnotations = undefined;\n }\n else {\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n }\n return this._workspaceEdit;\n },\n enumerable: false,\n configurable: true\n });\n WorkspaceChange.prototype.getTextEditChange = function (key) {\n if (OptionalVersionedTextDocumentIdentifier.is(key)) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var textDocument = { uri: key.uri, version: key.version };\n var result = this._textEditChanges[textDocument.uri];\n if (!result) {\n var edits = [];\n var textDocumentEdit = {\n textDocument: textDocument,\n edits: edits\n };\n this._workspaceEdit.documentChanges.push(textDocumentEdit);\n result = new TextEditChangeImpl(edits, this._changeAnnotations);\n this._textEditChanges[textDocument.uri] = result;\n }\n return result;\n }\n else {\n this.initChanges();\n if (this._workspaceEdit.changes === undefined) {\n throw new Error('Workspace edit is not configured for normal text edit changes.');\n }\n var result = this._textEditChanges[key];\n if (!result) {\n var edits = [];\n this._workspaceEdit.changes[key] = edits;\n result = new TextEditChangeImpl(edits);\n this._textEditChanges[key] = result;\n }\n return result;\n }\n };\n WorkspaceChange.prototype.initDocumentChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._changeAnnotations = new ChangeAnnotations();\n this._workspaceEdit.documentChanges = [];\n this._workspaceEdit.changeAnnotations = this._changeAnnotations.all();\n }\n };\n WorkspaceChange.prototype.initChanges = function () {\n if (this._workspaceEdit.documentChanges === undefined && this._workspaceEdit.changes === undefined) {\n this._workspaceEdit.changes = Object.create(null);\n }\n };\n WorkspaceChange.prototype.createFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = CreateFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = CreateFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.renameFile = function (oldUri, newUri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = RenameFile.create(oldUri, newUri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = RenameFile.create(oldUri, newUri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n WorkspaceChange.prototype.deleteFile = function (uri, optionsOrAnnotation, options) {\n this.initDocumentChanges();\n if (this._workspaceEdit.documentChanges === undefined) {\n throw new Error('Workspace edit is not configured for document changes.');\n }\n var annotation;\n if (ChangeAnnotation.is(optionsOrAnnotation) || ChangeAnnotationIdentifier.is(optionsOrAnnotation)) {\n annotation = optionsOrAnnotation;\n }\n else {\n options = optionsOrAnnotation;\n }\n var operation;\n var id;\n if (annotation === undefined) {\n operation = DeleteFile.create(uri, options);\n }\n else {\n id = ChangeAnnotationIdentifier.is(annotation) ? annotation : this._changeAnnotations.manage(annotation);\n operation = DeleteFile.create(uri, options, id);\n }\n this._workspaceEdit.documentChanges.push(operation);\n if (id !== undefined) {\n return id;\n }\n };\n return WorkspaceChange;\n}());\n\n/**\n * The TextDocumentIdentifier namespace provides helper functions to work with\n * [TextDocumentIdentifier](#TextDocumentIdentifier) literals.\n */\nvar TextDocumentIdentifier;\n(function (TextDocumentIdentifier) {\n /**\n * Creates a new TextDocumentIdentifier literal.\n * @param uri The document's uri.\n */\n function create(uri) {\n return { uri: uri };\n }\n TextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the [TextDocumentIdentifier](#TextDocumentIdentifier) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri);\n }\n TextDocumentIdentifier.is = is;\n})(TextDocumentIdentifier || (TextDocumentIdentifier = {}));\n/**\n * The VersionedTextDocumentIdentifier namespace provides helper functions to work with\n * [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) literals.\n */\nvar VersionedTextDocumentIdentifier;\n(function (VersionedTextDocumentIdentifier) {\n /**\n * Creates a new VersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param version The document's version.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n VersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the [VersionedTextDocumentIdentifier](#VersionedTextDocumentIdentifier) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.integer(candidate.version);\n }\n VersionedTextDocumentIdentifier.is = is;\n})(VersionedTextDocumentIdentifier || (VersionedTextDocumentIdentifier = {}));\n/**\n * The OptionalVersionedTextDocumentIdentifier namespace provides helper functions to work with\n * [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) literals.\n */\nvar OptionalVersionedTextDocumentIdentifier;\n(function (OptionalVersionedTextDocumentIdentifier) {\n /**\n * Creates a new OptionalVersionedTextDocumentIdentifier literal.\n * @param uri The document's uri.\n * @param version The document's version.\n */\n function create(uri, version) {\n return { uri: uri, version: version };\n }\n OptionalVersionedTextDocumentIdentifier.create = create;\n /**\n * Checks whether the given literal conforms to the [OptionalVersionedTextDocumentIdentifier](#OptionalVersionedTextDocumentIdentifier) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (candidate.version === null || Is.integer(candidate.version));\n }\n OptionalVersionedTextDocumentIdentifier.is = is;\n})(OptionalVersionedTextDocumentIdentifier || (OptionalVersionedTextDocumentIdentifier = {}));\n/**\n * The TextDocumentItem namespace provides helper functions to work with\n * [TextDocumentItem](#TextDocumentItem) literals.\n */\nvar TextDocumentItem;\n(function (TextDocumentItem) {\n /**\n * Creates a new TextDocumentItem literal.\n * @param uri The document's uri.\n * @param languageId The document's language identifier.\n * @param version The document's version number.\n * @param text The document's text.\n */\n function create(uri, languageId, version, text) {\n return { uri: uri, languageId: languageId, version: version, text: text };\n }\n TextDocumentItem.create = create;\n /**\n * Checks whether the given literal conforms to the [TextDocumentItem](#TextDocumentItem) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && Is.string(candidate.languageId) && Is.integer(candidate.version) && Is.string(candidate.text);\n }\n TextDocumentItem.is = is;\n})(TextDocumentItem || (TextDocumentItem = {}));\n/**\n * Describes the content type that a client supports in various\n * result literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n *\n * Please note that `MarkupKinds` must not start with a `$`. This kinds\n * are reserved for internal usage.\n */\nvar MarkupKind;\n(function (MarkupKind) {\n /**\n * Plain text is supported as a content format\n */\n MarkupKind.PlainText = 'plaintext';\n /**\n * Markdown is supported as a content format\n */\n MarkupKind.Markdown = 'markdown';\n /**\n * Checks whether the given value is a value of the [MarkupKind](#MarkupKind) type.\n */\n function is(value) {\n var candidate = value;\n return candidate === MarkupKind.PlainText || candidate === MarkupKind.Markdown;\n }\n MarkupKind.is = is;\n})(MarkupKind || (MarkupKind = {}));\nvar MarkupContent;\n(function (MarkupContent) {\n /**\n * Checks whether the given value conforms to the [MarkupContent](#MarkupContent) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(value) && MarkupKind.is(candidate.kind) && Is.string(candidate.value);\n }\n MarkupContent.is = is;\n})(MarkupContent || (MarkupContent = {}));\n/**\n * The kind of a completion entry.\n */\nvar CompletionItemKind;\n(function (CompletionItemKind) {\n CompletionItemKind.Text = 1;\n CompletionItemKind.Method = 2;\n CompletionItemKind.Function = 3;\n CompletionItemKind.Constructor = 4;\n CompletionItemKind.Field = 5;\n CompletionItemKind.Variable = 6;\n CompletionItemKind.Class = 7;\n CompletionItemKind.Interface = 8;\n CompletionItemKind.Module = 9;\n CompletionItemKind.Property = 10;\n CompletionItemKind.Unit = 11;\n CompletionItemKind.Value = 12;\n CompletionItemKind.Enum = 13;\n CompletionItemKind.Keyword = 14;\n CompletionItemKind.Snippet = 15;\n CompletionItemKind.Color = 16;\n CompletionItemKind.File = 17;\n CompletionItemKind.Reference = 18;\n CompletionItemKind.Folder = 19;\n CompletionItemKind.EnumMember = 20;\n CompletionItemKind.Constant = 21;\n CompletionItemKind.Struct = 22;\n CompletionItemKind.Event = 23;\n CompletionItemKind.Operator = 24;\n CompletionItemKind.TypeParameter = 25;\n})(CompletionItemKind || (CompletionItemKind = {}));\n/**\n * Defines whether the insert text in a completion item should be interpreted as\n * plain text or a snippet.\n */\nvar InsertTextFormat;\n(function (InsertTextFormat) {\n /**\n * The primary text to be inserted is treated as a plain string.\n */\n InsertTextFormat.PlainText = 1;\n /**\n * The primary text to be inserted is treated as a snippet.\n *\n * A snippet can define tab stops and placeholders with `$1`, `$2`\n * and `${3:foo}`. `$0` defines the final tab stop, it defaults to\n * the end of the snippet. Placeholders with equal identifiers are linked,\n * that is typing in one will update others too.\n *\n * See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax\n */\n InsertTextFormat.Snippet = 2;\n})(InsertTextFormat || (InsertTextFormat = {}));\n/**\n * Completion item tags are extra annotations that tweak the rendering of a completion\n * item.\n *\n * @since 3.15.0\n */\nvar CompletionItemTag;\n(function (CompletionItemTag) {\n /**\n * Render a completion as obsolete, usually using a strike-out.\n */\n CompletionItemTag.Deprecated = 1;\n})(CompletionItemTag || (CompletionItemTag = {}));\n/**\n * The InsertReplaceEdit namespace provides functions to deal with insert / replace edits.\n *\n * @since 3.16.0\n */\nvar InsertReplaceEdit;\n(function (InsertReplaceEdit) {\n /**\n * Creates a new insert / replace edit\n */\n function create(newText, insert, replace) {\n return { newText: newText, insert: insert, replace: replace };\n }\n InsertReplaceEdit.create = create;\n /**\n * Checks whether the given literal conforms to the [InsertReplaceEdit](#InsertReplaceEdit) interface.\n */\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.newText) && Range.is(candidate.insert) && Range.is(candidate.replace);\n }\n InsertReplaceEdit.is = is;\n})(InsertReplaceEdit || (InsertReplaceEdit = {}));\n/**\n * How whitespace and indentation is handled during completion\n * item insertion.\n *\n * @since 3.16.0\n */\nvar InsertTextMode;\n(function (InsertTextMode) {\n /**\n * The insertion or replace strings is taken as it is. If the\n * value is multi line the lines below the cursor will be\n * inserted using the indentation defined in the string value.\n * The client will not apply any kind of adjustments to the\n * string.\n */\n InsertTextMode.asIs = 1;\n /**\n * The editor adjusts leading whitespace of new lines so that\n * they match the indentation up to the cursor of the line for\n * which the item is accepted.\n *\n * Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a\n * multi line completion item is indented using 2 tabs and all\n * following lines inserted will be indented using 2 tabs as well.\n */\n InsertTextMode.adjustIndentation = 2;\n})(InsertTextMode || (InsertTextMode = {}));\nvar CompletionItemLabelDetails;\n(function (CompletionItemLabelDetails) {\n function is(value) {\n var candidate = value;\n return candidate && (Is.string(candidate.detail) || candidate.detail === undefined) &&\n (Is.string(candidate.description) || candidate.description === undefined);\n }\n CompletionItemLabelDetails.is = is;\n})(CompletionItemLabelDetails || (CompletionItemLabelDetails = {}));\n/**\n * The CompletionItem namespace provides functions to deal with\n * completion items.\n */\nvar CompletionItem;\n(function (CompletionItem) {\n /**\n * Create a completion item and seed it with a label.\n * @param label The completion item's label\n */\n function create(label) {\n return { label: label };\n }\n CompletionItem.create = create;\n})(CompletionItem || (CompletionItem = {}));\n/**\n * The CompletionList namespace provides functions to deal with\n * completion lists.\n */\nvar CompletionList;\n(function (CompletionList) {\n /**\n * Creates a new completion list.\n *\n * @param items The completion items.\n * @param isIncomplete The list is not complete.\n */\n function create(items, isIncomplete) {\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\n }\n CompletionList.create = create;\n})(CompletionList || (CompletionList = {}));\nvar MarkedString;\n(function (MarkedString) {\n /**\n * Creates a marked string from plain text.\n *\n * @param plainText The plain text.\n */\n function fromPlainText(plainText) {\n return plainText.replace(/[\\\\`*_{}[\\]()#+\\-.!]/g, '\\\\$&'); // escape markdown syntax tokens: http://daringfireball.net/projects/markdown/syntax#backslash\n }\n MarkedString.fromPlainText = fromPlainText;\n /**\n * Checks whether the given value conforms to the [MarkedString](#MarkedString) type.\n */\n function is(value) {\n var candidate = value;\n return Is.string(candidate) || (Is.objectLiteral(candidate) && Is.string(candidate.language) && Is.string(candidate.value));\n }\n MarkedString.is = is;\n})(MarkedString || (MarkedString = {}));\nvar Hover;\n(function (Hover) {\n /**\n * Checks whether the given value conforms to the [Hover](#Hover) interface.\n */\n function is(value) {\n var candidate = value;\n return !!candidate && Is.objectLiteral(candidate) && (MarkupContent.is(candidate.contents) ||\n MarkedString.is(candidate.contents) ||\n Is.typedArray(candidate.contents, MarkedString.is)) && (value.range === undefined || Range.is(value.range));\n }\n Hover.is = is;\n})(Hover || (Hover = {}));\n/**\n * The ParameterInformation namespace provides helper functions to work with\n * [ParameterInformation](#ParameterInformation) literals.\n */\nvar ParameterInformation;\n(function (ParameterInformation) {\n /**\n * Creates a new parameter information literal.\n *\n * @param label A label string.\n * @param documentation A doc string.\n */\n function create(label, documentation) {\n return documentation ? { label: label, documentation: documentation } : { label: label };\n }\n ParameterInformation.create = create;\n})(ParameterInformation || (ParameterInformation = {}));\n/**\n * The SignatureInformation namespace provides helper functions to work with\n * [SignatureInformation](#SignatureInformation) literals.\n */\nvar SignatureInformation;\n(function (SignatureInformation) {\n function create(label, documentation) {\n var parameters = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n parameters[_i - 2] = arguments[_i];\n }\n var result = { label: label };\n if (Is.defined(documentation)) {\n result.documentation = documentation;\n }\n if (Is.defined(parameters)) {\n result.parameters = parameters;\n }\n else {\n result.parameters = [];\n }\n return result;\n }\n SignatureInformation.create = create;\n})(SignatureInformation || (SignatureInformation = {}));\n/**\n * A document highlight kind.\n */\nvar DocumentHighlightKind;\n(function (DocumentHighlightKind) {\n /**\n * A textual occurrence.\n */\n DocumentHighlightKind.Text = 1;\n /**\n * Read-access of a symbol, like reading a variable.\n */\n DocumentHighlightKind.Read = 2;\n /**\n * Write-access of a symbol, like writing to a variable.\n */\n DocumentHighlightKind.Write = 3;\n})(DocumentHighlightKind || (DocumentHighlightKind = {}));\n/**\n * DocumentHighlight namespace to provide helper functions to work with\n * [DocumentHighlight](#DocumentHighlight) literals.\n */\nvar DocumentHighlight;\n(function (DocumentHighlight) {\n /**\n * Create a DocumentHighlight object.\n * @param range The range the highlight applies to.\n * @param kind The highlight kind\n */\n function create(range, kind) {\n var result = { range: range };\n if (Is.number(kind)) {\n result.kind = kind;\n }\n return result;\n }\n DocumentHighlight.create = create;\n})(DocumentHighlight || (DocumentHighlight = {}));\n/**\n * A symbol kind.\n */\nvar SymbolKind;\n(function (SymbolKind) {\n SymbolKind.File = 1;\n SymbolKind.Module = 2;\n SymbolKind.Namespace = 3;\n SymbolKind.Package = 4;\n SymbolKind.Class = 5;\n SymbolKind.Method = 6;\n SymbolKind.Property = 7;\n SymbolKind.Field = 8;\n SymbolKind.Constructor = 9;\n SymbolKind.Enum = 10;\n SymbolKind.Interface = 11;\n SymbolKind.Function = 12;\n SymbolKind.Variable = 13;\n SymbolKind.Constant = 14;\n SymbolKind.String = 15;\n SymbolKind.Number = 16;\n SymbolKind.Boolean = 17;\n SymbolKind.Array = 18;\n SymbolKind.Object = 19;\n SymbolKind.Key = 20;\n SymbolKind.Null = 21;\n SymbolKind.EnumMember = 22;\n SymbolKind.Struct = 23;\n SymbolKind.Event = 24;\n SymbolKind.Operator = 25;\n SymbolKind.TypeParameter = 26;\n})(SymbolKind || (SymbolKind = {}));\n/**\n * Symbol tags are extra annotations that tweak the rendering of a symbol.\n *\n * @since 3.16\n */\nvar SymbolTag;\n(function (SymbolTag) {\n /**\n * Render a symbol as obsolete, usually using a strike-out.\n */\n SymbolTag.Deprecated = 1;\n})(SymbolTag || (SymbolTag = {}));\nvar SymbolInformation;\n(function (SymbolInformation) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the location of the symbol.\n * @param uri The resource of the location of symbol.\n * @param containerName The name of the symbol containing the symbol.\n */\n function create(name, kind, range, uri, containerName) {\n var result = {\n name: name,\n kind: kind,\n location: { uri: uri, range: range }\n };\n if (containerName) {\n result.containerName = containerName;\n }\n return result;\n }\n SymbolInformation.create = create;\n})(SymbolInformation || (SymbolInformation = {}));\nvar WorkspaceSymbol;\n(function (WorkspaceSymbol) {\n /**\n * Create a new workspace symbol.\n *\n * @param name The name of the symbol.\n * @param kind The kind of the symbol.\n * @param uri The resource of the location of the symbol.\n * @param range An options range of the location.\n * @returns A WorkspaceSymbol.\n */\n function create(name, kind, uri, range) {\n return range !== undefined\n ? { name: name, kind: kind, location: { uri: uri, range: range } }\n : { name: name, kind: kind, location: { uri: uri } };\n }\n WorkspaceSymbol.create = create;\n})(WorkspaceSymbol || (WorkspaceSymbol = {}));\nvar DocumentSymbol;\n(function (DocumentSymbol) {\n /**\n * Creates a new symbol information literal.\n *\n * @param name The name of the symbol.\n * @param detail The detail of the symbol.\n * @param kind The kind of the symbol.\n * @param range The range of the symbol.\n * @param selectionRange The selectionRange of the symbol.\n * @param children Children of the symbol.\n */\n function create(name, detail, kind, range, selectionRange, children) {\n var result = {\n name: name,\n detail: detail,\n kind: kind,\n range: range,\n selectionRange: selectionRange\n };\n if (children !== undefined) {\n result.children = children;\n }\n return result;\n }\n DocumentSymbol.create = create;\n /**\n * Checks whether the given literal conforms to the [DocumentSymbol](#DocumentSymbol) interface.\n */\n function is(value) {\n var candidate = value;\n return candidate &&\n Is.string(candidate.name) && Is.number(candidate.kind) &&\n Range.is(candidate.range) && Range.is(candidate.selectionRange) &&\n (candidate.detail === undefined || Is.string(candidate.detail)) &&\n (candidate.deprecated === undefined || Is.boolean(candidate.deprecated)) &&\n (candidate.children === undefined || Array.isArray(candidate.children)) &&\n (candidate.tags === undefined || Array.isArray(candidate.tags));\n }\n DocumentSymbol.is = is;\n})(DocumentSymbol || (DocumentSymbol = {}));\n/**\n * A set of predefined code action kinds\n */\nvar CodeActionKind;\n(function (CodeActionKind) {\n /**\n * Empty kind.\n */\n CodeActionKind.Empty = '';\n /**\n * Base kind for quickfix actions: 'quickfix'\n */\n CodeActionKind.QuickFix = 'quickfix';\n /**\n * Base kind for refactoring actions: 'refactor'\n */\n CodeActionKind.Refactor = 'refactor';\n /**\n * Base kind for refactoring extraction actions: 'refactor.extract'\n *\n * Example extract actions:\n *\n * - Extract method\n * - Extract function\n * - Extract variable\n * - Extract interface from class\n * - ...\n */\n CodeActionKind.RefactorExtract = 'refactor.extract';\n /**\n * Base kind for refactoring inline actions: 'refactor.inline'\n *\n * Example inline actions:\n *\n * - Inline function\n * - Inline variable\n * - Inline constant\n * - ...\n */\n CodeActionKind.RefactorInline = 'refactor.inline';\n /**\n * Base kind for refactoring rewrite actions: 'refactor.rewrite'\n *\n * Example rewrite actions:\n *\n * - Convert JavaScript function to class\n * - Add or remove parameter\n * - Encapsulate field\n * - Make method static\n * - Move method to base class\n * - ...\n */\n CodeActionKind.RefactorRewrite = 'refactor.rewrite';\n /**\n * Base kind for source actions: `source`\n *\n * Source code actions apply to the entire file.\n */\n CodeActionKind.Source = 'source';\n /**\n * Base kind for an organize imports source action: `source.organizeImports`\n */\n CodeActionKind.SourceOrganizeImports = 'source.organizeImports';\n /**\n * Base kind for auto-fix source actions: `source.fixAll`.\n *\n * Fix all actions automatically fix errors that have a clear fix that do not require user input.\n * They should not suppress errors or perform unsafe fixes such as generating new types or classes.\n *\n * @since 3.15.0\n */\n CodeActionKind.SourceFixAll = 'source.fixAll';\n})(CodeActionKind || (CodeActionKind = {}));\n/**\n * The reason why code actions were requested.\n *\n * @since 3.17.0\n */\nvar CodeActionTriggerKind;\n(function (CodeActionTriggerKind) {\n /**\n * Code actions were explicitly requested by the user or by an extension.\n */\n CodeActionTriggerKind.Invoked = 1;\n /**\n * Code actions were requested automatically.\n *\n * This typically happens when current selection in a file changes, but can\n * also be triggered when file content changes.\n */\n CodeActionTriggerKind.Automatic = 2;\n})(CodeActionTriggerKind || (CodeActionTriggerKind = {}));\n/**\n * The CodeActionContext namespace provides helper functions to work with\n * [CodeActionContext](#CodeActionContext) literals.\n */\nvar CodeActionContext;\n(function (CodeActionContext) {\n /**\n * Creates a new CodeActionContext literal.\n */\n function create(diagnostics, only, triggerKind) {\n var result = { diagnostics: diagnostics };\n if (only !== undefined && only !== null) {\n result.only = only;\n }\n if (triggerKind !== undefined && triggerKind !== null) {\n result.triggerKind = triggerKind;\n }\n return result;\n }\n CodeActionContext.create = create;\n /**\n * Checks whether the given literal conforms to the [CodeActionContext](#CodeActionContext) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.typedArray(candidate.diagnostics, Diagnostic.is)\n && (candidate.only === undefined || Is.typedArray(candidate.only, Is.string))\n && (candidate.triggerKind === undefined || candidate.triggerKind === CodeActionTriggerKind.Invoked || candidate.triggerKind === CodeActionTriggerKind.Automatic);\n }\n CodeActionContext.is = is;\n})(CodeActionContext || (CodeActionContext = {}));\nvar CodeAction;\n(function (CodeAction) {\n function create(title, kindOrCommandOrEdit, kind) {\n var result = { title: title };\n var checkKind = true;\n if (typeof kindOrCommandOrEdit === 'string') {\n checkKind = false;\n result.kind = kindOrCommandOrEdit;\n }\n else if (Command.is(kindOrCommandOrEdit)) {\n result.command = kindOrCommandOrEdit;\n }\n else {\n result.edit = kindOrCommandOrEdit;\n }\n if (checkKind && kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n CodeAction.create = create;\n function is(value) {\n var candidate = value;\n return candidate && Is.string(candidate.title) &&\n (candidate.diagnostics === undefined || Is.typedArray(candidate.diagnostics, Diagnostic.is)) &&\n (candidate.kind === undefined || Is.string(candidate.kind)) &&\n (candidate.edit !== undefined || candidate.command !== undefined) &&\n (candidate.command === undefined || Command.is(candidate.command)) &&\n (candidate.isPreferred === undefined || Is.boolean(candidate.isPreferred)) &&\n (candidate.edit === undefined || WorkspaceEdit.is(candidate.edit));\n }\n CodeAction.is = is;\n})(CodeAction || (CodeAction = {}));\n/**\n * The CodeLens namespace provides helper functions to work with\n * [CodeLens](#CodeLens) literals.\n */\nvar CodeLens;\n(function (CodeLens) {\n /**\n * Creates a new CodeLens literal.\n */\n function create(range, data) {\n var result = { range: range };\n if (Is.defined(data)) {\n result.data = data;\n }\n return result;\n }\n CodeLens.create = create;\n /**\n * Checks whether the given literal conforms to the [CodeLens](#CodeLens) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.command) || Command.is(candidate.command));\n }\n CodeLens.is = is;\n})(CodeLens || (CodeLens = {}));\n/**\n * The FormattingOptions namespace provides helper functions to work with\n * [FormattingOptions](#FormattingOptions) literals.\n */\nvar FormattingOptions;\n(function (FormattingOptions) {\n /**\n * Creates a new FormattingOptions literal.\n */\n function create(tabSize, insertSpaces) {\n return { tabSize: tabSize, insertSpaces: insertSpaces };\n }\n FormattingOptions.create = create;\n /**\n * Checks whether the given literal conforms to the [FormattingOptions](#FormattingOptions) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.uinteger(candidate.tabSize) && Is.boolean(candidate.insertSpaces);\n }\n FormattingOptions.is = is;\n})(FormattingOptions || (FormattingOptions = {}));\n/**\n * The DocumentLink namespace provides helper functions to work with\n * [DocumentLink](#DocumentLink) literals.\n */\nvar DocumentLink;\n(function (DocumentLink) {\n /**\n * Creates a new DocumentLink literal.\n */\n function create(range, target, data) {\n return { range: range, target: target, data: data };\n }\n DocumentLink.create = create;\n /**\n * Checks whether the given literal conforms to the [DocumentLink](#DocumentLink) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(candidate.range) && (Is.undefined(candidate.target) || Is.string(candidate.target));\n }\n DocumentLink.is = is;\n})(DocumentLink || (DocumentLink = {}));\n/**\n * The SelectionRange namespace provides helper function to work with\n * SelectionRange literals.\n */\nvar SelectionRange;\n(function (SelectionRange) {\n /**\n * Creates a new SelectionRange\n * @param range the range.\n * @param parent an optional parent.\n */\n function create(range, parent) {\n return { range: range, parent: parent };\n }\n SelectionRange.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Range.is(candidate.range) && (candidate.parent === undefined || SelectionRange.is(candidate.parent));\n }\n SelectionRange.is = is;\n})(SelectionRange || (SelectionRange = {}));\n/**\n * A set of predefined token types. This set is not fixed\n * an clients can specify additional token types via the\n * corresponding client capabilities.\n *\n * @since 3.16.0\n */\nvar SemanticTokenTypes;\n(function (SemanticTokenTypes) {\n SemanticTokenTypes[\"namespace\"] = \"namespace\";\n /**\n * Represents a generic type. Acts as a fallback for types which can't be mapped to\n * a specific type like class or enum.\n */\n SemanticTokenTypes[\"type\"] = \"type\";\n SemanticTokenTypes[\"class\"] = \"class\";\n SemanticTokenTypes[\"enum\"] = \"enum\";\n SemanticTokenTypes[\"interface\"] = \"interface\";\n SemanticTokenTypes[\"struct\"] = \"struct\";\n SemanticTokenTypes[\"typeParameter\"] = \"typeParameter\";\n SemanticTokenTypes[\"parameter\"] = \"parameter\";\n SemanticTokenTypes[\"variable\"] = \"variable\";\n SemanticTokenTypes[\"property\"] = \"property\";\n SemanticTokenTypes[\"enumMember\"] = \"enumMember\";\n SemanticTokenTypes[\"event\"] = \"event\";\n SemanticTokenTypes[\"function\"] = \"function\";\n SemanticTokenTypes[\"method\"] = \"method\";\n SemanticTokenTypes[\"macro\"] = \"macro\";\n SemanticTokenTypes[\"keyword\"] = \"keyword\";\n SemanticTokenTypes[\"modifier\"] = \"modifier\";\n SemanticTokenTypes[\"comment\"] = \"comment\";\n SemanticTokenTypes[\"string\"] = \"string\";\n SemanticTokenTypes[\"number\"] = \"number\";\n SemanticTokenTypes[\"regexp\"] = \"regexp\";\n SemanticTokenTypes[\"operator\"] = \"operator\";\n /**\n * @since 3.17.0\n */\n SemanticTokenTypes[\"decorator\"] = \"decorator\";\n})(SemanticTokenTypes || (SemanticTokenTypes = {}));\n/**\n * A set of predefined token modifiers. This set is not fixed\n * an clients can specify additional token types via the\n * corresponding client capabilities.\n *\n * @since 3.16.0\n */\nvar SemanticTokenModifiers;\n(function (SemanticTokenModifiers) {\n SemanticTokenModifiers[\"declaration\"] = \"declaration\";\n SemanticTokenModifiers[\"definition\"] = \"definition\";\n SemanticTokenModifiers[\"readonly\"] = \"readonly\";\n SemanticTokenModifiers[\"static\"] = \"static\";\n SemanticTokenModifiers[\"deprecated\"] = \"deprecated\";\n SemanticTokenModifiers[\"abstract\"] = \"abstract\";\n SemanticTokenModifiers[\"async\"] = \"async\";\n SemanticTokenModifiers[\"modification\"] = \"modification\";\n SemanticTokenModifiers[\"documentation\"] = \"documentation\";\n SemanticTokenModifiers[\"defaultLibrary\"] = \"defaultLibrary\";\n})(SemanticTokenModifiers || (SemanticTokenModifiers = {}));\n/**\n * @since 3.16.0\n */\nvar SemanticTokens;\n(function (SemanticTokens) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && (candidate.resultId === undefined || typeof candidate.resultId === 'string') &&\n Array.isArray(candidate.data) && (candidate.data.length === 0 || typeof candidate.data[0] === 'number');\n }\n SemanticTokens.is = is;\n})(SemanticTokens || (SemanticTokens = {}));\n/**\n * The InlineValueText namespace provides functions to deal with InlineValueTexts.\n *\n * @since 3.17.0\n */\nvar InlineValueText;\n(function (InlineValueText) {\n /**\n * Creates a new InlineValueText literal.\n */\n function create(range, text) {\n return { range: range, text: text };\n }\n InlineValueText.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.string(candidate.text);\n }\n InlineValueText.is = is;\n})(InlineValueText || (InlineValueText = {}));\n/**\n * The InlineValueVariableLookup namespace provides functions to deal with InlineValueVariableLookups.\n *\n * @since 3.17.0\n */\nvar InlineValueVariableLookup;\n(function (InlineValueVariableLookup) {\n /**\n * Creates a new InlineValueText literal.\n */\n function create(range, variableName, caseSensitiveLookup) {\n return { range: range, variableName: variableName, caseSensitiveLookup: caseSensitiveLookup };\n }\n InlineValueVariableLookup.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range) && Is.boolean(candidate.caseSensitiveLookup)\n && (Is.string(candidate.variableName) || candidate.variableName === undefined);\n }\n InlineValueVariableLookup.is = is;\n})(InlineValueVariableLookup || (InlineValueVariableLookup = {}));\n/**\n * The InlineValueEvaluatableExpression namespace provides functions to deal with InlineValueEvaluatableExpression.\n *\n * @since 3.17.0\n */\nvar InlineValueEvaluatableExpression;\n(function (InlineValueEvaluatableExpression) {\n /**\n * Creates a new InlineValueEvaluatableExpression literal.\n */\n function create(range, expression) {\n return { range: range, expression: expression };\n }\n InlineValueEvaluatableExpression.create = create;\n function is(value) {\n var candidate = value;\n return candidate !== undefined && candidate !== null && Range.is(candidate.range)\n && (Is.string(candidate.expression) || candidate.expression === undefined);\n }\n InlineValueEvaluatableExpression.is = is;\n})(InlineValueEvaluatableExpression || (InlineValueEvaluatableExpression = {}));\n/**\n * The InlineValueContext namespace provides helper functions to work with\n * [InlineValueContext](#InlineValueContext) literals.\n *\n * @since 3.17.0\n */\nvar InlineValueContext;\n(function (InlineValueContext) {\n /**\n * Creates a new InlineValueContext literal.\n */\n function create(frameId, stoppedLocation) {\n return { frameId: frameId, stoppedLocation: stoppedLocation };\n }\n InlineValueContext.create = create;\n /**\n * Checks whether the given literal conforms to the [InlineValueContext](#InlineValueContext) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Range.is(value.stoppedLocation);\n }\n InlineValueContext.is = is;\n})(InlineValueContext || (InlineValueContext = {}));\n/**\n * Inlay hint kinds.\n *\n * @since 3.17.0\n */\nvar InlayHintKind;\n(function (InlayHintKind) {\n /**\n * An inlay hint that for a type annotation.\n */\n InlayHintKind.Type = 1;\n /**\n * An inlay hint that is for a parameter.\n */\n InlayHintKind.Parameter = 2;\n function is(value) {\n return value === 1 || value === 2;\n }\n InlayHintKind.is = is;\n})(InlayHintKind || (InlayHintKind = {}));\nvar InlayHintLabelPart;\n(function (InlayHintLabelPart) {\n function create(value) {\n return { value: value };\n }\n InlayHintLabelPart.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate)\n && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))\n && (candidate.location === undefined || Location.is(candidate.location))\n && (candidate.command === undefined || Command.is(candidate.command));\n }\n InlayHintLabelPart.is = is;\n})(InlayHintLabelPart || (InlayHintLabelPart = {}));\nvar InlayHint;\n(function (InlayHint) {\n function create(position, label, kind) {\n var result = { position: position, label: label };\n if (kind !== undefined) {\n result.kind = kind;\n }\n return result;\n }\n InlayHint.create = create;\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && Position.is(candidate.position)\n && (Is.string(candidate.label) || Is.typedArray(candidate.label, InlayHintLabelPart.is))\n && (candidate.kind === undefined || InlayHintKind.is(candidate.kind))\n && (candidate.textEdits === undefined) || Is.typedArray(candidate.textEdits, TextEdit.is)\n && (candidate.tooltip === undefined || Is.string(candidate.tooltip) || MarkupContent.is(candidate.tooltip))\n && (candidate.paddingLeft === undefined || Is.boolean(candidate.paddingLeft))\n && (candidate.paddingRight === undefined || Is.boolean(candidate.paddingRight));\n }\n InlayHint.is = is;\n})(InlayHint || (InlayHint = {}));\nvar WorkspaceFolder;\n(function (WorkspaceFolder) {\n function is(value) {\n var candidate = value;\n return Is.objectLiteral(candidate) && URI.is(candidate.uri) && Is.string(candidate.name);\n }\n WorkspaceFolder.is = is;\n})(WorkspaceFolder || (WorkspaceFolder = {}));\nvar EOL = ['\\n', '\\r\\n', '\\r'];\n/**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\nvar TextDocument;\n(function (TextDocument) {\n /**\n * Creates a new ITextDocument literal from the given uri and content.\n * @param uri The document's uri.\n * @param languageId The document's language Id.\n * @param version The document's version.\n * @param content The document's content.\n */\n function create(uri, languageId, version, content) {\n return new FullTextDocument(uri, languageId, version, content);\n }\n TextDocument.create = create;\n /**\n * Checks whether the given literal conforms to the [ITextDocument](#ITextDocument) interface.\n */\n function is(value) {\n var candidate = value;\n return Is.defined(candidate) && Is.string(candidate.uri) && (Is.undefined(candidate.languageId) || Is.string(candidate.languageId)) && Is.uinteger(candidate.lineCount)\n && Is.func(candidate.getText) && Is.func(candidate.positionAt) && Is.func(candidate.offsetAt) ? true : false;\n }\n TextDocument.is = is;\n function applyEdits(document, edits) {\n var text = document.getText();\n var sortedEdits = mergeSort(edits, function (a, b) {\n var diff = a.range.start.line - b.range.start.line;\n if (diff === 0) {\n return a.range.start.character - b.range.start.character;\n }\n return diff;\n });\n var lastModifiedOffset = text.length;\n for (var i = sortedEdits.length - 1; i >= 0; i--) {\n var e = sortedEdits[i];\n var startOffset = document.offsetAt(e.range.start);\n var endOffset = document.offsetAt(e.range.end);\n if (endOffset <= lastModifiedOffset) {\n text = text.substring(0, startOffset) + e.newText + text.substring(endOffset, text.length);\n }\n else {\n throw new Error('Overlapping edit');\n }\n lastModifiedOffset = startOffset;\n }\n return text;\n }\n TextDocument.applyEdits = applyEdits;\n function mergeSort(data, compare) {\n if (data.length <= 1) {\n // sorted\n return data;\n }\n var p = (data.length / 2) | 0;\n var left = data.slice(0, p);\n var right = data.slice(p);\n mergeSort(left, compare);\n mergeSort(right, compare);\n var leftIdx = 0;\n var rightIdx = 0;\n var i = 0;\n while (leftIdx < left.length && rightIdx < right.length) {\n var ret = compare(left[leftIdx], right[rightIdx]);\n if (ret <= 0) {\n // smaller_equal -> take left to preserve order\n data[i++] = left[leftIdx++];\n }\n else {\n // greater -> take right\n data[i++] = right[rightIdx++];\n }\n }\n while (leftIdx < left.length) {\n data[i++] = left[leftIdx++];\n }\n while (rightIdx < right.length) {\n data[i++] = right[rightIdx++];\n }\n return data;\n }\n})(TextDocument || (TextDocument = {}));\n/**\n * @deprecated Use the text document from the new vscode-languageserver-textdocument package.\n */\nvar FullTextDocument = /** @class */ (function () {\n function FullTextDocument(uri, languageId, version, content) {\n this._uri = uri;\n this._languageId = languageId;\n this._version = version;\n this._content = content;\n this._lineOffsets = undefined;\n }\n Object.defineProperty(FullTextDocument.prototype, \"uri\", {\n get: function () {\n return this._uri;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"languageId\", {\n get: function () {\n return this._languageId;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(FullTextDocument.prototype, \"version\", {\n get: function () {\n return this._version;\n },\n enumerable: false,\n configurable: true\n });\n FullTextDocument.prototype.getText = function (range) {\n if (range) {\n var start = this.offsetAt(range.start);\n var end = this.offsetAt(range.end);\n return this._content.substring(start, end);\n }\n return this._content;\n };\n FullTextDocument.prototype.update = function (event, version) {\n this._content = event.text;\n this._version = version;\n this._lineOffsets = undefined;\n };\n FullTextDocument.prototype.getLineOffsets = function () {\n if (this._lineOffsets === undefined) {\n var lineOffsets = [];\n var text = this._content;\n var isLineStart = true;\n for (var i = 0; i < text.length; i++) {\n if (isLineStart) {\n lineOffsets.push(i);\n isLineStart = false;\n }\n var ch = text.charAt(i);\n isLineStart = (ch === '\\r' || ch === '\\n');\n if (ch === '\\r' && i + 1 < text.length && text.charAt(i + 1) === '\\n') {\n i++;\n }\n }\n if (isLineStart && text.length > 0) {\n lineOffsets.push(text.length);\n }\n this._lineOffsets = lineOffsets;\n }\n return this._lineOffsets;\n };\n FullTextDocument.prototype.positionAt = function (offset) {\n offset = Math.max(Math.min(offset, this._content.length), 0);\n var lineOffsets = this.getLineOffsets();\n var low = 0, high = lineOffsets.length;\n if (high === 0) {\n return Position.create(0, offset);\n }\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (lineOffsets[mid] > offset) {\n high = mid;\n }\n else {\n low = mid + 1;\n }\n }\n // low is the least x for which the line offset is larger than the current offset\n // or array.length if no line offset is larger than the current offset\n var line = low - 1;\n return Position.create(line, offset - lineOffsets[line]);\n };\n FullTextDocument.prototype.offsetAt = function (position) {\n var lineOffsets = this.getLineOffsets();\n if (position.line >= lineOffsets.length) {\n return this._content.length;\n }\n else if (position.line < 0) {\n return 0;\n }\n var lineOffset = lineOffsets[position.line];\n var nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length;\n return Math.max(Math.min(lineOffset + position.character, nextLineOffset), lineOffset);\n };\n Object.defineProperty(FullTextDocument.prototype, \"lineCount\", {\n get: function () {\n return this.getLineOffsets().length;\n },\n enumerable: false,\n configurable: true\n });\n return FullTextDocument;\n}());\nvar Is;\n(function (Is) {\n var toString = Object.prototype.toString;\n function defined(value) {\n return typeof value !== 'undefined';\n }\n Is.defined = defined;\n function undefined(value) {\n return typeof value === 'undefined';\n }\n Is.undefined = undefined;\n function boolean(value) {\n return value === true || value === false;\n }\n Is.boolean = boolean;\n function string(value) {\n return toString.call(value) === '[object String]';\n }\n Is.string = string;\n function number(value) {\n return toString.call(value) === '[object Number]';\n }\n Is.number = number;\n function numberRange(value, min, max) {\n return toString.call(value) === '[object Number]' && min <= value && value <= max;\n }\n Is.numberRange = numberRange;\n function integer(value) {\n return toString.call(value) === '[object Number]' && -2147483648 <= value && value <= 2147483647;\n }\n Is.integer = integer;\n function uinteger(value) {\n return toString.call(value) === '[object Number]' && 0 <= value && value <= 2147483647;\n }\n Is.uinteger = uinteger;\n function func(value) {\n return toString.call(value) === '[object Function]';\n }\n Is.func = func;\n function objectLiteral(value) {\n // Strictly speaking class instances pass this check as well. Since the LSP\n // doesn't use classes we ignore this for now. If we do we need to add something\n // like this: `Object.getPrototypeOf(Object.getPrototypeOf(x)) === null`\n return value !== null && typeof value === 'object';\n }\n Is.objectLiteral = objectLiteral;\n function typedArray(value, check) {\n return Array.isArray(value) && value.every(check);\n }\n Is.typedArray = typedArray;\n})(Is || (Is = {}));\n\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/vscode-languageserver-types/lib/esm/main.js?");
13419
13419
 
13420
13420
  /***/ }),
13421
13421