HookyQR / GitHubAPITestVSC

MIT License
0 stars 0 forks source link

MD tested #4

Open HookyQR opened 8 years ago

HookyQR commented 8 years ago

js-beautify for VS Code

Build Status

VS Code uses js-beautify internally, bit it lacks the ability to modify the style you wish to use. This extension enables running js-beautify in VS Code, AND honouring any .jsbeautifyrc file in the open file's path tree to load your code styling. Run with F1 Beautify.

This package includes hints when editing your .jsbeautifyrc. Only the first file found will be used. If the format is bad, the default js-beautify settings will be used, but a warning will be issued to let you know. Comments in your settings file are acceptable (they're removed before the file is parsed). The embedded schema for .jsbeautifyrc has also been published at JSON Schema Store which allows users of VSCode 0.10.3 to add it manually to their user or workspace settings:

"json.schemas": [
    {
        "fileMatch": ["**/.jsbeautifyrc"],
        "url": "http://json.schemastore.org/jsbeautifyrc"
    }
]

Also runs http and css beautify from the same package, as determined by the file extension. The schema indicates which beautifier each of the settings pertains to.

The .jsbeautifyrc config parser accepts sub elements of html, js and css so that different settings can be used for each of the beautifiers (like sublime allows). Note that this will cause the config file to be incorrectly structure for running js-beautify from the command line.

Settings are inherited from the base of the file. Thus:

{
    "indent_size": 4,
    "indent_char": " ",
    "css": {
        "indent_size": 2
    }
}

Will result in the indent_size being set to 4 for Javascript and HTML, but set to 2 for css. All will get the same intent_char setting.

If the file is unsaved, or the type is undetermined, you'll be prompted for which beautifier to use.

Extra (permanent) file extension may be added under user or workspace settings.

Embedded version of js-beautify is v1.5.10.

Changes:

0.0.6: 27 Dec 2015

HookyQR commented 8 years ago

update test

HookyQR commented 8 years ago

again