Flex Compiler Shell Controller, jEdit and Error List
Getting the most out of jEdit and Flex with a couple tweaks. 2008-11-28
I stumbled across the Flex Compiler Shell Controller from hasseg.org that runs the Flex Compiler Shell in screen. You can communicate to it by issuing commands almost identical to FCSH. I really like FCSH but totally agree with Ari how its interactive nature makes it problematic. I would like it to function more like a daemon, and exit out after compilation. And this is exactly what fcshctl fixes.
jEdit, my editor of choice, allows you to execute your compiler in its shell. This built-in shell is just a system shell. Bash on linux and OS X, and a DOS prompt on windows. BUT what it also does is run a number of regex patterns that are executed over the output of the shell. There are presets for perl, .NET and many others, and you can create your own. When the console hits one of these regexes, then it will put the output into the Error List like so:
This is great because it creates clickable summaries, similar to what you would get in Eclipse or other editors. Setting up the pattern is quite easy. In jEdit go to Plugins->Options and in the panel choose Console->Error Patterns. Create a new pattern by clicking on the plus :
- Name- ActionScript
- Error Regexp- (.*)[(](\d+)[)]:(?: col: (?:\d+))? *Error: (.*)
- Warning Regexp- (.*)[(](\d+)[)]:(?: col: (?:\d+))? *Warning: (.*)
- Extra Lines Regexp- (blank)
- Filename- $1
- Line number- $2
- Error message- $3
And here is what I currently use to test that it functions:
/Users/chris/Projects/adobegroupwall/Production/src/com/terralever/groupwall/controls/CommentsModal.mxml(37): Error: In initializer for 'overrides': type mx.containers.VBox is not assignable to target type Array or target element type .
/Users/chris/Projects/adobegroupwall/Production/src/com/terralever/groupwall/commands/EditModeratorsCommand.as(137): col: 4 Error: Access of undefined property PopUpManager.
PopUpManager.removePopUp(model.view.modal);
^
/Users/chris/Projects/adobegroupwall/Production/src/com/terralever/groupwall/commands/ShowCommentsCommand.as(68): col: 1 Warning: return value for function 'onCommentsResult' has no type declaration.
{
^
/Users/chris/Projects/adobegroupwall/Production/src/com/terralever/groupwall/controls/CommentsModal.mxml(31): Error: Access of undefined property model.
Once you have added that error pattern, compiling using fcshctl(or mxmlc, etc) will populate your Error List with clickable links to the errors in your code. For more customizability, you can go to Plugins->Options and click on Error List for more options.
I've been using fcshctl for over a week now with few interruptions. Its been solid and reliable, but has occasionally required me to do an 'rm' to the log file to get it back to working. Regardless, kudos to Ari for making this, its become an indispensable tool for me. Coupling it with Error List has made jEdit even better!
|