Skip to content

yaml grammar recognises some integers as strings (or vice versa?) #39

@alexr00

Description

@alexr00

Does this issue occur when all extensions are disabled?: Yes

Version: 1.64.2
Commit: f80445acd5a3dadef24aa209168452a3d97cc326
Date: 2022-02-09T22:02:29.527Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.13.0-28-generic snap

OS is Ubuntu 20.04

Description:

Some integers (or strings?) are treated differently even though they look the same to me.

In each comment I've specified what the scope inspector reports the scope as.

This is what it ends up looking like for me:
image

I'd expect them all to be the same; so either they should all be integers or they should all be unquoted strings.

Test case:

test:
  - test: 01 # constant.numeric.integer.yaml
  - test: 02 # constant.numeric.integer.yaml
  - test: 03 # constant.numeric.integer.yaml
  - test: 04 # constant.numeric.integer.yaml
  - test: 05 # constant.numeric.integer.yaml
  - test: 06 # constant.numeric.integer.yaml
  - test: 07 # constant.numeric.integer.yaml
  - test: 08 # string.unquoted.plain.out.yaml
  - test: 09 # string.unquoted.plain.out.yaml
  - test: 10 # constant.numeric.integer.yaml

Steps to Reproduce:

  1. Create a test file, test.yml with the contents from the test case

Originally from @pedroterzero in microsoft/vscode#143368

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions