redhat-developer / redhat-developer/vscode-yaml

Formatting removes leading special whitespace (U+2003)

Open
#951 0 comments 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

The formatter removes both leading and trailing special whitespace characters (e.g. U+2003).

Let's say you have a YAML file containing leading special whitespace (U+2003):

some_string: "a
   b  # this line starts with 2 spaces for indentation followed by an U+2003
  \u2003c"  # here's an explicit U+2003

Expected Behavior

I would like to keep all leading (and trailing) special whitespace characters.

Current Behavior

Applying the formatter yields:

some_string: "a
  b  # this line starts with 2 space for indentation; the U+2003 HAS BEEN REMOVED
  \u2003c" # here still is an explicit U+2003

Environment

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

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 running the formatter on the YAML example containing U+2003 and compare the output with the expected behavior described in the issue. Trace the formatter entry point used for YAML files; done means leading and trailing special whitespace is preserved while ordinary indentation and the explicit escape remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.