GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ApertaCodex/swift-json-formatter

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
out
out
 
 
test
test
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
.vscodeignore
.vscodeignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE.md
LICENSE.md
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
extension.js
extension.js
 
 
jsconfig.json
jsconfig.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
swift-json-formatter.png
swift-json-formatter.png
 
 

Repository files navigation

Swift JSON Formatter for VS Code

A fast, reliable, and feature-rich JSON formatter extension for Visual Studio Code that handles various JSON formats and provides clear error messages.

Features

  • Local Processing: All formatting is done locally - no external services required
  • Multiple JSON Formats Support:
    • Standard JSON
    • JavaScript object notation (unquoted keys)
    • Single quotes
    • Trailing commas
  • Smart Selection:
    • Format selected JSON text
    • Format entire file when no text is selected
  • Mixed Content Support:
    • Automatically detects and formats JSON sections in logs or other text
    • Preserves non-JSON content
    • Handles multiple JSON sections in the same document
  • Clear Error Messages: Helpful error messages when JSON is invalid
  • Zero Configuration: Works out of the box with sensible defaults

Usage

You can format JSON in two ways:

  1. Using Command Palette:

    • Select text containing JSON (or place cursor anywhere in a file)
    • Open the command palette (Ctrl+Shift+P or Cmd+Shift+P on Mac)
    • Type and select "Format JSON (Swift Json Formatter)"
  2. Using Keyboard Shortcut:

    • Select text containing JSON (or place cursor anywhere in a file)
    • Press Ctrl+Shift+F (or Cmd+Shift+F on Mac)

The extension will automatically:

  • Format the selected text if any is selected
  • Format the entire file if no text is selected
  • Format JSON sections within unstructured text while preserving the surrounding content
  • Provide clear error messages if the JSON is invalid

Examples

Standard JSON

{"name":"test","value":123}

becomes:

{
    "name": "test",
    "value": 123
}

JavaScript Object Notation

{name: 'test', value: 123}

becomes:

{
    "name": "test",
    "value": 123
}

Mixed Content

Debug Output:
{'status': 'success', 'data': [1,2,3]}
Other info: not JSON
Response: {"code":200,"message":"OK"}

becomes:

Debug Output:
{
    "status": "success",
    "data": [
        1,
        2,
        3
    ]
}
Other info: not JSON
Response: {
    "code": 200,
    "message": "OK"
}

Release Notes

1.1.0 (2024-01-09)

Major update with new features:

  • Local JSON processing (no more external service dependency)
  • Support for JavaScript object notation
  • Support for single quotes in JSON
  • Support for trailing commas
  • Comprehensive error messages
  • Full test coverage
  • Improved error handling and validation
  • Better handling when no text is selected

1.0.4

  • Initial release with basic JSON formatting

Feedback and Contributions

  • File bugs and feature requests in our GitHub repository
  • Contributions are always welcome!

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity
Custom properties

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.