Eclipse问题视图的最佳实践

时间:2021-07-07 03:25:13

I am using Eclipse for quite some time and I still haven't found how to configure the Problems View to display only the Errors and Warnings of interest. Is there an easy way to filter out warnings from a specific resource or from a specific path? For example, when I generate javadoc I get tons of irrelevant html warnings. Also, is there a way to change the maximum number of appearing warnings/errors?

我使用Eclipse已经有一段时间了,我还没有找到如何配置Problems View以仅显示感兴趣的错误和警告。是否有一种简单的方法可以过滤掉特定资源或特定路径的警告?例如,当我生成javadoc时,我得到了大量无关的html警告。另外,有没有办法更改出现的警告/错误的最大数量?

I am aware of the filters concept, but I am looking for some real life examples. What kind of filters or practices do other people use?

我知道过滤器概念,但我正在寻找一些现实生活中的例子。其他人使用什么样的过滤器或做法?

Edit: I found the advice to filter on "On selected element and its children" to be the best one. I have one other issue however. If I have "a lot" of warnings or errors, only the first 100 appear. In the rare case I want to see all of them, how do I do it?

编辑:我发现过滤“On selected element及其子元素”的建议是最好的。但是我有另一个问题。如果我有“很多”警告或错误,只会出现前100个。在极少数情况下,我想看到所有这些,我该怎么做?

7 个解决方案

#1


62  

I feel that filtering "On selected element and its children" is the best mode of Problems view filter, because it allows you to very quickly narrow down the scope of reported problems: click on Working Set (in Package Explorer), and it shows all problems in all projects in the set; click on a project - and only problems in the selected project appear. Click on individual class (or package) - only problems in the selected class (or package) are shown. So you don't get distracted with problems unrelated to your task at hand.

我觉得过滤“在选定元素及其子元素上”是问题视图过滤器的最佳模式,因为它允许您非常快速地缩小报告问题的范围:单击工作集(在包资源管理器中),它显示所有集合中所有项目的问题;单击项目 - 仅显示所选项目中的问题。单击单个类(或包) - 仅显示所选类(或包)中的问题。因此,您不会因与手头任务无关的问题而分心。

#2


31  

In the top right hand corner of the problems pane is a filter button (it looks like three arrows pointing to the right), clicking that will let you configure the view. You can filter by element, such as the class you're editing or working set, the type of problem (e.g. java problems, buildfile problems etc..) and by severity. It's actually very configurable.

在问题窗格的右上角是一个过滤器按钮(它看起来像三个指向右侧的箭头),单击该按钮可以配置视图。您可以按元素过滤,例如您正在编辑的类或工作集,问题类型(例如java问题,构建文件问题等)和严重性。它实际上是非常可配置的。

See http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/cprbview.htm for details and screenshots.

有关详细信息和屏幕截图,请参阅http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/cprbview.htm。

#3


21  

To view more than 100 warnings, go to the problem view's drop down menu (use the little arrow next to the minimize button on the view), select Preferences, and you will have the option to change this limit from 100 to another number.

要查看超过100个警告,请转到问题视图的下拉菜单(使用视图上最小化按钮旁边的小箭头),选择首选项,您可以选择将此限制从100更改为另一个数字。

This information is for Ganymede; things have changed since Europa and I'm not sure of all the differences.

此信息适用于Ganymede;自欧罗巴以来情况发生了变化,我不确定所有的差异。

#4


5  

An updated link for Ganymede (Eclipse 3.4):

Ganymede的更新链接(Eclipse 3.4):

http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.user/concepts/cprbview.htm

But I agree with the fundamental problem: the Problems view needs filtering by Resource, not just Description.

但我同意基本问题:Problems视图需要按资源过滤,而不仅仅是描述。

In my case, I include generated jsp code in my source path, and there are all kinds of warning that occur in the *_jsp.java files (like unused application, page, out, config, page_context variables). So it would be nice to exclude them by the Resource pattern. (Or for jspc to not write unused code...but that's a different issue altogether).

在我的例子中,我在源路径中包含生成的jsp代码,并且* _jsp.java文件中存在各种警告(例如未使用的应用程序,页面,输出,配置,page_context变量)。所以用Resource模式排除它们会很好。 (或者jspc不写未使用的代码......但这完全是另一个问题)。

#5


5  

Re: your edit

Re:你的编辑

In the drop down button by the filter button, there is a preferences option. Uncheck "Use Marker Limits" and you will be shown all errors + warnings.

在过滤器按钮的下拉按钮中,有一个首选项选项。取消选中“使用标记限制”,您将看到所有错误+警告。

#6


2  

In order to view more than 100 warnings, go to the problem view's drop down menu (use the little arrow next to the minimize button on the view), select Configure Contents. Uncheck the Use item limitsat the bottom left of the Configure Contents window or set a limit in the Number of items visible per group:.

要查看100多个警告,请转到问题视图的下拉菜单(使用视图上最小化按钮旁边的小箭头),选择配置内容。取消选中“配置内容”窗口左下角的“使用项目限制”,或在“每组可见的项目数”中设置限制:。

#7


1  

Open problems view. Click corner triangle. Select preferences

打开问题视图。单击角三角形。选择首选项

Uncross: [ ] Use marker limits

Uncross:[]使用标记限制

#1


62  

I feel that filtering "On selected element and its children" is the best mode of Problems view filter, because it allows you to very quickly narrow down the scope of reported problems: click on Working Set (in Package Explorer), and it shows all problems in all projects in the set; click on a project - and only problems in the selected project appear. Click on individual class (or package) - only problems in the selected class (or package) are shown. So you don't get distracted with problems unrelated to your task at hand.

我觉得过滤“在选定元素及其子元素上”是问题视图过滤器的最佳模式,因为它允许您非常快速地缩小报告问题的范围:单击工作集(在包资源管理器中),它显示所有集合中所有项目的问题;单击项目 - 仅显示所选项目中的问题。单击单个类(或包) - 仅显示所选类(或包)中的问题。因此,您不会因与手头任务无关的问题而分心。

#2


31  

In the top right hand corner of the problems pane is a filter button (it looks like three arrows pointing to the right), clicking that will let you configure the view. You can filter by element, such as the class you're editing or working set, the type of problem (e.g. java problems, buildfile problems etc..) and by severity. It's actually very configurable.

在问题窗格的右上角是一个过滤器按钮(它看起来像三个指向右侧的箭头),单击该按钮可以配置视图。您可以按元素过滤,例如您正在编辑的类或工作集,问题类型(例如java问题,构建文件问题等)和严重性。它实际上是非常可配置的。

See http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/cprbview.htm for details and screenshots.

有关详细信息和屏幕截图,请参阅http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/cprbview.htm。

#3


21  

To view more than 100 warnings, go to the problem view's drop down menu (use the little arrow next to the minimize button on the view), select Preferences, and you will have the option to change this limit from 100 to another number.

要查看超过100个警告,请转到问题视图的下拉菜单(使用视图上最小化按钮旁边的小箭头),选择首选项,您可以选择将此限制从100更改为另一个数字。

This information is for Ganymede; things have changed since Europa and I'm not sure of all the differences.

此信息适用于Ganymede;自欧罗巴以来情况发生了变化,我不确定所有的差异。

#4


5  

An updated link for Ganymede (Eclipse 3.4):

Ganymede的更新链接(Eclipse 3.4):

http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.user/concepts/cprbview.htm

But I agree with the fundamental problem: the Problems view needs filtering by Resource, not just Description.

但我同意基本问题:Problems视图需要按资源过滤,而不仅仅是描述。

In my case, I include generated jsp code in my source path, and there are all kinds of warning that occur in the *_jsp.java files (like unused application, page, out, config, page_context variables). So it would be nice to exclude them by the Resource pattern. (Or for jspc to not write unused code...but that's a different issue altogether).

在我的例子中,我在源路径中包含生成的jsp代码,并且* _jsp.java文件中存在各种警告(例如未使用的应用程序,页面,输出,配置,page_context变量)。所以用Resource模式排除它们会很好。 (或者jspc不写未使用的代码......但这完全是另一个问题)。

#5


5  

Re: your edit

Re:你的编辑

In the drop down button by the filter button, there is a preferences option. Uncheck "Use Marker Limits" and you will be shown all errors + warnings.

在过滤器按钮的下拉按钮中,有一个首选项选项。取消选中“使用标记限制”,您将看到所有错误+警告。

#6


2  

In order to view more than 100 warnings, go to the problem view's drop down menu (use the little arrow next to the minimize button on the view), select Configure Contents. Uncheck the Use item limitsat the bottom left of the Configure Contents window or set a limit in the Number of items visible per group:.

要查看100多个警告,请转到问题视图的下拉菜单(使用视图上最小化按钮旁边的小箭头),选择配置内容。取消选中“配置内容”窗口左下角的“使用项目限制”,或在“每组可见的项目数”中设置限制:。

#7


1  

Open problems view. Click corner triangle. Select preferences

打开问题视图。单击角三角形。选择首选项

Uncross: [ ] Use marker limits

Uncross:[]使用标记限制