From 79596e659dae63869126d1b07cf554b50c1e8a8d Mon Sep 17 00:00:00 2001 From: Peter Gromov Date: Fri, 18 Feb 2022 10:08:36 +0100 Subject: [PATCH] [grazie] grow the file range to highlight, not the text range GitOrigin-RevId: 03a7d2a382cb88574f97c4521531f88c41177c5b --- .../inspection/grammar/quickfix/GrazieReplaceTypoQuickFix.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/grazie/src/main/kotlin/com/intellij/grazie/ide/inspection/grammar/quickfix/GrazieReplaceTypoQuickFix.kt b/plugins/grazie/src/main/kotlin/com/intellij/grazie/ide/inspection/grammar/quickfix/GrazieReplaceTypoQuickFix.kt index e3040c688eb5..1d0ee97aad98 100644 --- a/plugins/grazie/src/main/kotlin/com/intellij/grazie/ide/inspection/grammar/quickfix/GrazieReplaceTypoQuickFix.kt +++ b/plugins/grazie/src/main/kotlin/com/intellij/grazie/ide/inspection/grammar/quickfix/GrazieReplaceTypoQuickFix.kt @@ -104,7 +104,7 @@ object GrazieReplaceTypoQuickFix { val spm = SmartPointerManager.getInstance(file.project) @Suppress("HardCodedStringLiteral") val familyName: @IntentionFamilyName String = familyName(problem) val result = arrayListOf(ReplaceTypoTitleAction(familyName, problem.shortMessage)) - val toHighlight = spm.createSmartPsiFileRangePointer(file, problem.text.textRangeToFile(makeNonEmpty(problem.replacementRange, file))) + val toHighlight = spm.createSmartPsiFileRangePointer(file, makeNonEmpty(problem.text.textRangeToFile(problem.replacementRange), file)) problem.corrections.forEachIndexed { index, suggestion -> val replacements = toFileReplacements(problem.replacementRange, suggestion, problem.text) result.add(ChangeToVariantAction(problem.rule, index, familyName, suggestion, replacements, underlineRanges, toHighlight))