[英]How can I disable showing the value of a Spring @Value annotation in IntelliJ IDEA?
我正在運行IntelliJ IDEA 2017.3.4(終極版)。 我有一個Spring Boot項目,定義了Spring屬性,它將被自動連接到@Component
類中的@Value
-annotated字段。 屬性在application.properties中定義。
默認情況下,IntelliJ顯示變量的值而不是實際的變量表達式(使用顏色方案可以明顯表明這不是實際的值)。 單擊該值將顯示實際的變量表達式。
例如:
@Value("${my.property.value}")
private String myProperty;
如果“my.property.value”解析為“theValue”,則顯示如下:
@Value("theValue")
private String myProperty;
我寧願不這樣做。 是否優先禁用此功能? 我沒有幸運找到一個搜索IDEA偏好或在線的答案。
在設置(Mac上的首選項)| 編輯| 一般| 代碼折疊禁用選項I18字符串 。
此折疊功能與Spring無關。
建議的答案對我沒有幫助。 但是,您可以通過轉到IDE的右上角(在默認模式下)專門停用Spring Boot .properties或.yaml文件的驗證,然后單擊:
Inspector | Configure inspections
在彈出搜索中
Spring | Spring Boot | Spring Boot application.yml
Spring | Spring Boot | Spring Boot application.properties
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.