Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Toggle quotes doesn't work on invalid single-quoted string JSON values #16

Open
mnquintana opened this issue Jan 5, 2015 · 2 comments

Comments

@mnquintana
Copy link
Contributor

Use case: I started with a plain ol' JS object, which I then wanted to convert to a separate JSON file. My JS object used single quoted strings as values. When I copy it to the JSON file, I want to use toggle-quotes to convert all of these invalid single-quoted strings to valid double-quoted strings. However, this only works on keys, not values. toggle-quotes can toggle quotes normally on JSON keys, but can only toggle from double-quotes to single-quotes for JSON values - it can't toggle from single-quotes to double-quotes.

Steps to reproduce:

  1. Create JSON file with single-quote string attribute values.
  2. Try running toggle-quotes (either via the keyboard shortcut or via the command palette) on any of these values.

Ubuntu 14.04.1 LTS

@mnquintana
Copy link
Contributor Author

Hmmm, can't reproduce on Yosemite. I'll check again tomorrow at work on my Ubuntu.

@Aerijo
Copy link
Contributor

Aerijo commented Aug 11, 2018

This can be reproduced with the following

{
  "foo": "ba8r"
}

Toggling "foo" is fine, but the 8 in ba8r breaks the invalid range and prevents this package from recognising it as a string. The same goes for anything that is potentially valid JSON syntax (e.g., ba{r)

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

No branches or pull requests

2 participants