Eclipse使用Tab按钮浏览/在方法参数之间导航 [英] Eclipse browsing/navigating between method arguments with Tab button

查看:51
本文介绍了Eclipse使用Tab按钮浏览/在方法参数之间导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse文档中

但是,如果您更改光标的位置或按两次 Escape (两次),则自变量的这些边框将消失(如应有的那样),并且无法通过 Tab 在它们之间移动

反正它消失后是否有通过参数恢复浏览"的功能?我猜想类似在光标放在参数内时同时按下键盘键的组合吗?

P.S:这是我能找到的最好的标题(如果您认为有更好的东西,请随时进行编辑).另外,我找不到与此在线相关的任何问题(如果在SO中则标记为重复),但这可能是因为我不知道如何正确搜索它.

解决方案

不幸的是,当您离开模板导航模式时,这在eclipse中开箱即用"不起作用

假设您在示例中按了 ESC -我将执行以下解决方法:

  String.format(format,args) 

将括号中的部分标记为文本选择,按 DEL ,以便您关注

  String.format 

然后再次按 CTRL + SPACE ,您将得到

  String.format(format,args) 

再次,您又回到了模板导航模式.

我知道这只是一种解决方法-如果这对您来说很烦人,请随时在Tips and Tricks (JDT) page, specifically in Content assist can insert argument names automatically section says:

You can then use the Tab key to navigate between the inserted names.

which is true (and cool):

But if you change cursor's position or press Escape (twice), these borders from arguments will disappear (as they should) and moving through them with Tab will be impossible.

Is there anyway to restore this "browsing" through arguments after its gone? I guess something like pressing a combination of keyboard keys while having cursor inside an argument?

P.S: This is the best title I could find (feel free to edit if you think there is something better). Also, I could not find any question related to this online (mark as duplicate if in SO), but it is probably because I don't know how to search it right.

解决方案

Unfortunately this does not work "out-of-the-box" within eclipse when you have left the template navigation mode

Assume you have pressed ESC in your example - I would do following workaround:

String.format(format, args)

mark the bracket parts as text selection, press DEL so you got following

String.format

Then press CTRL+SPACE again and you will get

String.format(format, args)

again and you are back in template navigation mode.

I know this is only a workaround - if this very annoying for you please don't hesitate to add an issue at https://bugs.eclipse.org/bugs/ . If you do so, please add the link to your question.

这篇关于Eclipse使用Tab按钮浏览/在方法参数之间导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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