我正在使用Android Studio(AS)3.3.2尝试恢复旧项目。运行Analyze > Inspect code...意外返回几乎所有内容的大量拼写错误(〜8000),而没有区别什么是代码,注释或XML属性等。
在以前的项目中,我从未遇到过这个问题,而且看起来AS很聪明,可以在进行拼写检查时分离代码,变量等。现在看起来像这样:
如您所见,还有其他问题。例如,在Gradle缓存和看似来自构建中间件的属性文件中:
..\\app\\build\\intermediates\\res\\merged\\debug\\drawable-ldrtl-xxhdpi-v17_abc_ic_menu_copy_mtrl_am_alpha.png.flat
Run Code Online (Sandbox Code Playgroud)
我也试图disable 'Typos'在app/build.gradle下面lintOptions{}没有任何效果。(似乎这被忽略了。)
我如何调整它的行为以理智的方式?
(我不想关闭拼写检查。)
"URI is not registered" could be for a few reasons such as:
activity_emergency_number.xml while being in a specific build variant and it could have been missing some linking configurations for other build variants. A solution here is to try to switch build variants to make Android Studio reload configuration linking.Invalidate and Restart Cache.folder structure of where activity_emergency_number.xml is locatedPreferences > Languages & Frameworks > Schemas and DTDs > Add(+) > Apply > Ok<?xml version="1.0" encoding="utf-8"?>multiple flavors, make sure that your current selected build variant matches the flavor for the layout activity_emergency_number.xmlattributes in activity_emergency_number.xml views are missing some prefix like android: or have some prefix that aren't needed fr those attributesAbout ignoring some spelling typo in situations such as code variables and not ignoring them in other situations such as comments, you have those options available to tune together as well with the Scope you are interested (Production, Test, Project Source Files, Project Files..) in:
Android Studio > Preferences > Editor > Inspections > Spelling > Typo
Here you have two things:
Severity (where you define also the Scope)Options
Process Code (unselect this to not check typos in code variables)Process Literal (this one you have to try if you will need it)Process Comments (keep this selected to check typos in comment)| 归档时间: |
|
| 查看次数: |
259 次 |
| 最近记录: |