PackageDirectoryMismatchInspection should report when a package statement is missing

#KT-13549 Fixed
This commit is contained in:
Dmitry Gridin
2019-04-24 15:46:54 +07:00
parent 2ae30de980
commit 0198df4935
18 changed files with 136 additions and 40 deletions
@@ -0,0 +1,5 @@
{
"mainFile": "source/test.kt",
"inspectionClass": "org.jetbrains.kotlin.idea.refactoring.move.changePackage.PackageDirectoryMismatchInspection",
"fix": "Move file to source root"
}
@@ -0,0 +1,7 @@
package target
class Foo
fun foo() {
}
@@ -0,0 +1,6 @@
package target
fun test() {
Foo()
foo()
}
@@ -0,0 +1,9 @@
package usages
import target.foo
import target.Foo
fun test() {
Foo()
foo()
}
@@ -0,0 +1,9 @@
package target
import foo
import Foo
fun test() {
Foo()
foo()
}
@@ -0,0 +1,9 @@
package usages
import foo
import Foo
fun test() {
Foo()
foo()
}
@@ -0,0 +1,5 @@
{
"mainFile": "target/test.kt",
"inspectionClass": "org.jetbrains.kotlin.idea.refactoring.move.changePackage.PackageDirectoryMismatchInspection",
"fix": "Change file's package to 'target'"
}