Code Monkey home page Code Monkey logo

vscode-fix-json's Introduction

fix-json

fix-json uses jsonic to parse json data in the current editor, then reformats the content using a simple JSON.stringify call.

You can enter JSON data using the relaxed rules supported by jsonic. For instance, quotes around property names and many string values are not required. This makes it much easier to type JSON, or to convert JavaScript objects into valid JSON.

Features

Simply run the Fix JSON command in VS Code to fix either the selected content in the current file, or the complete file if there is no selection.

Running Fix JSON

Error detection

If errors are encountered during the process of parsing your existing content, they will be visualized in the editor.

Running with an error

Indentation

The extension indents the generated JSON using a default number of spaces as configured in your editor.tabSize setting. You can use the setting fixJson.indentationSpaces to override the number specifically for this extension.

No effort is made to provide formatting beyond the standard output from JSON.stringify(text, null, indentation). I recommend using Prettier.

Extension Settings

This extension contributes the following settings:

  • fixJson.indentationSpaces: Number of spaces to use for indentation of formatted JSON output. If not set, your editor.tabSize setting is used.

Release Notes

0.1.2

Initial release of fix-json.

vscode-fix-json's People

Contributors

oliversturm avatar

Stargazers

HouJia avatar Ilya Golovin avatar Mick Dekkers avatar aki avatar sugaryo avatar kuceb avatar Eugene Dementiev avatar Dario Ruellan avatar

Watchers

James Cloos avatar  avatar  avatar

vscode-fix-json's Issues

Request: Format / Fix on save

I must be missing something, but why can't VSCode autofix a trailing comma when it already recognizes and declares it visually as an error?

Anyway: thank you for your plug in (although I'm confused to why vscode doesn't do this out of the box) –

I'm wondering if there's a way to always run it on save?

Thanks!

OpenVSX support

Please upload your extension to openVSX as my Arch installation stop finding it after the marketplace switch.

Thanks

Long类型丢失精度

格式化的时候,Long类型会丢失精度
例子:
{"studentId":1805193908859179009,"taskId":3597528,"title":"【三年级】12版","userId":"07bf7762916f41ecaa5c0a4569e30ffa"}

Not registered as a formatter

I would love if this was registered as a formmatter for js and json and json with comments etc
we could use the custom formatters extension I think
but anyways please make this a vscode formatter that is listed when using "Format Document With"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.