views:

678

answers:

2

I'm running the flex compiler (mxmlc) from ant inside eclipse for some of our builds (they are meant to run on our continuous integration server as well, that is why I don't build using flex builder itself) -- the patterns of mxmlc are not recognized by the eclipse-console, so I cannot click on them.

The patterns is like this:

<absolute path to file>(<line no>): col: <column no> Warning: <message>

It should not be that hard to come up with a regex for detecting these messages.

How do I get eclipse to recognize a new type of error message? Do I have to program my own extension or is there some general support where I can just add a regex to the configuration?

I could also try to make ant translate the errors to something that looks like java errors, but I'd rather make eclipse recognize the mxmlc errors.

A: 

Grep Console plugin will do exactly that.

zvikico
Thanks for your answer. That's a handy plugin, but it looks like it can only color the output based on a pattern -- I want to be able to click on a filename in the output (and have eclipse open the file)
Simon Groenewolt
+4  A: 

EDIT: I found a plugin that does this with a bit more looking: Sunshade Errorlink (scroll down a bit). I'm not sure exactly how flexible this is, but it mentions ant support.


I know you probably want an actual implementation, but here is a rough starting point for a design for the plugin you want. If anyone feels like implementing it, please put a link here to point to it. I might do it myself if I get some spare time (ha!) :)

Assuming that the console is based on TextConsole, which seems reasonable, the spec says:

An abstract text console that supports regular expression matching and hyperlinks.

Pattern match listeners can be registered with a console programmatically or via the org.eclipse.ui.console.consolePatternMatchListeners extension point.

I did a bit more looking, and the spec for that extension point has the following example:

<extension point="org.eclipse.ui.console.consolePatternMatchListener">
  <consolePatternMatchListener
    class="com.example.ExampleConsolePatternMatcher"
    id="com.example.ExampleConsolePatternMatcher"
    regex=".*foo.*">
    <enablement>
      <test 
        property="org.eclipse.ui.console.consoleTypeTest"
        value="exampleConsole"/>
    </enablement>
  </consolePatternMatchListener>
</extension>

You'll want the API of the IPatternMatchListenerDelegate and you should then be able to use TextConsole.addHyperlink to create the link you want.

Mike Houston
Interesting - I'll give it a try.
Simon Groenewolt
I havent fully finished my testing, but the pointers are good enough :-)
Simon Groenewolt