Skip to content

Single dot shows as a float while it's a string #1039

@karelbilek

Description

@karelbilek

Describe the bug

When a single dot is a value in key/value map, it is shown as a float while YAML parses it as a string

Expected Behavior

The dot has highlight as a string

Current Behavior

The dot has highlight as a float

Steps to Reproduce

paths:
  etc: /etc
  pwd: .
  number: 3
  up: ./..
Screenshot 2024-07-11 at 7 37 30

. should be highlighted as a string, not as a number. Because YAML will parse it as a string. This parsed as a JSON is:

{
  "paths": {
    "etc": "/etc",
    "pwd": ".",
    "number": 3,
    "up": "./.."
  }
}

Environment

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

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