Eclipse控制台:检测警告和错误模式并使其可点击 [英] Eclipse console: detect warning and error patterns and make them clickable

查看:530
本文介绍了Eclipse控制台:检测警告和错误模式并使其可点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在eclipse中运行ant中的flex编译器(mxmlc),用于我们的一些构建(它们也是在我们的连续集成服务器上运行,这就是为什么我不使用flex builder本身构建) - 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.

模式是这样的:

<文件的绝对路径>(<行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.

推荐答案

编辑:
我发现一个插件,这样做有点多: Sunshade Errorlink (向下滚动一下)。我不知道这是多么灵活,但它提到蚂蚁的支持。

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.

我知道你可能想要一个实际的实现,但这里是您想要的插件的设计的一个粗略的起点。如果有人觉得实现它,请在这里指出一个链接。如果我有空余时间,我可能会自己做(ha!):)

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,这似乎是合理的, spec 说:

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.

模式匹配监听器可以通过编程方式
或通过 org.eclipse.ui.console.consolePatternMatchListeners
扩展点向控制台注册。

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>

您将需要 IPatternMatchListenerDelegate 和你应该能够使用 TextConsole.addHyperlink 创建所需的链接。

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控制台:检测警告和错误模式并使其可点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆