diff --git a/language/document.ts b/language/document.ts index 35212aa1..28d0668e 100644 --- a/language/document.ts +++ b/language/document.ts @@ -106,6 +106,7 @@ export default class Document { newLineToken = tokens[lastLine.index]; const indent = statementTokens[0] && newLineToken ? (statementTokens[0].range.start - newLineToken.range.end) : 0; this.addStatement(indent, statementTokens); + lastLine.need = true; statementStart = { index: i+1 diff --git a/tests/suite/linter.js b/tests/suite/linter.js index 798a9dc3..e8297737 100644 --- a/tests/suite/linter.js +++ b/tests/suite/linter.js @@ -3210,5 +3210,28 @@ exports.issue_234 = async () => { IncorrectVariableCase: true }, cache); + assert.strictEqual(indentErrors.length, 0); +} + +exports.issue_238 = async () => { + const lines = [ + `**FREE`, + `/Copy Qcpysrc,Hspecle`, + `// Prototypes`, + `/Copy Qcpysrc,Copybook1`, + `/Copy Qcpysrc,Copybook2`, + `/Copy Qcpysrc,Copybook3`, + `/Copy Qcpysrc,Copybook4`, + `/Copy Qcpysrc,Copybook5`, + `Dcl-S MyParm1 Char(1) Const;`, + `Dcl-S MyParm2 Char(1) Const;`, + ].join(`\n`); + + const parser = parserSetup(); + const cache = await parser.getDocs(uri, lines); + const { indentErrors, errors } = Linter.getErrors({ uri, content: lines }, { + indent: 2 + }, cache); + assert.strictEqual(indentErrors.length, 0); } \ No newline at end of file