// you’re reading...

Flash Builder Development

Alpha Plugin featuring quick fix support and error highlighting available for Flex Builder 2 Beta 3

With the release of Flex Builder 2 Beta 3, I can finally release a side project I’ve been working on here at Adobe. This side project is a new plugin that enables a couple experimental features that didn’t make the cut for Flex Builder 2.0. Currently these features are only enabled in the ActionScript Editor, but MXML Editor support will be forthcoming. The features include:

  • quick fix support, including:
    • missing variable and function return type inference and completion. view example
    • variable creation for both members and scoped variables when a variable declaration is omitted. view example
    • import insertion for undefined type errors view example
    • import removal when an import does not exist
    • modifier fix-up for incorrect modifiers
  • error and warning highlighting for all compiler problems

For those not familiar with the term quick fix, it’s a very specialized type of language intelligence that uses both compiler errors and parse tree information to propose solutions to coding errors and mistakes. Just as code hints are a type of language intelligence for writing code, quick fix is a type of language intelligence for fixing code.

Here’s an example:
You create a variable in ActionScript, but omit the type of the variable. When you save in Flex Builder, the compiler returns a warning and from that warning, we generate a list of potential fixes for this warning. By pressing Ctrl + 1, a list of completions is presented, proposing solutions to the coding problem:
quick fix example

As you can see, there’s a light bulb icon in the left gutter which is how Flex Builder 2 informs the user that a quick fix exists. As you can also see, the offending piece of code is highlighted as well. Errors work the same way, underlining errors in red and putting a red light bulb in the gutter.

This is just one example of the quick fixes that are included in this plugin and there are many more to help fix your code.
For more information and to get started, there’s a new page on this blog about this plugin.

Please remember this is plugin is not supported by Adobe Systems, and has not been tested by the QE team.
This plugin takes advantage of two extension points that I added to Flex Builder 2 which I will blog about at a later date. The extension points are not officially support, nor are they guaranteed to exist in future version of Flex Builder 2.

Discussion

Comments are disallowed for this post.

  1. [...] One of our engineers, David Zuckerman, has cooked up an extension to Flex Builder that does quick fixes. Definitely worth checking out! [...]

    Posted by kuwamoto.org » Blog Archive » New extension for Flex Builder - quick fix | May 8, 2006, 7:18 pm
  2. I followed the instructions and successfull installed the plugin.

    After restarting the flex builder 2 beta 3, I declared a variable without specifying a type, the compiler threw an warning. but when i press Ctrl + 1, nothing happend?

    Posted by Larry | May 8, 2006, 9:21 pm
  3. Hi Larry- two questions: are you using the MXML or ActionScript editor and do you see a yellow highlight underneath the untyped variable? Feel free to contact me at alpha at davidzuckerman dot com

    Posted by david.z | May 8, 2006, 9:26 pm
  4. Hi,

    Thanks! I know what the problem was.

    The file that I was trying to compile is MXML file. and I didn’t see the yellow highlight underneath the untyped variable.

    I created an actionscript class file and delcared a variable inside the class without a type. The light bulb showed up!

    So the fix only works when you editing a actionscript file?

    Posted by Larry | May 8, 2006, 10:23 pm
  5. Currently yes, but for official release of Flex Builder 2, quick fix will work in MXML files as well. Glad you got it working!

    Posted by david.z | May 8, 2006, 10:26 pm
  6. [...] With efforts like this, Adobe will continue to attract enterprise level developers to the Flex product line as the industry leading RIA platform—check out David Zuckerman’s quick fix plugin for Flex Builder 2. [...]

    Posted by Got RIA? » Blog Archive » Flex Builder 2 Quick Fix Plugin | May 9, 2006, 8:45 am
  7. [...] David Zuckerman, also on the Flex Builder team, has written a totally awesome extension plugin for Flex Builder. It provides “Quick Fix” — with a quick keystroke or two, you can tell Flex Builder to automatically fix certain common errors and warnings. For example, say you wrote this: function f() { return “hello”; } [...]

    Posted by Mike Morearty’s blog » Blog Archive » Quick fix! | May 9, 2006, 9:41 am
  8. [...] Those of you who prefer more bleeding edge software should check out David’s Editor Enhancements Alpha.  This adds some more JDT like functionality to Flex Builder, including Quick Fix support and some error highlighting.  All of this stuff is offiicially unsupported by Adobe, but I highly reccommend bugging the crap out of David if you have any issues.  He needs more mail anyway. [...]

    Posted by Confessions of teh HotCrab » Blog Archive » Flex Builder Update | May 9, 2006, 10:37 am
  9. Very sad such functionality isn’t included by default. Developers will really miss it if Adobe won’t force the coding usability implementation and keep the poverty of old good Flash coding UI. I don’t believe this is Flash IDE karma!

    Posted by F.Ripper | May 10, 2006, 11:37 am
  10. super cool david! thanks for posting this… :)

    eagerly looking forward to more plug-ins,
    colin

    Posted by colin | May 11, 2006, 6:25 am
  11. Hi David,

    I can’t download the plugin. An alert shows “No features found on the selected site”. Please could you check if the url is ok?

    Thanks

    Posted by Carlos Rovira | May 18, 2006, 11:02 am
  12. Carlos, make sure you are using http://www.davidzuckerman.com/adobe/alpha/update/

    Also, if you don’t have Flex Builder Beta 3 installed, you won’t be able to install this plugin either. If that doesn’t work, please send me a message at alpha at davidzuckerman dot com

    Posted by david.z | May 19, 2006, 11:38 am
  13. Hi,

    I have the same problem than Carlos. Can’t install your plugin. I have eclipse 3.1.1 and flex 2.0 beta 3. Any help?

    How can i install it manually.

    Thanks in advance.

    Posted by dougi | May 23, 2006, 3:18 am
  14. Great plug-in! This made my day!

    I would love to read more about extension points and plugins for Flex.

    Please keep in extension points. +1 vote

    Posted by judah | May 23, 2006, 5:08 am
  15. [...] Addendum: After spending time reading the Adobe blogs and seeing what some of the Adobe developers are doing I am more confident in the outcome of Flex. [...]

    Posted by A Dash of Flash » Blog Archive » Chasing the (technology) dragons tail | May 23, 2006, 9:16 am
  16. In some case the “software update” install can failed if your “Environnement” caracteristics don’t match exactly with what is set in the plugin feature.xml file :
    os=”win32″
    nl=”en”

    In this case you can already use the “software updade mode” by uncheck the “Ignore features not applicable to this environment” option in the software update wizard.

    For exemple, in my case, my OS is in french, and without unchecking this option I’ve got the error : “No features found on the selected site” …

    Else thanks a lot for this great feature David !

    Posted by Bo | May 26, 2006, 12:48 pm
  17. hi

    i installed that plugin in another directory.. it is installed.. after that when i did the mistake in the declaration of the variable.it shows the bulb .but when i press ctr + 1 .. it is showing nothing …what to do

    is that plugin is installed or not correclty.. please let me know….

    thank you

    Posted by satish | July 25, 2006, 11:02 pm
  18. David, thank you again for good tool!

    I’ve used it succesfully through Flex 2 Beta 3 but now…

    I’ve failed to install/use Alpha Plugin under Flex Builder 2 Release (non-plugin, full version).

    First, the installation process goes as is should, everything looks ok, and at the end of install process Flex asks me to restart it.

    After restart Alpha plugin seems to be semi-working. For example, it highlights errors but fails with quick fix. Then, errors highlighting even disappear.

    I decide to disable the plugin and here’s one more surprise: when i go to Help > Software Updates > MAnage Configuration I don’t see Alpha Plugin there even when “Show disabled features” option is on.

    Maybe its just my stupidity. I want to ask everyone who uses Aplha Plugin — did you experienced such troubles and if so, how to avoid them?

    Posted by Rostislav Siryk | August 3, 2006, 6:43 am
  19. Just a quick note: i’ve tried manual install descbibed here too:
    http://davidzuckerman.com/adobe/2006/05/23/manually-install-the-alpha-pluginquick-fix/

    Unhappily, this doesn’t help..

    Posted by Rostislav Siryk | August 3, 2006, 6:57 am
  20. So I”m pretty sure the plugin works in the release version (I’ve been using it) but I’ll double-check. I’ll be releasing an updated version of the plugin now that I’m back from a much-needed vacation

    Posted by david.z | August 4, 2006, 1:30 pm
  21. when i try to do a quick fix i get an error:

    “quick fix” did not complete normally:

    Reason:
    java.lang.NullPointerException

    Posted by e.j. | August 11, 2006, 9:53 am
  22. has anyone found a way to get code templates (like FDT or Java) working in flex?

    Posted by e.j. | August 11, 2006, 9:58 am
  23. Hi e.j. -

    I e-mailed you about this issue. Hopefully we can track it down and get a fix for it. Thanks!

    -David

    Posted by david.z | August 11, 2006, 10:00 am
  24. Great add-on! I agree, this would’ve put Flex over-the-top for developers if it was part of the release. Maybe Flex 2.1? hehe.

    Posted by Chris Charlton | October 29, 2006, 9:11 am