Menu

#253 Apply FlexPrettyPrintCommand.prefs outside Eclipse plugin

open
nobody
None
5
2013-05-28
2013-05-23
jcfranco
No

Is it possible to apply the FlexPrettyPrintCommand.prefs file outside an Eclipse environment (e.g., command-line tool + IntelliJ)? I'm trying to make the tool format XML files, but I have yet to find a way to set this without relying on the Eclipse plugin.

Thanks,

-JC.Franco

Discussion

  • jcfranco

    jcfranco - 2013-05-24

    I already have the tool set up in IntelliJ, but haven't found out how to include XML files for formatting. Adding MXML.additionalXMLExtensions=xml to MyFormattingRules.properties does not seem to work.

    After some digging around, I found out that this setting, along with others (e.g., format on save), are stored in [WORKSPACE].metadata.plugins\org.eclipse.core.runtime.settings\FlexPrettyPrintCommand.prefs, but the documentation does not mention anything about this preference file.

    Is this preference file needed in order to format XML files or am I missing something?

     
  • Ernest

    Ernest - 2013-05-24

    Oh, sorry, I misunderstood your question.

    Unfortunately, it does not look like the command line utility has a way to configure the file extensions honored: it ignores files that aren't .as or .mxml.

    The setting you found is honored inside Eclipse but is separate from the formatting configuration.

    The only option you have right now is ugly: rename target file to have extension .mxml, format, rename back.

    Of course, it would not be hard to provide an extra command line option to allow extra extensions to be specified. Or to honor a property in the preferences file, but I don't know if I would want to do that.

     
  • jcfranco

    jcfranco - 2013-05-24

    How about an optional parameter that points to an external prefs file? This would allow the tool to behave similarly to the Eclipse plug-in by importing/applying the settings before formatting.

     
  • Ernest

    Ernest - 2013-05-24

    No promises, but I'll see if I can take a look this weekend. Shouldn't be a huge deal, but I have to find some motivation and remember how to build an update for the project :)

     
  • jcfranco

    jcfranco - 2013-05-24

    Thanks! :D

     
  • Ernest

    Ernest - 2013-05-26

    Okay, I put a new version at all the usual places (after having a bit of trouble remembering how to build the deployment) with support for adding that property to the property file. I decided that the other properties were too Eclipse environment specific, so I didn't want to add support for another property file. Adding MXML.additionalXMLExtensions=xml to your existing property file should now work.

     
  • jcfranco

    jcfranco - 2013-05-28

    Once again, thank you!

     

Log in to post a comment.