JAVA - Intellij IDEA 中去掉mybatis Mapper.xml背景色

时间:2023-03-08 19:55:29
JAVA - Intellij IDEA 中去掉mybatis Mapper.xml背景色

JAVA - Intellij IDEA 中去掉mybatis Mapper.xml背景色

1:现在公司中使用mybatis的频率非常高,一般都会用MBG来生成基础的代码文件。在intellij中查看mapper.xml文件的时候,发现文件会有背景色,极度影响视觉感受,还让不让人写代码了!!!

JAVA - Intellij IDEA 中去掉mybatis Mapper.xml背景色

2:我们把鼠标放上去可以看到出现背景色的原因
第一个是,IDE对data source的检测

第二个是,IDE对SQL Dialect的检测

3:解决方法就是不让IDE检测上述内容,把图片中所选项√去掉

打开setting  文件 - 设置(ctrl + alt + s)

打开setting  file - setting(ctrl + alt + s)

注:如使用了汉化包有可能打不开setting 点击没反应。

解决办法A:在IDEA安装目录lib下的resources_cn.jar,把它删除,用回英文resources_en.jar的就可以了。

解决办法B:在IDEA安装目录lib下的resources_cn.jar,压缩软件打开(不用解压缩)

将其messages文件夹内的

①IdeBundle.properties(系统设置(setting)外观选项加载不出来)

②VcsBundle.properties(系统设置(setting)打不开)

③UIBundle.properties(定位按钮找不到)

三个配置文件删除就可以解决对应问题

打开设置,查询 inspections 选择 SQL ,勾选掉 no data source configured , sql dialect detection 两项

JAVA - Intellij IDEA 中去掉mybatis Mapper.xml背景色

JAVA - Intellij IDEA 中去掉mybatis Mapper.xml背景色

查询 color scheme ,找到 general 的设置,code 中的 Injected lanaguage fragment  的Background 去掉。

JAVA - Intellij IDEA 中去掉mybatis Mapper.xml背景色

mapper.xml 界面 效果

JAVA - Intellij IDEA 中去掉mybatis Mapper.xml背景色

完成。

引用:https://blog.csdn.net/weixin_42831477/article/details/84580113