[grazie] grow the file range to highlight, not the text range

GitOrigin-RevId: 03a7d2a382cb88574f97c4521531f88c41177c5b
This commit is contained in:
Peter Gromov
2022-02-18 09:30:40 +00:00
committed by intellij-monorepo-bot
parent fcca78bb1e
commit 79596e659d
@@ -104,7 +104,7 @@ object GrazieReplaceTypoQuickFix {
val spm = SmartPointerManager.getInstance(file.project)
@Suppress("HardCodedStringLiteral") val familyName: @IntentionFamilyName String = familyName(problem)
val result = arrayListOf<LocalQuickFix>(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))