facebook

Unable to enable Beautify for .js/.jsx – all instructions outdated ?

  1. CodeMix & Angular IDE
  2.  > 
  3. Getting Help
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #661997 Reply

    twtorque
    Participant

    Since CodeMix ignores the normal Eclipse code formatting settings, Google suggested that I must use Window/Preferences/CodeMix/Formatter.

    Window/Preferences/CodeMix/Formatter offers only options for HTML (despite having the React CodeMix plugin installed) and suggests checking out Window/Preferences/CodeMix/Extensions.

    Window/Preferences/CodeMix/Extensions/Beautify suggests that it must be enabled for certain file types. It does not indicate any way to accomplish that. it links to codemix.code-workspace, which appears to be an undocumented settings file. There are no indications how to use it to link a language to Beautify.

    Window/Preferences/CodeMix/Extensions/TypeScript suggests that formatting options are available under Window/Preferences/CodeMix/Formatter (‘Go back to step two’). They are not, as shown above.

    Window/Preferences/CodeMix/Extensions/TypeScript/JavaScript actually has options, though it is unclear when and where those options apply, and the selection is extremely limited (not even including something as fundamental as line width).

    Many, many posts on this forum suggest that Beautify can be activated through a setting under Window/Preferences/CodeMix/Settings/Workspace Settings. There is no Window/Preferences/CodeMix/Settings.

    I am at a loss at how to limit my line length, whether this is even something that is possible with CodeMix (the default Eclipse configuration options in this regard are apparently blocked by CodeMix), and quite frankly, I am a bit baffled by this bizarre rat maze something this absolutely basic is hidden behind 🙁

    Any help would be appreciated.

    Setup: I just installed a fresh Eclipse a few days ago, and installed a fresh CodeMix also a few days ago. I used the instructions on this site and dragged the marketplace installer into my workspace.

    #662000 Reply

    support-swapna
    Moderator

    Hi,

    Sorry that you are having trouble with formatting settings in CodeMix.

    To enable Beautify for a particular file extension, you can either do it from the editor or add this flag to the settings file (for JS) :

    "[javascript]": {
          "editor.defaultFormatter": "HookyQR.beautify"
        }

    From the editor, i.e when you have a JS file opened, invoke Ctrl/Cmd+Shift+F, an overlay at the top of the editor appears displaying which formatter is being used. You can click on ‘Configure’ to change the formatter setting to use Beautify. This will add the flag for that particular file type to the settings file as I mentioned above.

    Beautify will pick up the formatting settings from the .jsbeautifyrc file which should ideally be present under the project root directory. If no .jsbeautifyrc file is found, then it will pick up the formatting settings from the Preferences page.

    To understand how formatting works with CodeMix, please see this link which also includes Beautify configuration and external links to .jsbeautifyrc file settings : https://www.genuitec.com/docs/workbench/formatting-in-codemix/

    Coming to the Line Length, you can limit it for JavaScript in the .jsbeautifyrc file by adding the flag as shown below :

     "js": {
         "wrap_line_length": 20
        }

    There is content assist available in the .jsbeautifyrc file and you can see which advanced formatting settings are available.

    TypeScript related formatting settings are available under Window/Preferences/CodeMix/Extensions/TypeScript/TypeScript Format. Sorry for the confusion. We will make the corrections soon.

    Hope this helps. Please let us know if you have any further questions.

    Apologies for any inconvenience caused.

    –Swapna
    Genuitec Support

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Unable to enable Beautify for .js/.jsx – all instructions outdated ?

You must be logged in to post in the forum log in