Thursday, May 05, 2011

Using Flex Formatter with IntelliJ

Flex Formatter is one of my favorite plugins for FlashBuilder, unfortunately there's no plugin version for IntelliJ.

But thanks to IntelliJ's "External Tools", you're able to use any tool that can be run from the command line (think apparat, sprouts, etc) and execute it with a keyboard shortcut within IntelliJ! The video below shows you how:

Running FlexFormatter from the Command Line:

Download the files below:



Sample file:


  1. Than you! Cool util!
    I have long dreamed about the utility sorting methods.

  2. Nice information and i got a lot from this video.,

  3. Nikos6:15 AM

    cool but IDEA already has ctrl + shift + L reformat code

  4. Anonymous6:21 AM

    FlexFormatter supports element reordering, attribute reordering, and other super advanced formatting features not found in IntelliJ's formatter.

  5. Ricardo Schalch4:38 PM

    Are you ok man ? Where are the old anf good tutorials ? ^ ^

  6. Anonymous4:39 PM

    Yup, I'm alive and kickin'. Just been working on some side projects rather than tutorials recently. Too many things in life to do, eh?

  7. Wow thanks thats very nice. I am just making the switch form Flash Builder to intelliJ. Flex formatter was one of my favourite plugins from Flashbuilder so its awesome I can use it in my new IDE, handily I put my properties file in dropbox to share between my machines, so I can point the external tool at that and if i ever need to muck around with the settings I just open Flashbuilder on my work computer.

  8. Nice.. I was looking for that. Thank you, John!

  9. This comment has been removed by the author.

  10. I followed the same exact steps but I got the below exception. Any Idea ?

    C:\Program Files\Java\jdk1.6.0_35\bin\javaw.exe" -Djava.ext.dirs=. utilities.CommandLine " C:\Users\cyeluri\Trellis\Branches\R2.1-DEV\OneLineDiagram\src\main\flex\com\avocent\trellis\domain\model\" C:\Users\cyeluri\tools\flexFormatter\ 4 true
    Error: File/Directory does not exist: C:\Users\cyeluri\Trellis\Branches\R2.1-DEV\OneLineDiagram\src\main\flex\com\avocent\trellis\domain\model\
    [0]=full file/directory path, required parameter
    [1]=location of property file with settings, default=empty property set
    [2]=tabSize, default=3
    [3]=true->format, false->indent, default=false
    [4]=java charset name, ex. UTF8. Defaults to the default charset.