Minor fixes: can be constructor property
(cherry picked from commit 4d44e15)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
8d2389d15c
commit
4145e3438f
@@ -1,5 +1,5 @@
|
|||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
This inspection reports properties which are explicitly assigned by constructor arguments and can be declared directly in constructor instead.
|
This inspection reports properties which are explicitly assigned to constructor parameters and can be declared directly in constructor instead.
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
+1
-1
@@ -58,7 +58,7 @@ class CanBePrimaryConstructorPropertyInspection : AbstractKotlinInspection() {
|
|||||||
holder.registerProblem(holder.manager.createProblemDescriptor(
|
holder.registerProblem(holder.manager.createProblemDescriptor(
|
||||||
nameIdentifier,
|
nameIdentifier,
|
||||||
nameIdentifier,
|
nameIdentifier,
|
||||||
"Property is explicitly assigned by parameter ${assignedDescriptor.name}, can be declared directly in constructor",
|
"Property is explicitly assigned to parameter ${assignedDescriptor.name}, can be declared directly in constructor",
|
||||||
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
ProblemHighlightType.GENERIC_ERROR_OR_WARNING,
|
||||||
isOnTheFly,
|
isOnTheFly,
|
||||||
MakeConstructorPropertyFix(property, assignedParameter)
|
MakeConstructorPropertyFix(property, assignedParameter)
|
||||||
|
|||||||
+2
-2
@@ -5,7 +5,7 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="temp:///src/properties.kt" />
|
<entry_point TYPE="file" FQNAME="temp:///src/properties.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Property is explicitly assigned to constructor parameter</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Property is explicitly assigned to constructor parameter</problem_class>
|
||||||
<description>Property is explicitly assigned by parameter simple, can be declared directly in constructor</description>
|
<description>Property is explicitly assigned to parameter simple, can be declared directly in constructor</description>
|
||||||
</problem>
|
</problem>
|
||||||
<problem>
|
<problem>
|
||||||
<file>properties.kt</file>
|
<file>properties.kt</file>
|
||||||
@@ -13,6 +13,6 @@
|
|||||||
<module>light_idea_test_case</module>
|
<module>light_idea_test_case</module>
|
||||||
<entry_point TYPE="file" FQNAME="temp:///src/properties.kt" />
|
<entry_point TYPE="file" FQNAME="temp:///src/properties.kt" />
|
||||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Property is explicitly assigned to constructor parameter</problem_class>
|
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Property is explicitly assigned to constructor parameter</problem_class>
|
||||||
<description>Property is explicitly assigned by parameter withType, can be declared directly in constructor</description>
|
<description>Property is explicitly assigned to parameter withType, can be declared directly in constructor</description>
|
||||||
</problem>
|
</problem>
|
||||||
</problems>
|
</problems>
|
||||||
Reference in New Issue
Block a user