[Grazie][IDEA-331054] Incorrect missing apostrophe warnings inside markup

GitOrigin-RevId: ef4008f271a9d76030d048e3fd7645176372d7ea
This commit is contained in:
Ekaterina Berezhko
2024-03-21 00:00:00 +00:00
committed by intellij-monorepo-bot
parent 5a47f05dc0
commit 9e2bfb4413
2 changed files with 7 additions and 1 deletions
@@ -119,7 +119,10 @@ open class LanguageToolChecker : TextChecker() {
}
}
private fun possiblyMarkupDependent(match: RuleMatch) = match.message.lowercase().contains("capitalize")
private fun possiblyMarkupDependent(match: RuleMatch): Boolean {
return match.message.lowercase().contains("capitalize") ||
match.rule.id == "POSSESSIVE_APOSTROPHE"
}
private fun runLT(tool: JLanguageTool, str: String): List<RuleMatch> =
tool.check(AnnotatedTextBuilder().addText(str).build(), true, JLanguageTool.ParagraphHandling.NORMAL,
@@ -37,6 +37,9 @@ val b = "It is friend."
It's a <GRAMMAR_ERROR descr="A_GOOGLE">react</GRAMMAR_ERROR> method. (An LT warning here)
It's a *react* method. (Fine, as it's emphasized)
They are stored in the <GRAMMAR_ERROR descr="POSSESSIVE_APOSTROPHE">images</GRAMMAR_ERROR> directory.
They are stored in the **images** directory. (Shouldn't suggest inserting apostrophe inside markup)
Defined field String name = "John<GRAMMAR_ERROR descr="EN_QUOTES">"</GRAMMAR_ERROR>
System.out.println(<GRAMMAR_ERROR descr="EN_QUOTES">"</GRAMMAR_ERROR>Hello <GRAMMAR_ERROR descr="EN_QUOTES">"</GRAMMAR_ERROR> + name)
foo(<GRAMMAR_ERROR descr="THE_PUNCT">a,</GRAMMAR_ERROR> <GRAMMAR_ERROR descr="THE_PUNCT">the,</GRAMMAR_ERROR> an)