简体   繁体   English

Eclipse Ctrl +单击指向错误的行

[英]Eclipse ctrl+click refers to wrong line

I have been facing this problem that when I ctrl+click on a method name to go inside that method, it points me somewhere else. 我一直在面对这个问题,当我按住Ctrl键并单击某个方法名称以进入该方法时,它将指向其他地方。 Closing the editor and reopening doesn't fix the issue, I have to restart the eclipse which is so frustrating. 关闭编辑器并重新打开并不能解决问题,我不得不重启令人沮丧的eclipse。 Does anyone know why it's happening so and the fix to it? 有谁知道为什么会这样以及如何解决?

eclipse version: 4.5.0 eclipse版本:4.5.0

os: ubuntun 14.04 操作系统:ubuntun 14.04

Using eclipse Hyperlinking you can open following: 使用eclipse超链接,您可以打开以下内容:

在此处输入图片说明

So if it is opening declaration Ex: interface declaration, then try implementation option. 因此,如果要打开声明Ex:接口声明,请尝试执行选项。

See following for more details: 请参阅以下详细信息:

Sometimes I face this issue but will get fixed if eclipse is relaunched. 有时我会遇到这个问题,但是如果重新启动Eclipse,它将得到解决。 Anyway, try this. 无论如何,尝试一下。

Clean-build the workspace: 清理构建工作空间:

  1. Save all your files in the workspace. 将所有文件保存在工作区中。
  2. Project -> clean -> 'Clean selected projects below' 项目->清理->'清理下面的选定项目'
  3. Check your workspace if unchecked 如果未选中,请检查您的工作区
  4. Check 'Start a build immediately' if unchecked and click 'ok' 如果未选中,请选中“立即开始构建”,然后单击“确定”。

Now try 'ctrl + click' or F3 in eclipse to goto method definition. 现在,在Eclipse中尝试按“ Ctrl +单击”或F3转到方法定义。 Hope it helps! 希望能帮助到你!

根据您的Eclipse版本:转到Project Explorer>您的源目录>右键单击>索引>重建。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM