1. 程式人生 > 其它 >淨化IntelliJ IDEA 中mapper xml 檔案噁心人警告提示,還世界一片清淨

淨化IntelliJ IDEA 中mapper xml 檔案噁心人警告提示,還世界一片清淨

IntelliJ IDEA 開啟 mybatis 的 xml 檔案時,對應的 xml 檔案中 sql 語句背景色總是有黃色或綠色的背景色,然後發現mapper.xml檔案那讓人崩潰的介面,於是就想看看能不能找個解決辦法,讓它看起來沒那麼噁心,還code世界一片清淨,如圖:

直接上解決辦法把:

去掉 No data sources configure 警告

  • 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 Scheme ⇒ General ⇒ Code ⇒ Injected language fragment ⇒ Background。
  • 取消勾選,然後點選OK按鈕即可。
    • ‘世界清淨了!!! 終於可以愉快的coding了!!!