java Eclipse IDE 范围突出显示?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11820952/
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
Eclipse IDE Scope Highlighting?
提问by David Meyer
When I first learned Java, I was using an IDE called "BlueJ." It had this feature called "Scope Highlighting" which made it very easy to read blocks of code. Now I've moved on from BlueJ and began using Eclipse. I'm currently in the process of customizing Eclipse to my liking and would like this Scope Highlighting feature inside Eclipse.
当我第一次学习 Java 时,我使用的是一个名为“BlueJ”的 IDE。它具有称为“范围突出显示”的功能,可以非常轻松地阅读代码块。现在我已经从 BlueJ 开始使用 Eclipse。我目前正在根据自己的喜好自定义 Eclipse,并希望在 Eclipse 中使用此范围突出显示功能。
I've searched everywhere for an answer on how to do it but I cannot find any information pointing to a solution for doing it in Eclipse.
我到处搜索有关如何执行此操作的答案,但找不到任何指向在 Eclipse 中执行此操作的解决方案的信息。
Here's a picture to demonstrate what Scope Highlighting looks like:
这是一张图片来演示范围突出显示的样子:
采纳答案by dantuch
I'm afriad that closest you can get is Shift + Alt + arrow_up
我很担心你能得到的最接近的是Shift + Alt + arrow_up
It is selecting wider block of code. pressing this few times will give you very similar result to what you are searching for. I use it often.. it is useful, also for refactoring.
EDIT: As @j2emanue said: you can just double click the delimiter (like a bracket) and it will highlight the entire scope.
它正在选择更宽的代码块。按此几次将为您提供与您正在搜索的内容非常相似的结果。我经常使用它......它很有用,也用于重构。
编辑:正如@j2emanue 所说:您只需双击分隔符(如括号),它就会突出显示整个范围。
回答by Utku ?zdemir
I think the best option for you is EditBox, a scope highlighting plugin for Eclipse: http://editbox.sourceforge.net/
我认为对你来说最好的选择是 EditBox,一个用于 Eclipse 的范围突出显示插件:http: //editbox.sourceforge.net/
回答by j2emanue
you can use Shift + Alt + arrow_up but many people dont realize you can just double click the delimiter (like a bracket) and it will highlight the entire scope. Try double clicking your if statements bracket for example and watch eclipse highlight the entire scope. It works with any delimiter. so you can use parenthesis as well.
您可以使用 Shift + Alt + arrow_up 但很多人没有意识到您只需双击分隔符(如括号),它就会突出显示整个范围。例如,尝试双击 if 语句括号并观看 eclipse 突出显示整个范围。它适用于任何分隔符。所以你也可以使用括号。
as a side note: if your using intelliji checkout this plugin works great: https://github.com/izhangzhihao/intellij-rainbow-brackets#screenshots
作为旁注:如果您使用 intelliji checkout 这个插件效果很好:https: //github.com/izhangzhihao/intellij-rainbow-brackets#screenshots
回答by Tod
This isn't exactly what you're after but you can put your cursor in a method and then click the Show Source Of Selected Element only button on the toolbar. Your editor gets reduced to just that method. Click again and your back to your entire file.
这不是您真正想要的,但您可以将光标放在方法中,然后单击工具栏上的仅显示所选元素的源按钮。你的编辑器被简化为那种方法。再次单击并返回到整个文件。
回答by j2emanue
can Bracketeer do this ? its an eclipse plug in ..
Bracketeer 能做到吗?它是一个eclipse插件..
http://marketplace.eclipse.org/content/bracketeer-java-jdt#.UK6sY4fAdLc
http://marketplace.eclipse.org/content/bracketeer-java-jdt#.UK6sY4fAdLc
回答by Lawryenzo
I doubt eclipse does have the same function as blue j.The best advise I can give you, is to change your theme to your liking which would enable you to easily select and highlight the block of code...and to customise your theme , go to http://eclipsecolorthemes.org/. ....
我怀疑 eclipse 确实具有与 blue j 相同的功能。我可以给您的最佳建议是根据自己的喜好更改主题,这将使您能够轻松选择和突出显示代码块……并自定义您的主题,转到http://eclipsecolorthemes.org/。....
If you still have a problem, go to http://codejava.co.uk/contact.htmland send your email.you can create a dummy one if want, then I will send you XML files I use for my eclipse themes.
如果您仍然有问题,请访问http://codejava.co.uk/contact.html并发送您的电子邮件。如果需要,您可以创建一个虚拟电子邮件,然后我将向您发送用于我的 Eclipse 主题的 XML 文件。