android studio spellchecker,Exclude files from Android Studio lint spell checker

本文解答了如何在Android Studio中配置Lint Spell Checker,使其不在colors.xml和cache.xml等特定文件中进行拼写检查。方法是创建包含排除文件的IDE范围,并针对该范围关闭拼写检查,同时保持其他检查启用。使用正则表达式可以精准设置排除规则。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题

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?

回答1:

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.

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.

回答2:

Had the same problem with colors.xml

I couldn't find a way to disable the check for a certain file, but I could get rid of the spellcheck on the hex codes.

Click Analyze->Inspect Code.

Choose Whole Project and click OK.

The inspection tool window will open with the results.

You should be able to see the problematic hex codes under Spelling->typo.

Right click any one of them and choose Exclude.

Did the trick for me. HTH

来源:https://stackoverflow.com/questions/29321702/exclude-files-from-android-studio-lint-spell-checker

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值