KT-7955 "Add replaceWith to specify replacement pattern" intention/inpesction has too large a range
#KT-7955 Fixed
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ public abstract class IntentionBasedInspection<TElement : JetElement>(
|
|||||||
if (ranges.isEmpty()) return
|
if (ranges.isEmpty()) return
|
||||||
|
|
||||||
val fixes = intentions.map { IntentionBasedQuickFix(it, targetElement) }.toTypedArray()
|
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)
|
holder.registerProblem(targetElement, problemText ?: fixes.first().getName(), problemHighlightType, rangeInElement, *fixes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
<file>NotAvailableOnDocComment.kt</file>
|
<file>NotAvailableOnDocComment.kt</file>
|
||||||
<line>2</line>
|
<line>5</line>
|
||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="NotAvailableOnDocComment.kt" />
|
<entry_point TYPE="file" FQNAME="NotAvailableOnDocComment.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Add 'replaceWith' argument to 'deprecated' annotation</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Add 'replaceWith' argument to 'deprecated' annotation</problem_class>
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
<problem>
|
<problem>
|
||||||
<file>NoDefaultImport.kt</file>
|
<file>NoDefaultImport.kt</file>
|
||||||
<line>1</line>
|
<line>2</line>
|
||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="NoDefaultImport.kt" />
|
<entry_point TYPE="file" FQNAME="NoDefaultImport.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Add 'replaceWith' argument to 'deprecated' annotation</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Add 'replaceWith' argument to 'deprecated' annotation</problem_class>
|
||||||
|
|||||||
Reference in New Issue
Block a user