KT-7955 "Add replaceWith to specify replacement pattern" intention/inpesction has too large a range

#KT-7955 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-06-05 21:55:13 +03:00
parent e1efb95259
commit 63b30cf7f6
2 changed files with 3 additions and 3 deletions
@@ -59,7 +59,7 @@ public abstract class IntentionBasedInspection<TElement : JetElement>(
if (ranges.isEmpty()) return
val fixes = intentions.map { IntentionBasedQuickFix(it, targetElement) }.toTypedArray()
val rangeInElement = ranges.fold(TextRange.EMPTY_RANGE) { a, b -> a union b }
val rangeInElement = ranges.fold(ranges.first()) { result, range -> result.union(range) }
holder.registerProblem(targetElement, problemText ?: fixes.first().getName(), problemHighlightType, rangeInElement, *fixes)
}
}
@@ -65,7 +65,7 @@
<problem>
<file>NotAvailableOnDocComment.kt</file>
<line>2</line>
<line>5</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="NotAvailableOnDocComment.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Add 'replaceWith' argument to 'deprecated' annotation</problem_class>
@@ -74,7 +74,7 @@
<problem>
<file>NoDefaultImport.kt</file>
<line>1</line>
<line>2</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="NoDefaultImport.kt" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Add 'replaceWith' argument to 'deprecated' annotation</problem_class>