Is it possible to format / decorate Javascript in pycharm?

The option Pycharm + command + L for formatting HTML or python files is very convenient, but does not seem to work for JS, is this an option?

+6
source share
3 answers

Yes, it is (you can format / decorate Javascript)!
The trick is in TextMate bundles . Below are instructions for the Pycharm community 2018.1.4.

1) Go to the TextMate repository and find the javascript tundle
2) Download the zip and unzip
3) In Pycharm, go to Settings → Editor → TextMate Bundles
4) Add a new Bundle through the green +top right javascript.tmbundle-masterand select the folder javascript.tmbundle-master
5) If you get the same yellow box with the inscription Some extensions declared in attached bundles are already used by native file types., then Show detailsUnregister native file type
6) Then Pycharm will reindex, which can take a long time. After indexing is complete, you should see javascript text highlighting.

enter image description here

Here is an example of arbitrary code

enter image description here

0
source

This works to decorate js on windows in PyCharm Professional 2018.3:

  1. Make sure your cursor is active inside the JS file you want to decorate.
  2. Alt + Ctrl + Shift + "L", " "
  3. " " " " " "
0

This is Reformat Codean option.Alt+Shift+F

-1
source

Source: https://habr.com/ru/post/1658037/


All Articles