enhancement: improve YAML syntax highlighting
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 14.6k
- Forks
- 734
- Avg merge
- 8h 40m
- Merged PRs (30d)
- 4
Description
The current YAML highlighting is missing a few common YAML constructs. Examples from the YAML 1.2.2 specification:
-
Special numbers:
.inf,-.inf,.nanpositive_inf: .inf negative_inf: -.inf not_a_number: .nan -
Hex, octal, and binary numbers
hexadecimal: 0xC octal: 0o14 binary: 0b1010 -
Single-quoted strings and escaped quotes
single: 'Hello, world!' escaped: 'It''s YAML'See YAML 1.2.2 §7.3.2.
-
Explicit tags
string: !!str 123 integer: !!int "42"See YAML 1.2.2 §6.9.1.
There are other YAML constructs as well, such as empty values, flow collections, anchors and aliases, and the document end marker. However, I don't think these necessarily need special highlighting support.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the existing YAML syntax-highlighting entry point and its tests, then compare supported constructs with YAML 1.2.2 sections 2.4, 6.9.1, and 7.3.2. Add coverage for special numbers, hexadecimal/octal/binary numbers, single-quoted strings with escaped quotes, and explicit tags; done means these examples receive appropriate highlighting without regressing existing YAML cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- yaml
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100