PackageDirectoryMismatchInspection should report when a package statement is missing
#KT-13549 Fixed
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
|
||||
class Foo {
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>rootPackageMatched.kt</file>
|
||||
<line>1</line>
|
||||
<module>testMismatchedProjectAndDirectoryRoot_MismatchedProjectAndDirectoryRoot</module>
|
||||
<entry_point TYPE="file" FQNAME="rootPackageMatched.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Package name does not match containing directory</problem_class>
|
||||
<description>Package directive doesn't match file location</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"inspectionClass": "org.jetbrains.kotlin.idea.refactoring.move.changePackage.PackageDirectoryMismatchInspection"
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
|
||||
class Foo
|
||||
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
<caret>
|
||||
class Foo
|
||||
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "source/test.kt",
|
||||
"inspectionClass": "org.jetbrains.kotlin.idea.refactoring.move.changePackage.PackageDirectoryMismatchInspection",
|
||||
"fix": "Move file to source root"
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package target
|
||||
|
||||
class Foo
|
||||
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package target
|
||||
|
||||
fun test() {
|
||||
Foo()
|
||||
foo()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package usages
|
||||
|
||||
import target.foo
|
||||
import target.Foo
|
||||
|
||||
fun test() {
|
||||
Foo()
|
||||
foo()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<caret>class Foo
|
||||
|
||||
fun foo() {
|
||||
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package target
|
||||
|
||||
import foo
|
||||
import Foo
|
||||
|
||||
fun test() {
|
||||
Foo()
|
||||
foo()
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package usages
|
||||
|
||||
import foo
|
||||
import Foo
|
||||
|
||||
fun test() {
|
||||
Foo()
|
||||
foo()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "target/test.kt",
|
||||
"inspectionClass": "org.jetbrains.kotlin.idea.refactoring.move.changePackage.PackageDirectoryMismatchInspection",
|
||||
"fix": "Change file's package to 'target'"
|
||||
}
|
||||
Reference in New Issue
Block a user