A VS Code extension for quickly transforming selected text in place with JSON and string utilities.
Features
This extension provides the following text processing features:
- Unescape JSON String and Format: Parse and format escaped JSON strings (handles one level of escaping)
- Unescape JSON String and Format Recursively: Parse and format deeply nested escaped JSON strings (handles multiple levels of escaping)
- Unescape String: Unescape common escape sequences in strings (\n, \t, ", \, etc.)
Usage
- Select the text you want to process in the editor
- Open the Command Palette with
Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS)
- Type and select one of the following commands:
Inline Transform: Unescape JSON String and Format - Parse and format escaped JSON (one level)
Inline Transform: Unescape JSON String and Format Recursively - Parse and format deeply nested escaped JSON
Inline Transform: Unescape String - Unescape escape sequences in text
The processed result will automatically replace the selected text.
Examples
Selected text: "{\"name\":\"John\",\"age\":30}"
After running Inline Transform: Unescape JSON String and Format:
{
"name": "John",
"age": 30
}
This command is useful when you have multiple levels of escaped JSON strings nested within each other.
Selected text:
{"data":"{\"user\":\"{\\\"name\\\":\\\"John\\\",\\\"age\\\":30}\"}"}
After running Inline Transform: Unescape JSON String and Format Recursively:
{
"data": {
"user": {
"name": "John",
"age": 30
}
}
}
The command recursively parses each nested JSON string until all levels are fully unescaped and formatted. In contrast, Inline Transform: Unescape JSON String and Format would only parse one level, leaving inner escaped strings unparsed.
Unescape String
Selected text: Hello\nWorld\tThis is a \"test\"
After running Inline Transform: Unescape String:
Hello
World This is a "test"
Differences Between Commands
Unescape JSON String and Format:
- Input must be valid JSON
- Parses JSON structure and handles escaped JSON strings
- Output is formatted JSON with indentation
- Example:
"{\"name\":\"John\"}" → {\n "name": "John"\n}
Unescape String:
- Input can be any text with escape sequences
- Only unescapes common escape sequences (
\n, \t, \", \\, etc.)
- Output is plain text without formatting
- Example:
"{\"name\":\"John\"}" → {"name":"John"}
Key difference: Unescape JSON String performs JSON parsing + formatting, while Unescape String only unescapes characters without formatting.
Requirements
- Visual Studio Code 1.107.0 or higher
Release Notes
0.0.1
Initial release with JSON and string unescaping utilities.
Enjoy!
This extension was developed with AI assistance.