不工作 - 将鼠标悬停在变量上以查看 Eclipse 中调试的值

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5033717/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 15:49:25  来源:igfitidea点击:

Not working - Hover on variable to see value in debug prespective in Eclipse

eclipsedebuggingvariableshover

提问by troy

I am using classic Eclipse 3.6.1. I have a Java project which is throwing an exception because of a stack overflow. Unlike other editors, when I hover my mouse pointer on a variable it does not show me the value of that variable. Here are the settings in

我使用的是经典的 Eclipse 3.6.1。我有一个 Java 项目,由于堆栈溢出而引发异常。与其他编辑器不同,当我将鼠标指针悬停在变量上时,它不会显示该变量的值。这里是设置

Window->Preferences->Java->Editor->Hovers
Combined Hover - Shift
Variable Values - Ctrl
Source - Shift+Ctrl

But this doesn't seem to be working. I have seen threads by others about this same problem but could not find a solution. Is this a bug that hasn't been fixed yet?

但这似乎不起作用。我看过其他人关于同一问题的帖子,但找不到解决方案。这是一个尚未修复的错误吗?

Thanks!

谢谢!

回答by Swatantra Kumar

Go to Window - Preferences - Java - Editor - Hovers.

转到窗口 - 首选项 - Java - 编辑器 - 悬停。

Is "Combined Hover" selected? Uncheck it; apply; close the window; restart debugging session; go back; check it again; apply.
If the above doesn't help, you can check "Variable Values" option and specify a modifier key for it. Not as convenient as "combined", but should work.

The problem gets "fixed" by renaming the package.

通过重命名包,问题得到“修复”。

For whatever reason, this refactoring triggers something in Eclipse, and immediately I was able to view variable values during debugging. Also, when I go back into Preferences under Hovers, I can now see the "Variable Values" option.

无论出于何种原因,这种重构都会触发 Eclipse 中的某些内容,并且我立即能够在调试期间查看变量值。此外,当我回到悬停下的首选项时,我现在可以看到“变量值”选项。

回答by Nitin

In my case Preferences under Hovers were checked and enabled. Even after that it was not showing values when I move the mouse on the variable. Problem has been fixed by simply closing and reopening the Eclipse (I was using Eclipse with Python).

在我的情况下,选中并启用了悬停下的首选项。即使在那之后,当我在变量上移动鼠标时它也没有显示值。问题已通过简单地关闭并重新打开 Eclipse(我使用 Eclipse 和 Python)来解决。