Eclipse内容助手从结束大括号查看块声明? [英] Eclipse Content Assist for viewing block declarations from the closing brace?

查看:211
本文介绍了Eclipse内容助手从结束大括号查看块声明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人知道Eclipse的内容辅助是否可以配置为通过将鼠标悬停在块的关闭括号(或类似的内容)上来显示代码块的声明,我真的很好奇。



而不必用注释标记长代码块,我宁愿将鼠标悬停在关闭括号上,查看它结束的块。



如果我说的话不清楚,想象你有下面的代码块:

  if(obj instanceof Double)
{
//...PROGRAM LOGIC ...
}

在这个例子中,如果我要将插入符号移动到结尾大括号,右键单击末端括号,或者将鼠标悬停在其上。一个弹出窗口会显示给我最初的声明:

  if(obj instanceof Double ){// ... 



另外,我有兴趣要知道是否可以在 Visual Studio 中完成;我已经提出了这个问题 ,如果块折叠,并尝试检查是否阻塞内容如上所述。



此外,您可以通过在块启动后保留插入符( {)或阻止)来检查块语句的范围结束(} )花括号并双击它。



见下文





你可以按 Alt + Shift + 向上箭头 Alt + Shift + 向下箭头,并跳转到匹配的括号(像(或) {或}

I'm really curious if anyone knows if Eclipse's Content Assist can be configured to display a code block's declaration by hovering over the block's closing brace (or something similar).

Rather than having to mark long code blocks with a comment, I would much rather hover over the closing brace to view which block it ends.

If what I'm saying isn't clear, imagine you had the code block below:

if (obj instanceof Double)
{
    //...PROGRAM LOGIC...
}

In this example, if I were to move the caret to the end brace, right-click the end brace, or simply hover over it. A popup window would show giving me the original declaration at the top:

if (obj instanceof Double) { //...


Also, I'm interested to know if this can be done in Visual Studio; I've asked that question here.

解决方案

This is nothing to do with content assist.

You can see the block of code as explained below.

Collapse all methods(By pressing Ctrl+Shift+NUM_KEYPAD_DIVIDE. Note you can expand all methods by pressing Ctrl+Shift+NUM_KEYPAD_MULTIPLY)

Hover the mouse cursor towards method collapse icon "+" as shown below.

You will see the content of the method in a popup window. Now press F2 to freez this popup and press ESC to close the popup. Scroll back and forth to see the content. Note that this works for methods, javadocs and import statements only and not for other block statements inside methods and on CLASS body.

Refer How to use Coffee-Bytes code folding for if block folding and try to check the if block content as said above.

Also you can check the scope of block statements by keeping caret after the block start("{") or block end("}") flower brackets and double clicking on it.

See below

You can expand or reduce the block selection by pressing Alt + Shift + Up Arrow and Alt + Shift + Down Arrow respectively and jump to matching bracket(Like "( or )", "{ or }") by keeping caret after the bracket and pressing Ctrl + Shift + P

这篇关于Eclipse内容助手从结束大括号查看块声明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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