Spring Support: Implement @ComponentScan inspection
#KT-12465 Fixed
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
package foo
|
||||
|
||||
// Make PsiPackage not empty
|
||||
fun dummyFun() {
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>14</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">@ComponentScan setup (Kotlin)</problem_class>
|
||||
<description>Cannot resolve package bar</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>18</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">@ComponentScan setup (Kotlin)</problem_class>
|
||||
<description>Cannot resolve package bar</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.spring.inspections.KotlinSpringComponentScanInspection
|
||||
// FIXTURE_CLASS: org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension
|
||||
// CONFIGURE_SPRING_FILE_SET
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
// WITH_RUNTIME
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.stereotype.Component
|
||||
import org.springframework.context.annotation.ComponentScan
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = arrayOf("foo"))
|
||||
open class App1
|
||||
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = arrayOf("foo", "bar"))
|
||||
open class App2
|
||||
|
||||
@Configuration
|
||||
@ComponentScan(basePackages = arrayOf("bar"))
|
||||
open class App3
|
||||
Reference in New Issue
Block a user