Skip to content

Integers with leading zeros displaying as strings #1190

@mattkerlogue

Description

@mattkerlogue

Describe the bug

When editing lists in YAML if the integers 8 and 9 have leading zeros (i.e. 08 or 09 code highlighting displays them as if they were strings. When the YAML extension is disabled the values are highlighted correctly as numerics.

I first discovered this when amending some YAML where dates are encoded separately as the day, month and year (hence the leading zeros).

Expected Behavior

Bare values of 08 and 09 (or with more leading zeros, or with following digits) should be highlighted as numeric values. As per VS Code when the extension is disabled.

YAML code highlighting when extension disabled:
Screenshot with YAML extension disabled

Current Behavior

Bare values of 08 and 09 (or with more leading zeros, or with following digits) are highlighted as if a string.

YAML code highlighting when extension enabled:
Screenshot with YAML extension enabled

Steps to Reproduce

  1. Open a new file, set language to YAML
  2. Create a list/array of numeric values including some with 08 and 09

Environment

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

Screenshots are with the Nord theme, but also occurs with other colour themes enabled.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions