Skip to content

Commit

Permalink
Fix for QualifiedCheck when LIKEREC is used (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
worksofliam committed Feb 2, 2022
1 parent 4aa28fa commit a6fe5d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/language/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ module.exports = class Linter {
}

if (rules.QualifiedCheck) {
if (!statement.some(part => part.value && [`LIKEDS`, `QUALIFIED`].includes(part.value.toUpperCase()))) {
if (!statement.some(part => part.value && [`LIKEDS`, `LIKEREC`, `QUALIFIED`].includes(part.value.toUpperCase()))) {
errors.push({
range: new vscode.Range(statementStart, statementEnd),
offset: undefined,
Expand Down
20 changes: 20 additions & 0 deletions tests/suite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,26 @@ module.exports = {
});
},

qualified1: async () => {
const lines = [
`**FREE`,
`Dcl-Ds Kx Likerec(TitXe :*Key);`,
`Dcl-s MyVariable2 Char(20);`,
``,
`Dsply MyVariable2;`,
``,
`Return`,
].join(`\n`);

const parser = new Parser();
const cache = await parser.getDocs(URI, lines);
const { errors } = Linter.getErrors(lines, {
QualifiedCheck: true,
}, cache);

assert.strictEqual(errors.length, 0, `Expect length of 0`);
},

fixed1: async () => {
const lines = [
``,
Expand Down

0 comments on commit a6fe5d9

Please sign in to comment.