Skip to content

Fix corner case for 'flow sequence forbidden' quickfix#1061

Merged
datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561:1060-end-of-document-flow-error
May 8, 2025
Merged

Fix corner case for 'flow sequence forbidden' quickfix#1061
datho7561 merged 1 commit intoredhat-developer:mainfrom
datho7561:1060-end-of-document-flow-error

Conversation

@datho7561
Copy link
Contributor

What does this PR do?

  • Do not include any trailing spaces in the error range
    • This is a change in behaviour; it seems this behaviour was intentional based on the test cases, but I don't agree with it, since the error range should only cover the erroneous code.
  • Fix a bug where ] or } are not included in the error range if they're the last character in the document

What issues does this PR fix or reference?

Fixes #1060

Is it tested? How?

Updated the unit tests to reflect that trailing whitespaces are not included in the range. The corner case of a flow sequence at the end of the document was already covered in the suite, but the expected range of the diagnostic was wrong.

@coveralls
Copy link

coveralls commented Apr 30, 2025

Coverage Status

coverage: 83.871% (+0.007%) from 83.864%
when pulling a291fa7 on datho7561:1060-end-of-document-flow-error
into 4e25b52 on redhat-developer:main.

@datho7561 datho7561 force-pushed the 1060-end-of-document-flow-error branch 2 times, most recently from fb168d5 to a31584b Compare May 6, 2025 14:07
Copy link
Contributor

@msivasubramaniaan msivasubramaniaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@datho7561 datho7561 force-pushed the 1060-end-of-document-flow-error branch from ccbd2b2 to 0362918 Compare May 8, 2025 12:54
- Do not include any trailing spaces in the error range
  - This is a change in behaviour; it seems this behaviour was
    intentional based on the test cases,
    but I don't agree with it, since the error range should only cover
    the erroneous code.
- Fix a bug where `]` or `}` are not included in the error range if they're the last character in the document

Fixes redhat-developer#1060

Signed-off-by: David Thompson <davthomp@redhat.com>
@datho7561 datho7561 force-pushed the 1060-end-of-document-flow-error branch from 0362918 to a291fa7 Compare May 8, 2025 13:33
@datho7561 datho7561 merged commit de78c0e into redhat-developer:main May 8, 2025
4 checks passed
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.

QuickFix for "flow sequence forbidden" leaves in trailing ]

3 participants