microsoft / microsoft/edit

enhancement: improve YAML syntax highlighting

Open
#946 0 comments 0 reactions 0 assignees View on GitHub

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:

  1. Special numbers: .inf, -.inf, .nan

    positive_inf: .inf
    negative_inf: -.inf
    not_a_number: .nan
    

    See YAML 1.2.2 §2.4, Example 2.20.

  2. Hex, octal, and binary numbers

    hexadecimal: 0xC
    octal: 0o14
    binary: 0b1010
    

    See YAML 1.2.2 §2.4, Example 2.19.

  3. Single-quoted strings and escaped quotes

    single: 'Hello, world!'
    escaped: 'It''s YAML'
    

    See YAML 1.2.2 §7.3.2.

  4. 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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.