mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[grazie] IJPL-89649 Remove [OMIT] from suggestion / description
GitOrigin-RevId: 2c55bfec488f2fef2fd267dd171fd2159bf53365
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ae318d3386
commit
608f8eeca4
@@ -137,13 +137,22 @@ open class LanguageToolChecker : ExternalTextChecker() {
|
||||
override fun getShortMessage(): String =
|
||||
match.shortMessage.trimToNull() ?: match.rule.description.trimToNull() ?: match.rule.category.name
|
||||
|
||||
@Suppress("HardCodedStringLiteral")
|
||||
override fun getDescriptionTemplate(isOnTheFly: Boolean): String =
|
||||
if (testDescription) match.rule.id
|
||||
else match.messageSanitized
|
||||
else {
|
||||
when (match.rule.id) {
|
||||
"EN_PLAIN_ENGLISH_REPLACE" -> "'there are' is a wordy or complex expression. In some cases, it might be preferable to remove it entirely."
|
||||
else -> match.messageSanitized
|
||||
}
|
||||
}
|
||||
|
||||
override fun getTooltipTemplate(): String = toTooltipTemplate(match)
|
||||
override fun getTooltipTemplate(): String = toTooltipTemplate(this)
|
||||
|
||||
override fun getSuggestions(): List<Suggestion> = match.suggestedReplacements.map { Suggestion.replace(highlightRanges[0], it) }
|
||||
override fun getSuggestions(): List<Suggestion> = when (match.rule.id) {
|
||||
"EN_PLAIN_ENGLISH_REPLACE" -> listOf(Suggestion.replace(highlightRanges[0], ""))
|
||||
else -> match.suggestedReplacements.map { Suggestion.replace(highlightRanges[0], it) }
|
||||
}
|
||||
|
||||
override fun getPatternRange() = TextRange(match.patternFromPos, match.patternToPos)
|
||||
|
||||
@@ -277,10 +286,10 @@ private fun isPathPart(startOffset: Int, endOffset: Int, text: TextContent): Boo
|
||||
}
|
||||
|
||||
@NlsSafe
|
||||
private fun toTooltipTemplate(match: RuleMatch): String {
|
||||
private fun toTooltipTemplate(problem: TextProblem): String {
|
||||
val html = html {
|
||||
p {
|
||||
+match.messageSanitized
|
||||
+problem.getDescriptionTemplate(true)
|
||||
}
|
||||
|
||||
p {
|
||||
|
||||
Reference in New Issue
Block a user