vscode-yaml icon indicating copy to clipboard operation
vscode-yaml copied to clipboard

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

Open karelbilek opened this issue 1 year ago • 2 comments

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
  • [x] Mac
  • [ ] Linux
  • [ ] other (please specify)

karelbilek avatar Jul 11 '24 05:07 karelbilek