Eclipse中Debug時鼠標懸停不能查看變量值解決辦法


問題描述:Eclipse在Debug模式下,當鼠標移動到某個變量上面時不自動顯示該變量對應的值。

解決方法:在Eclipse中點擊 Window->Preferences->Java->Editor->Hovers, 勾選Variable Values,(如果Combined Hover已經選擇了,就取消它), 然后點擊Apply,最后點OK。

有時不需要勾選Variable Values,只勾選Combined Hover也能查看變量值,所以勾不勾選多試幾下,Debug可能就好了。

Hovers主要是來用配置當鼠標移動到工程中的某一項目上時所需要展示的信息。通過Hovers配置實現一些功能的快捷方式。

主要包括以下幾個屬性的配置:

Combined Hover - Tries the hovers in the sequence listed in above table, excluding this hover, and uses the one which fits best for the selected element and the current context.
Combined Hover:根據當前上下文以及選擇的元素 進行自適應匹配展示。

Variable Values - Shows the value of the selected variable when debugging.
Variable Values :Debug模式下展示當前選擇變量的內容

Problem Description - Shows the description of the selected problem.
Problem Description:顯示當前問題(錯誤)的描述信息

Externalized String - Shows the externalized string of the selected key.
Externalized String: 顯示所選鍵的形象化字符串。

Javadoc - Shows the Javadoc of the selected element..
Javadoc:顯示當前選擇元素的文檔信息

Annotation Description - Shows the description of the selected annotation.
Annotation Description :顯示當前選擇聲明的描述信息。

Source - Shows the source of the selected element.
Source:顯示當前選擇元素的源碼。

下面再介紹一招可以讓自動補全用起來更“自動”。好不好用取決於自己的習慣。

在主菜單的:

Window -> Preferences -> Java/Editor/Content Assist

把"Autocomplete Trigger for Java"配置為:.(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
(默認值是一個“.”)並且把Auto activation delay降低(例如說降低到0或者100ms)。具體配置哪些字母作為trigger看自己需求怎樣。例如下面評論里有提到可以添加“@”來給annotation也提供自動補全。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM