The Inline JSON Formatter is a Visual Studio Code extension that allows you to format and manipulate JSON directly within your editor. It provides commands for formatting selected JSON, stringifying JavaScript objects, and customizing the formatting space.
Features
Format Selected JSON: Format the selected JSON within the active editor.
Stringify JavaScript Object: Convert a selected JavaScript object to a formatted JSON string.
Format with Custom Space: Customize the indentation level (formatting space) when formatting JSON.
Installation
Open Visual Studio Code.
Go to the Extensions view (Ctrl + Shift + X or Cmd + Shift + X).
Search for "Inline JSON Formatter".
Click "Install" to install the extension.
Usage
Format Selected JSON
Select the JSON text you want to format.
Execute the command inline-json-formatter.formatSelectedJSON.
Stringify JavaScript Object
Select the JavaScript object.
Execute the command inline-json-formatter.stringifyJavaScriptObject.
Format with Custom Space
Select the JSON text.
Execute the command inline-json-formatter.formatWithCustomSpace.
Choose the desired formatting space (indentation level).
Configuration
The extension uses the following configuration:
json.formattingSpace: Default formatting space (indentation level). (Default: 2)
You can customize this configuration in your VSCode settings.
Contributing
Contributions are welcome! Feel free to submit bug reports, feature requests, or contribute to the development of the extension.
Fork the repository.
Create your feature branch (git checkout -b feature/your-feature).
Commit your changes (git commit -am 'Add some feature').
Push to the branch (git push origin feature/your-feature).