Highlighting of redundant semicolons

#KT-5010 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-04-25 20:14:10 +03:00
parent 77033f52ee
commit 306edef23c
13 changed files with 233 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package p; // redundant
import java.util.ArrayList; // redundant
class A {
fun foo() {
print(1); print(2); // redundant
}; // redundant
fun bar() {}
}; // redundant
enum class E {
A, B; // let's not consider it to be redundant
}
fun foo(p: Int) {
if (p > 0) foo(); // not redundant!
{ p: Int ->
print(p)
}.doIt()
}
fun ((Int) -> Unit).doIt() {
this.invoke(1); // redundant
}
fun bar() {
a(); // redundant
b()
}
@@ -0,0 +1,64 @@
<problems>
<problem>
<file>Test.kt</file>
<line>1</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="Test.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant semicolon</problem_class>
<description>Redundant semicolon</description>
</problem>
<problem>
<file>Test.kt</file>
<line>3</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="Test.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant semicolon</problem_class>
<description>Redundant semicolon</description>
</problem>
<problem>
<file>Test.kt</file>
<line>7</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="Test.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant semicolon</problem_class>
<description>Redundant semicolon</description>
</problem>
<problem>
<file>Test.kt</file>
<line>8</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="Test.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant semicolon</problem_class>
<description>Redundant semicolon</description>
</problem>
<problem>
<file>Test.kt</file>
<line>11</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="Test.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant semicolon</problem_class>
<description>Redundant semicolon</description>
</problem>
<problem>
<file>Test.kt</file>
<line>26</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="Test.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant semicolon</problem_class>
<description>Redundant semicolon</description>
</problem>
<problem>
<file>Test.kt</file>
<line>30</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="Test.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant semicolon</problem_class>
<description>Redundant semicolon</description>
</problem>
</problems>
@@ -0,0 +1 @@
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.RedundantSemicolonInspection