JSON Deserializer
A powerful VSCode/Cursor extension that recursively deserializes JSON strings into readable, formatted objects.
Features
- 🔄 Recursive Deserialization: Automatically finds and deserializes all JSON strings nested within your JSON structure
- 📝 Multiline String Formatting: Converts strings with newlines into readable, formatted multiline strings
- ⚡ One-Click Operation: Right-click and select "Deserialize JSON" - works on entire files or selections
- 🎨 Pretty Formatting: Outputs beautifully formatted JSON with 2-space indentation
- 🔁 Deep Nesting Support: Handles multiple levels of nested JSON strings
Usage
- Open a file containing a JSON string (like
test.json )
- Either:
- Select the JSON text you want to deserialize, OR
- Leave no selection to deserialize the entire file
- Right-click and select "Deserialize JSON"
- The JSON string will be converted to properly formatted JSON in place
Example
Before (nested JSON strings):
{
"function": {
"name": "write_file",
"arguments": "{\"path\":\"/app/test.js\",\"content\":\"function test() {\\n console.log('hello');\\n}\"}"
}
}
After (deserialized and formatted):
{
"function": {
"name": "write_file",
"arguments": {
"path": "/app/test.js",
"content": "function test() {
console.log('hello');
}"
}
}
}
Notice how:
- The
arguments string was parsed into an actual object
- The
content string with \n escapes became a readable multiline string
Development
Setup
npm install
Compile
npm run compile
Watch mode (auto-compile on changes)
npm run watch
Running the Extension
- Press
F5 in VSCode to open a new window with the extension loaded
- Open
test.json or create a new file with JSON strings
- Right-click and select "Deserialize JSON"
Building VSIX Package
npm install -g @vscode/vsce
vsce package
This will create a .vsix file that you can install in VSCode/Cursor.
Installation
From VSIX
- Build the extension:
vsce package
- In VSCode/Cursor, go to Extensions
- Click the "..." menu and select "Install from VSIX..."
- Select the generated
.vsix file
From Source (Development)
- Clone this repository
- Run
npm install
- Run
npm run compile
- Press
F5 to launch the extension in debug mode
Requirements
License
MIT
| |