HookyQR / VSCodeBeautify

Enable js-beautify (https://github.com/beautify-web/js-beautify) in VS Code
MIT License
606 stars 180 forks source link

Doesn't do anything #276

Closed moxley closed 5 years ago

moxley commented 5 years ago

NOTE: Please provide code snippets instead of screen shots. Your issue needs to be replicated, and we need the failing code (text) to do this.

Note: I just installed Beautify for the first time. I've used the Beautify package for Atom, which works great.

Provide the settings you use: (VS Code workspace and user settings, .jsbeautifyrc, .editorconfig)

$ cat ~/.jsbeautifyrc
cat: /Users/mstratton/.jsbeautifyrc: No such file or directory
$ cat ~/.editorconfig
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.py]
indent_style = space
indent_size = 2

Action performed

With a saved JSON file open with the contents:

  {"access_token":"whatever","created_at":1540410886}

Press F1, and select "Beautify file".

Expected results

Expected contents of file to be formatted, something like this:

{
  "access_token": "whatever",
  "created_at": 1540410886
}

Actual results

Nothing happened. The file contents are the same as before.

Additional Notes

I opened Developer Tools, ran the same steps above, and nothing appeared in the console.

js-beautify

Maybe I need to install js-beautify? I tried that: npm -g i js-beautify, then in VSCode, called the "Reload Window" command. I tried the same steps described above, and got the same results.

js-beautify config files=

Maybe I need to create a js-beautify config file?

cat > ~/.jsbeautifyrc
{}

Tried same reproduction steps as above, and got the same result.

AMAFsoft commented 5 years ago

Enable editor.FormatOnSave in user settings

moxley commented 5 years ago

Enable editor.FormatOnSave in user settings

I don't want to format on save. I'm trying the Beautify file command. Maybe I don't understand what Beautify file is supposed to do (it appears to do nothing)?

HookyQR commented 5 years ago

Odd. You don't need to install js-beautify, it's included internally. You don't need to have a config file. I can't seem to replicate the issue unfortunately.

HookyQR commented 5 years ago

Closing due to lack of response.