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.
- 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.
- 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.
- Select the JSON text you want to format.
- Execute the command
inline-json-formatter.formatSelectedJSON
.
- Select the JavaScript object.
- Execute the command
inline-json-formatter.stringifyJavaScriptObject
.
- Select the JSON text.
- Execute the command
inline-json-formatter.formatWithCustomSpace
. - Choose the desired formatting space (indentation level).
The extension uses the following configuration:
- json.formattingSpace: Default formatting space (indentation level). (Default: 2)
You can customize this configuration in your VSCode settings.
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
). - Open a pull request.