去掉IntelliJ IDEA生成的mybatis對映檔案中黃色和綠色的背景
阿新 • • 發佈:2019-01-09
IntelliJ IDEA 開啟 mybatis 的 xml 檔案時,對應的 xml 檔案中 sql 語句背景色總是有黃色或綠色的背景色。
提示(紅圈處)上已經說明,需要配置在 IDEA 中配置 data source
(通常我們很少使用 IDE 去檢視資料庫內容,而是使用其他專門的 DB 工具)。
去掉 No data sources configure 警告
當然,如果你選擇配置
data source
也可以,純屬個人習慣)
- Prefernces ⇒ Editor ⇒ Inspections ⇒ SQL ⇒ No data sources configure。
- 取消勾選,去掉這個檢查,然後點選
OK
按鈕即可。
此時仍有警告,不過警告資訊變了,如圖中紅圈所示
去掉 SQL dialect is not configured 警告
- Prefernces ⇒ Editor ⇒ Inspections ⇒ SQL ⇒ SQL dialect detection。
- 取消勾選,去掉這個檢查,然後點選
OK
按鈕即可。
此時仍有綠色的背景色
去掉“注入語言”的背景色
- Prefernces ⇒ Editor ⇒ Colors & Fonts ⇒ General ⇒ Code ⇒ Injected language fragment ⇒ Background。
- 取消勾選,然後點選
OK
按鈕即可。