Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 4 tasks
karelbilek opened this issue Jul 11, 2024 · 2 comments
Open
1 of 4 tasks

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

karelbilek opened this issue Jul 11, 2024 · 2 comments

Comments

@karelbilek
Copy link

karelbilek commented Jul 11, 2024

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)
@karelbilek
Copy link
Author

. gets YAML parsed as a string, shows in extension as float (incorrect)

.3 gets YAML parsed as a float, shows in extension as float (correct)

..3 gets YAML parsed as a string, shows in extension as float (incorrect)

@karelbilek
Copy link
Author

one: .
two: .3
three: ..3
Screenshot 2024-07-11 at 7 42 20
{
  "one": ".",
  "two": 0.3,
  "three": "..3"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant