Eclipse <ctrl>-单击超链接不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19840701/
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 <ctrl>-click Hyperlink Not Working
提问by BlairHippo
I'm running Eclipse Kepler, and for some reason, the ctrl-click hyperlink feature isn't working in one particular workspace.
我正在运行 Eclipse Kepler,由于某种原因,ctrl-click 超链接功能在一个特定的工作区中不起作用。
I've looked at this question, and the correct box is checked. The code is compiling cleanly. What else could be causing this behavior? It's a very useful feature, and I'd like it back.
我看过这个问题,并选中了正确的框。代码编译得很干净。还有什么可能导致这种行为?这是一个非常有用的功能,我希望它回来。
(And this may well be related -- "Mark Occurrences" isn't working in that workspace either, even thought the "Toggle Mark Occurrences" button is pressed.)
(这很可能是相关的——“标记发生”在该工作区中也不起作用,即使按下了“切换标记发生”按钮。)
F3gives me a pop-up error: "Problems opening an editor. Reason: [parent-project-of-the-one-that-I'm-in-right-now] does not exist."
F3给我一个弹出错误:“打开编辑器时出现问题。原因:[parent-project-of-the-one-that-Im-in-right-now] 不存在。”
回答by Jasraj Suthar
- Close the class you are working on.
- Press "Control+Shift+T"
- Search with class name
- Open the class Now "Ctrl+Click" should work
- 关闭您正在处理的课程。
- 按“Control+Shift+T”
- 用类名搜索
- 打开类现在“Ctrl+单击”应该可以工作了
回答by Mikaelblomkvistsson
For further info, click Window > Show View > Error Log. Then see the messages apearing each time you want to do Ctrl+click. Then double-click to open one of the entries and you will get detailed info.
有关更多信息,请单击窗口 > 显示视图 > 错误日志。然后在每次您想要按 Ctrl+单击时看到消息出现。然后双击打开其中一个条目,您将获得详细信息。
You can cut out come code snippets (for a while), save it and see if the hyperlink functionality restores, then go to another piece of code until you find it.
您可以剪下代码片段(暂时),保存并查看超链接功能是否恢复,然后转到另一段代码直到找到它。
In my case it occured only in one file and its currently know bug in Eclipse Oxygen: https://bugs.eclipse.org/bugs/show_bug.cgi?id=517610
在我的情况下,它只发生在一个文件中,并且它目前在 Eclipse Oxygen 中存在已知错误:https: //bugs.eclipse.org/bugs/show_bug.cgi?id =517610
It occured in PyDdev
Just one line of code confused it terribly:
Unhandled event loop exception
它发生在 PyDdev 中,仅一行代码就将它搞糊涂了:
Unhandled event loop exception
print '*' * 100, '\n' # reproduces the bug
print '*' * 100, 'anythin' # also buggy
but
但
print ('*' * 100), '\n' # works fine
print '*' * 100 # works fine
回答by Nirmalkumar
This is due to unrechable class folder reference for the source folder. It would be fixed by typing
这是由于源文件夹的类文件夹引用不可访问。它将通过键入来修复
mvn eclipse:eclipse
mvn 日食:日食
Allow maven to complete the build and then refresh eclipse.
让maven完成构建,然后刷新eclipse。
回答by user3329440
Only solution that I have found was to go into each project and delete the .settings and .project files. Then delete the workspace settings and create all new projects. Had issues with pulling in existing directories when the old project settings still existed.
我发现的唯一解决方案是进入每个项目并删除 .settings 和 .project 文件。然后删除工作区设置并创建所有新项目。当旧项目设置仍然存在时,在拉入现有目录时出现问题。
Seems like a bug in Kepler that a lot of people are running into during the upgrade.
似乎很多人在升级过程中遇到了 Kepler 中的一个错误。
回答by Balagopalan Thampi
I had the same issue, and solved it the following way. My issue came because I imported a project from Git, which wasn't having the project file. So Eclipse was not recognizing the project as a java one. Ctrl+click was not working and so there was the "F3" issue.
我遇到了同样的问题,并通过以下方式解决了它。我的问题是因为我从 Git 导入了一个没有项目文件的项目。所以 Eclipse 没有将该项目识别为 Java 项目。Ctrl+单击不起作用,因此出现了“F3”问题。
Solution:(not a direct one. but solved my issue)
解决方案:(不是直接的。但解决了我的问题)
- import -> projects from git -> from URI -> select the new project wizard
- so an empty project with src folder will be created.
- then copy all the src files in to the folder manually.
- import -> projects from git -> from URI -> 选择新建项目向导
- 因此将创建一个带有 src 文件夹的空项目。
- 然后手动将所有 src 文件复制到文件夹中。
回答by Romwell
Here's what worked for me (as of Eclipse CDT Kepler):
这是对我有用的(从 Eclipse CDT Kepler 开始):
In Project Explorer, right-click the file in which Ctrl+Click was not working in Eclipse, and select Index -> Freshen All Files.
在 Project Explorer 中,右键单击 Ctrl+Click 在 Eclipse 中不起作用的文件,然后选择 Index -> Freshen All Files。
That solved the problem of Eclipse not going to / not finding function declaration (via Ctrl+Click or F3).
这解决了 Eclipse 不去/找不到函数声明的问题(通过 Ctrl+Click 或 F3)。
回答by Oguz
I just changed the key command to option(alt). Now it works perfectly. Preferences -> General -> Editors -> Text Editors -> Hyperlinking
我只是将键盘命令更改为 option(alt)。现在它完美地工作。首选项 -> 常规 -> 编辑器 -> 文本编辑器 -> 超链接
回答by veenit sahay
Try deleting .metadata folder from your source and re-import all maven project in your eclipse.
尝试从源中删除 .metadata 文件夹,然后在 Eclipse 中重新导入所有 Maven 项目。
回答by B Shelton
If it's a maven project, refresh maven.
如果是maven项目,刷新maven。
- Select a project > Maven > Refresh Maven
- Select all projects
- OK
- 选择一个项目 > Maven > 刷新 Maven
- 选择所有项目
- 好的
回答by Vardesh k
Delete project from eclipse and import again, it resolved for me.
从 eclipse 中删除项目并再次导入,它为我解决了。