从Android Studio棉绒拼写检查器中排除文件 [英] Exclude files from Android Studio lint spell checker

查看:109
本文介绍了从Android Studio棉绒拼写检查器中排除文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android Studio棉绒拼写检查器会标记看起来像某些文件中的单词的十六进制代码,最好不加检查,例如values/colors.xmlbuild/intermediates/dex-cache/cache.xml.

The Android Studio lint spell checker flags hex codes that look to it like words in certain files that would be better off unchecked, such as values/colors.xml and build/intermediates/dex-cache/cache.xml.

如何告诉皮棉不要拼写检查某些文件夹或文件?

How do I tell lint to not spell check certain folders or files?

推荐答案

这可以通过使用IDE范围来完成.在Android Studio(至少3.4)中,您可以按作用域配置每个检查.这样的想法是,您创建一个包含所有您不想进行拼写检查的文件的合并范围,然后为该合并范围关闭拼写检查",而对其他所有文件都保持打开状态.

This can be done by using IDE scopes. In Android Studio (at least 3.4) you can configure each inspection per scope. The idea is that you create a scope that contains all files you don't want to be spellchecked, and then switch Spelling inspection off for this scope, but keep it on for everything else.

  1. Settings / Appearance & Behavior / Scopes中添加一个新范围,其中包含要从拼写检查中排除的所有文件.例如,此模式涵盖所有svg文件:file:*.svg.在您的情况下,可能类似于file:*/colors.xml||file:*/cache.xml. IDE将以绿色突出显示所有受影响的文件,因此您可以检查是否输入了正确的模式.

  1. Add a new scope in Settings / Appearance & Behavior / Scopes that contains all files which you want to exclude from spell checking. For example, this pattern covers all svg files: file:*.svg. In your case it could be like file:*/colors.xml||file:*/cache.xml. IDE will highlight all affected files by green, so you can check if you entered correct pattern.

然后设置拼写检查,以使您的新示波器处于关闭状态,而在其他所有位置均处于打开状态.

Then set up Spelling inspection, so that it is OFF for your new scope and ON everywhere else.

这篇关于从Android Studio棉绒拼写检查器中排除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆