redhat-developer / redhat-developer/vscode-yaml

wrong line underlined as syntax errors

Open
#1,095 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
829
Forks
260
Avg merge
5h 43m
Merged PRs (30d)
1

Description

Describe the bug

When a YAML field is accidentally indented one space, where it should have been flush with the zeroth column, then VSCode sometimes produces error underlines the wrong line. Instead of highlighting that line, it highlights (commented) code above.

Expected Behavior

Fields indented too deep receive error underlines.

Current Behavior

(Commented) lines way up above get all the syntax checker attention, distracting users from the true root cause.

Steps to Reproduce

Image

Environment

  • Windows
  • Mac
  • Linux
  • other (please specify)

By the way, some other editors like IntelliJ experience similar issues.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the one-space YAML indentation case described in the issue, using the attached screenshot as reference, and compare which line receives the error underline. Confirm the behavior across the listed operating systems; done means the incorrectly indented field, rather than commented code above it, receives the syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.