Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/src/language/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ export default class Linter {
if (definedProcedure) {
let requiresBlock = false;
// Don't require parms for procedures found in Ctl-Opt
if (statement[0].value.toUpperCase() === `CTL-OPT`) {
if (statement[0].value.toUpperCase() === `CTL-OPT` || statement[0].type === `directive`) {
// do nothing
} else if (statement.length <= i + 1) {
requiresBlock = true;
Expand Down
20 changes: 20 additions & 0 deletions tests/suite/linter.js
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,26 @@ exports.linter_Do_Not_Require_Parameters_For_Control_Options = async () => {
assert.strictEqual(errors.length, 0, `Unexpected RequiresParamters error`);
};

exports.linter_Do_Not_Require_Parameters_For_Compile_Directives = async () => {
const lines = [
`**FREE`,
`/if defined(MYPROCEDURE);`,
`/eof;`,
`/endif;`,
`/define ;`,
`dcl-pr MYPROCEDURE;`,
`end-pr;`,
].join(`\n`);

const parser = parserSetup();
const cache = await parser.getDocs(uri, lines);
const { errors } = Linter.getErrors({ uri, content: lines }, {
RequiresParameter: true
}, cache);

assert.strictEqual(errors.length, 0, `Unexpected RequiresParamters error`);
};

/**
* Check that local variables are not in global scope
*/
Expand Down