问题描述
我从eclipse里面的ant里面运行flex编译器(mxmlc),对于我们的一些构建(他们也想在我们的持续集成服务器上运行,这就是为什么我不使用flex构建器本身) - mxmlc的模式不能被eclipse控制台识别,所以我不能点击它们。
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.
模式是这样的:
<文件的绝对路径>(< line no>):col:< column no>警告:< message>
<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.
如何让eclipse识别新类型的错误讯息?我必须编程自己的扩展或有一些一般的支持,我可以只是添加一个正则表达式配置?
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?
我也可以尝试使ant翻译错误看起来像java错误的东西,但我宁愿让eclipse识别mxmlc错误。
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.
推荐答案
我发现了一个插件,可以更加引人注目: (向下滚动一下)。我不知道这是多么灵活,但它提到蚂蚁的支持。
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!) :)
假设控制台基于TextConsole,这似乎合理,有以下示例:
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>
您将需要 and您应该可以使用创建您想要的链接。
You'll want the API of the IPatternMatchListenerDelegate and you should then be able to use TextConsole.addHyperlink to create the link you want.
这篇关于Eclipse控制台:检测警告和错误模式,并使其可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!