去掉IntelliJ IDEA 中 mybatis 对应的 xml 文件警告

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 按钮即可。


文章转载自:https://blog.csdn.net/aubdiy/article/details/68485336

猜你喜欢

转载自blog.csdn.net/qq_27376871/article/details/80229471