Eclipse 问题视图的最佳实践
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/156745/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Best Practices for Eclipse's Problems View
提问by kgiannakakis
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 已经有一段时间了,但我仍然没有找到如何配置问题视图以仅显示感兴趣的错误和警告。是否有一种简单的方法可以过滤掉来自特定资源或特定路径的警告?例如,当我生成 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?
编辑:我发现过滤“关于选定元素及其子元素”的建议是最好的。但是,我还有另一个问题。如果我有“很多”警告或错误,只会出现前 100 个。在极少数情况下我想看到所有这些,我该怎么做?
回答by Valters Vingolds
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.
我觉得过滤“在选定元素及其子元素上”是问题视图过滤器的最佳模式,因为它可以让您非常快速地缩小报告问题的范围:单击工作集(在包资源管理器中),它会显示所有集合中所有项目的问题;单击一个项目 - 只会出现所选项目中的问题。单击单个类(或包) - 仅显示所选类(或包)中的问题。因此,您不会因与手头任务无关的问题而分心。
回答by slashnick
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.htmfor details and screenshots.
有关详细信息和屏幕截图,请参阅http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.user/concepts/cprbview.htm。
回答by skiphoppy
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.
此信息适用于木卫三;自从欧罗巴以来,情况发生了变化,我不确定所有的差异。
回答by Ben
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
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.
但我同意基本问题:问题视图需要按资源过滤,而不仅仅是描述。
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 不编写未使用的代码……但这完全是一个不同的问题)。
回答by ashirley
Re: your edit
回复:你的编辑
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.
在过滤器按钮旁边的下拉按钮中,有一个首选项选项。取消选中“使用标记限制”,您将看到所有错误 + 警告。
回答by Claude COULOMBE
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 limits
at the bottom left of the Configure Contents
window or set a limit in the Number of items visible per group:
.
要查看 100 多个警告,请转到问题视图的下拉菜单(使用视图上最小化按钮旁边的小箭头),选择Configure Contents
。取消选中 窗口Use item limits
左下角的Configure Contents
或在 中设置限制Number of items visible per group:
。
回答by Joonas
Open problems view. Click corner triangle. Select preferences
打开问题视图。单击角三角形。选择首选项
Uncross: [ ] Use marker limits
取消交叉:[] 使用标记限制
回答by Bhuvanesh Mani
Make sure you don't forget to uncheck "Show all items" on top left corner of Filters window. I was applying all these filters such as 'On selected elements and its children' but it doesn't seem to work out. Finally I unchecked the aforementioned checkbox, selected the required 'Configurations' and then it started working.
确保您不要忘记取消选中过滤器窗口左上角的“显示所有项目”。我正在应用所有这些过滤器,例如“在选定的元素及其子元素上”,但似乎不起作用。最后,我取消选中上述复选框,选择所需的“配置”,然后它开始工作。