Skip to content

Fix stray DEDENT after a trailing indented comment - #2286

Open
shblue21 wants to merge 1 commit into
eclipse-langium:mainfrom
shblue21:fix/indentation-eof-dedent
Open

shblue21 wants to merge 1 commit into
eclipse-langium:mainfrom
shblue21:fix/indentation-eof-dedent

Conversation

@shblue21

@shblue21 shblue21 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Adding the indented comment below the final milestone made VS Code report a parse error on the following blank line. Moving the comment to column 1 cleared the error. With this fix, the same file parses without errors with the comment still indented.

milestone launch "Launch" after:[ship, announce]
  // Confirm the launch date with Marketing.

EOF error on the line after the indented comment, before the fix

IndentationAwareLexer skips the empty INDENT/DEDENT pair around the comment, then appends the DEDENT again because it was the last token. In full mode, the lexer now appends the last token only if the loop hasn't already consumed it.

The regression tests cover trailing spaces and comments, including CRLF. Partial tokenization keeps the last token because dropping it can prevent completion from suggesting else after blank lines with different indentation.

@shblue21
shblue21 force-pushed the fix/indentation-eof-dedent branch from ba9a420 to ffc65ef Compare November 22, 2026 13:57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant