ReSharper 2026.3 Help

Razor 中的代码检查

在 Razor 中,ReSharper 2026.3 提供两种代码检查:4 项 错误检测检查 ,如语法错误、未解析的符号、编译器错误等(这些检查无法配置或禁用),以及 14 项 专有代码检查 ,其中任一项均可 禁用或更改其 严重性级别。
These code inspections help you detect code issues at design time in all open files, and additionally they allow you to find code issues in specific scope.

可配置的 Razor 检查列在下方,并按其 类别分组。

语法问题(4 项检查)

此类别中的检查报告字符串字面量和文档注释中的 语法问题。

检查
ID
EditorConfig 属性

默认严重性

注释中的语法错误
GrammarMistakeInComment
resharper_grammar_mistake_in_comment_highlighting

建议

标记属性值中的语法错误
GrammarMistakeInMarkupAttribute
resharper_grammar_mistake_in_markup_attribute_highlighting

建议

标记文本中的语法错误
GrammarMistakeInMarkupText
resharper_grammar_mistake_in_markup_text_highlighting

建议

字符串字面量中的语法错误
GrammarMistakeInStringLiteral
resharper_grammar_mistake_in_string_literal_highlighting

已禁用

潜在的代码质量问题(5 项检查)

此类别包括检测关键问题(代码异味)的检查,主要具有 错误 或 警告 级别。 此类别还包括 确保本地化支持的检查。

检查
ID
EditorConfig 属性

默认严重性

此版本的 Razor 不支持 Null-Conditional 运算符
RazorNullConditionalOperatorHighlighting
resharper_razor_null_conditional_operator_highlighting_highlighting

警告

未知的 HTML 标签,可能是组件
Razor.UnresolvedComponent
resharper_razor_unresolved_component_highlighting

警告

未知的 Razor 程序集
Razor.AssemblyNotResolved
resharper_razor_assembly_not_resolved_highlighting

错误

未知的 Razor 布局
Razor.LayoutNotResolved
resharper_razor_layout_not_resolved_highlighting

错误

未知的 Razor 区段
Razor.SectionNotResolved
resharper_razor_section_not_resolved_highlighting

错误

拼写问题(5 项检查)

这些检查 检测各种上下文中的拼写错误。

检查
ID
EditorConfig 属性

默认严重性

注释中的拼写错误
CommentTypo
resharper_comment_typo_highlighting

建议

标识符中的拼写错误
IdentifierTypo
resharper_identifier_typo_highlighting

建议

标记属性值中的拼写错误
MarkupAttributeTypo
resharper_markup_attribute_typo_highlighting

建议

标记文本中的拼写错误
MarkupTextTypo
resharper_markup_text_typo_highlighting

建议

字符串字面量中的拼写错误
StringLiteralTypo
resharper_string_literal_typo_highlighting

建议

2026年 11月 6日