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

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

问题描述

Android Studio lint 拼写检查器会标记十六进制代码,这些代码看起来像某些文件中的单词,如果不进行检查会更好,例如 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.

如何告诉 lint 不对某些文件夹或文件进行拼写检查?

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 & 中添加新范围行为/范围 包含您要从拼写检查中排除的所有文件.例如,此模式涵盖所有 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 lint 拼写检查器中排除文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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