Spring Support: "Generate @Autowired Dependency..." action
#KT-11408 Fixed
This commit is contained in:
@@ -130,6 +130,7 @@ New features:
|
|||||||
- [KT-11406](https://youtrack.jetbrains.com/issue/KT-11406) Support Spring EL injections inside of Kotlin string literals
|
- [KT-11406](https://youtrack.jetbrains.com/issue/KT-11406) Support Spring EL injections inside of Kotlin string literals
|
||||||
- [KT-11604](https://youtrack.jetbrains.com/issue/KT-11604) Support "Configure Spring facet" inspection on Kotlin classes
|
- [KT-11604](https://youtrack.jetbrains.com/issue/KT-11604) Support "Configure Spring facet" inspection on Kotlin classes
|
||||||
- [KT-11407](https://youtrack.jetbrains.com/issue/KT-11407) Implemented "Generate Spring Dependency..." actions
|
- [KT-11407](https://youtrack.jetbrains.com/issue/KT-11407) Implemented "Generate Spring Dependency..." actions
|
||||||
|
- [KT-11408](https://youtrack.jetbrains.com/issue/KT-11408) Implemented "Generate @Autowired Dependency..." action
|
||||||
|
|
||||||
Issues fixed:
|
Issues fixed:
|
||||||
|
|
||||||
|
|||||||
@@ -25,15 +25,20 @@
|
|||||||
|
|
||||||
<actions>
|
<actions>
|
||||||
<action id="Kotlin.Spring.Beans.Generate.Setter.Dependency.Action"
|
<action id="Kotlin.Spring.Beans.Generate.Setter.Dependency.Action"
|
||||||
class="org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Setter">
|
class="org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Setter">
|
||||||
<add-to-group anchor="last" group-id="GenerateGroup"/>
|
<add-to-group anchor="last" group-id="GenerateGroup"/>
|
||||||
</action>
|
</action>
|
||||||
<action id="Kotlin.Spring.Beans.Generate.Constructor.Dependency.Action"
|
<action id="Kotlin.Spring.Beans.Generate.Constructor.Dependency.Action"
|
||||||
class="org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor">
|
class="org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor">
|
||||||
<add-to-group anchor="last" group-id="GenerateGroup"/>
|
<add-to-group anchor="last" group-id="GenerateGroup"/>
|
||||||
</action>
|
</action>
|
||||||
<action id="Kotlin.Spring.Beans.Generate.Lateinit.Property.Dependency.Action"
|
<action id="Kotlin.Spring.Beans.Generate.Lateinit.Property.Dependency.Action"
|
||||||
class="org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$LateinitProperty">
|
class="org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$LateinitProperty">
|
||||||
|
<add-to-group anchor="last" group-id="GenerateGroup"/>
|
||||||
|
</action>
|
||||||
|
|
||||||
|
<action id="Kotlin.Spring.Beans.Generate.Autowired.Dependency.Action"
|
||||||
|
class="org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction">
|
||||||
<add-to-group anchor="last" group-id="GenerateGroup"/>
|
<add-to-group anchor="last" group-id="GenerateGroup"/>
|
||||||
</action>
|
</action>
|
||||||
</actions>
|
</actions>
|
||||||
|
|||||||
+41
@@ -0,0 +1,41 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2016 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.idea.spring.generate
|
||||||
|
|
||||||
|
import com.intellij.openapi.editor.Editor
|
||||||
|
import com.intellij.openapi.module.Module
|
||||||
|
import com.intellij.openapi.project.Project
|
||||||
|
import com.intellij.psi.PsiFile
|
||||||
|
import com.intellij.spring.SpringBundle
|
||||||
|
import org.jetbrains.kotlin.asJava.toLightClass
|
||||||
|
import org.jetbrains.kotlin.idea.editor.BatchTemplateRunner
|
||||||
|
import org.jetbrains.kotlin.idea.util.application.executeWriteCommand
|
||||||
|
import org.jetbrains.kotlin.psi.KtClass
|
||||||
|
|
||||||
|
class GenerateKotlinAutowiredDependencyAction : GenerateKotlinSpringBeanDependencyAction(
|
||||||
|
SpringBundle.message("action.generate.autowired.dependencies.action.text")
|
||||||
|
) {
|
||||||
|
override fun checkContext(module: Module) = true
|
||||||
|
|
||||||
|
override fun invoke(project: Project, editor: Editor, file: PsiFile) {
|
||||||
|
val klass = getTargetClass(editor, file) as? KtClass ?: return
|
||||||
|
val lightClass = klass.toLightClass() ?: return
|
||||||
|
project
|
||||||
|
.executeWriteCommand<List<BatchTemplateRunner>>("") { generateAutowiredDependenciesFor(lightClass) }
|
||||||
|
.forEach { it.runTemplates() }
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-36
@@ -16,39 +16,15 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.spring.generate
|
package org.jetbrains.kotlin.idea.spring.generate
|
||||||
|
|
||||||
import com.intellij.openapi.editor.Editor
|
import com.intellij.openapi.module.Module
|
||||||
import com.intellij.openapi.project.Project
|
|
||||||
import com.intellij.psi.PsiFile
|
|
||||||
import com.intellij.psi.xml.XmlFile
|
|
||||||
import com.intellij.spring.SpringBundle
|
|
||||||
import com.intellij.spring.SpringManager
|
|
||||||
import com.intellij.spring.model.actions.generate.GenerateSpringBeanDependenciesUtil
|
import com.intellij.spring.model.actions.generate.GenerateSpringBeanDependenciesUtil
|
||||||
import com.intellij.spring.model.utils.SpringModelUtils
|
|
||||||
import icons.SpringApiIcons
|
import icons.SpringApiIcons
|
||||||
import org.jetbrains.kotlin.asJava.toLightClass
|
import org.jetbrains.kotlin.asJava.toLightClass
|
||||||
import org.jetbrains.kotlin.idea.actions.generate.KotlinGenerateActionBase
|
import org.jetbrains.kotlin.idea.actions.generate.KotlinGenerateActionBase
|
||||||
import org.jetbrains.kotlin.idea.editor.BatchTemplateRunner
|
|
||||||
import org.jetbrains.kotlin.idea.util.application.executeWriteCommand
|
|
||||||
import org.jetbrains.kotlin.psi.KtClass
|
import org.jetbrains.kotlin.psi.KtClass
|
||||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||||
|
|
||||||
abstract class GenerateKotlinSpringBeanDependencyAction(
|
abstract class GenerateKotlinSpringBeanDependencyAction(text: String) : KotlinGenerateActionBase() {
|
||||||
text: String,
|
|
||||||
private val injectionKind: SpringDependencyInjectionKind
|
|
||||||
) : KotlinGenerateActionBase() {
|
|
||||||
class Constructor: GenerateKotlinSpringBeanDependencyAction(
|
|
||||||
SpringBundle.message("action.Spring.Beans.Generate.Constructor.Dependency.Action.text"),
|
|
||||||
SpringDependencyInjectionKind.CONSTRUCTOR
|
|
||||||
)
|
|
||||||
class Setter: GenerateKotlinSpringBeanDependencyAction(
|
|
||||||
SpringBundle.message("action.Spring.Beans.Generate.Setter.Dependency.Action.text"),
|
|
||||||
SpringDependencyInjectionKind.SETTER
|
|
||||||
)
|
|
||||||
class LateinitProperty: GenerateKotlinSpringBeanDependencyAction(
|
|
||||||
"Spring 'lateinit' Dependency...",
|
|
||||||
SpringDependencyInjectionKind.LATEINIT_PROPERTY
|
|
||||||
)
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
templatePresentation.text = text
|
templatePresentation.text = text
|
||||||
templatePresentation.icon = SpringApiIcons.Spring
|
templatePresentation.icon = SpringApiIcons.Spring
|
||||||
@@ -58,16 +34,8 @@ abstract class GenerateKotlinSpringBeanDependencyAction(
|
|||||||
if (targetClass !is KtClass || targetClass.isInterface() || targetClass.isEnum() || targetClass.fqName == null) return false
|
if (targetClass !is KtClass || targetClass.isInterface() || targetClass.isEnum() || targetClass.fqName == null) return false
|
||||||
val lightClass = targetClass.toLightClass() ?: return false
|
val lightClass = targetClass.toLightClass() ?: return false
|
||||||
val module = GenerateSpringBeanDependenciesUtil.getSpringModule(lightClass) ?: return false
|
val module = GenerateSpringBeanDependenciesUtil.getSpringModule(lightClass) ?: return false
|
||||||
return SpringManager.getInstance(module.project).getCombinedModel(module).configFiles.any { it is XmlFile }
|
return checkContext(module)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun invoke(project: Project, editor: Editor, file: PsiFile) {
|
abstract fun checkContext(module: Module): Boolean
|
||||||
val klass = getTargetClass(editor, file) as? KtClass ?: return
|
|
||||||
val lightClass = klass.toLightClass() ?: return
|
|
||||||
val springModel = SpringModelUtils.getInstance().getPsiClassSpringModel(lightClass)
|
|
||||||
val templates = project.executeWriteCommand<List<BatchTemplateRunner>>("") {
|
|
||||||
generateDependenciesFor(springModel, lightClass, injectionKind)
|
|
||||||
}
|
|
||||||
templates.forEach { it.runTemplates() }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+64
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2016 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.idea.spring.generate
|
||||||
|
|
||||||
|
import com.intellij.openapi.editor.Editor
|
||||||
|
import com.intellij.openapi.module.Module
|
||||||
|
import com.intellij.openapi.project.Project
|
||||||
|
import com.intellij.psi.PsiFile
|
||||||
|
import com.intellij.psi.xml.XmlFile
|
||||||
|
import com.intellij.spring.SpringBundle
|
||||||
|
import com.intellij.spring.SpringManager
|
||||||
|
import com.intellij.spring.model.utils.SpringModelUtils
|
||||||
|
import org.jetbrains.kotlin.asJava.toLightClass
|
||||||
|
import org.jetbrains.kotlin.idea.editor.BatchTemplateRunner
|
||||||
|
import org.jetbrains.kotlin.idea.util.application.executeWriteCommand
|
||||||
|
import org.jetbrains.kotlin.psi.KtClass
|
||||||
|
|
||||||
|
abstract class GenerateKotlinSpringBeanXmlDependencyAction(
|
||||||
|
text: String,
|
||||||
|
private val injectionKind: SpringDependencyInjectionKind
|
||||||
|
) : GenerateKotlinSpringBeanDependencyAction(text) {
|
||||||
|
class Constructor: GenerateKotlinSpringBeanXmlDependencyAction(
|
||||||
|
SpringBundle.message("action.Spring.Beans.Generate.Constructor.Dependency.Action.text"),
|
||||||
|
SpringDependencyInjectionKind.CONSTRUCTOR
|
||||||
|
)
|
||||||
|
|
||||||
|
class Setter: GenerateKotlinSpringBeanXmlDependencyAction(
|
||||||
|
SpringBundle.message("action.Spring.Beans.Generate.Setter.Dependency.Action.text"),
|
||||||
|
SpringDependencyInjectionKind.SETTER
|
||||||
|
)
|
||||||
|
|
||||||
|
class LateinitProperty: GenerateKotlinSpringBeanXmlDependencyAction(
|
||||||
|
"Spring 'lateinit' Dependency...",
|
||||||
|
SpringDependencyInjectionKind.LATEINIT_PROPERTY
|
||||||
|
)
|
||||||
|
|
||||||
|
override fun checkContext(module: Module): Boolean {
|
||||||
|
return SpringManager.getInstance(module.project).getCombinedModel(module).configFiles.any { it is XmlFile }
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun invoke(project: Project, editor: Editor, file: PsiFile) {
|
||||||
|
val klass = getTargetClass(editor, file) as? KtClass ?: return
|
||||||
|
val lightClass = klass.toLightClass() ?: return
|
||||||
|
val springModel = SpringModelUtils.getInstance().getPsiClassSpringModel(lightClass)
|
||||||
|
val templates = project.executeWriteCommand<List<BatchTemplateRunner>>("") {
|
||||||
|
generateDependenciesFor(springModel, lightClass, injectionKind)
|
||||||
|
}
|
||||||
|
templates.forEach { it.runTemplates() }
|
||||||
|
}
|
||||||
|
}
|
||||||
+120
@@ -0,0 +1,120 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2016 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.idea.spring.generate
|
||||||
|
|
||||||
|
import com.intellij.codeInsight.template.TemplateBuilderImpl
|
||||||
|
import com.intellij.openapi.application.ApplicationManager
|
||||||
|
import com.intellij.openapi.util.text.StringUtil
|
||||||
|
import com.intellij.psi.PsiClass
|
||||||
|
import com.intellij.spring.CommonSpringModel
|
||||||
|
import com.intellij.spring.constants.SpringAnnotationsConstants
|
||||||
|
import com.intellij.spring.model.CommonSpringBean
|
||||||
|
import com.intellij.spring.model.SpringBeanPointer
|
||||||
|
import com.intellij.spring.model.SpringModelSearchParameters
|
||||||
|
import com.intellij.spring.model.actions.generate.GenerateSpringBeanDependenciesUtil
|
||||||
|
import com.intellij.spring.model.utils.SpringModelSearchers
|
||||||
|
import com.intellij.spring.model.utils.SpringModelUtils
|
||||||
|
import com.intellij.util.IncorrectOperationException
|
||||||
|
import org.jetbrains.kotlin.asJava.KtLightClass
|
||||||
|
import org.jetbrains.kotlin.idea.core.KotlinNameSuggester
|
||||||
|
import org.jetbrains.kotlin.idea.editor.BatchTemplateRunner
|
||||||
|
import org.jetbrains.kotlin.psi.KtProperty
|
||||||
|
import org.jetbrains.kotlin.psi.KtPsiFactory
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.createSmartPointer
|
||||||
|
import org.jetbrains.kotlin.utils.ifEmpty
|
||||||
|
import org.jetbrains.kotlin.idea.util.ShortenReferences
|
||||||
|
|
||||||
|
// TODO: GenerateAutowiredDependenciesUtil.getQualifierName() is not accessible here
|
||||||
|
private fun SpringBeanPointer<CommonSpringBean>.getQualifierName(): String? {
|
||||||
|
val value = springBean.springQualifier?.qualifierValue
|
||||||
|
return if (value.isNullOrBlank()) name else value
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun createAutowiredProperty(
|
||||||
|
currentBeanClass: KtLightClass,
|
||||||
|
candidateBean: SpringBeanPointer<CommonSpringBean>,
|
||||||
|
candidateBeanClasses: Array<out PsiClass>,
|
||||||
|
model: CommonSpringModel
|
||||||
|
): KtProperty? {
|
||||||
|
try {
|
||||||
|
val ktBeanClass = currentBeanClass.kotlinOrigin ?: return null
|
||||||
|
|
||||||
|
val qualifierName = candidateBean.getQualifierName()
|
||||||
|
val candidateBeanClass = candidateBeanClasses.first()
|
||||||
|
val beanName = candidateBean.name
|
||||||
|
val name = if (beanName != null && KotlinNameSuggester.isIdentifier(beanName)) beanName else candidateBeanClass.name!!
|
||||||
|
|
||||||
|
val psiFactory = KtPsiFactory(currentBeanClass.project)
|
||||||
|
// TODO: Use KtPsiFactory.CallableBuilder
|
||||||
|
val prototype = psiFactory.createProperty("lateinit var ${name.decapitalize()}: ${candidateBeanClass.defaultTypeText}").apply {
|
||||||
|
addAnnotationEntry(psiFactory.createAnnotationEntry("@${SpringAnnotationsConstants.AUTOWIRED}"))
|
||||||
|
|
||||||
|
val searchParameters = SpringModelSearchParameters.byClass(candidateBeanClass).withInheritors().effectiveBeanTypes()
|
||||||
|
if (SpringModelSearchers.findBeans(model, searchParameters).size > 1 && !qualifierName.isNullOrBlank()) {
|
||||||
|
val annotationText = "@${SpringAnnotationsConstants.QUALIFIER}(\"${StringUtil.escapeStringCharacters(qualifierName!!)}\")"
|
||||||
|
addAnnotationEntry(psiFactory.createAnnotationEntry(annotationText))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ktBeanClass.addDeclaration(prototype).apply { ShortenReferences.DEFAULT.process(this) }
|
||||||
|
}
|
||||||
|
catch (e: IncorrectOperationException) {
|
||||||
|
throw RuntimeException(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun addCreatePropertyTemplate(
|
||||||
|
property: KtProperty,
|
||||||
|
candidateBean: SpringBeanPointer<CommonSpringBean>,
|
||||||
|
candidateBeanClasses: Array<out PsiClass>
|
||||||
|
): BatchTemplateRunner {
|
||||||
|
return BatchTemplateRunner(property.project).apply {
|
||||||
|
val propertyPointer = property.createSmartPointer()
|
||||||
|
addTemplateFactory(property) {
|
||||||
|
val currentProperty = propertyPointer.element ?: return@addTemplateFactory null
|
||||||
|
val builder = TemplateBuilderImpl(currentProperty)
|
||||||
|
builder.appendVariableTemplate(currentProperty, candidateBeanClasses) {
|
||||||
|
val existingNames = currentProperty.containingClassOrObject!!.declarations
|
||||||
|
.mapNotNull { if (it != currentProperty) (it as? KtProperty)?.name else null }
|
||||||
|
getSuggestedNames(candidateBean, currentProperty, existingNames) { returnType }
|
||||||
|
}
|
||||||
|
builder.buildInlineTemplate()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun createAutowiredDependency(
|
||||||
|
klass: KtLightClass,
|
||||||
|
candidateBean: SpringBeanPointer<CommonSpringBean>,
|
||||||
|
model: CommonSpringModel
|
||||||
|
): BatchTemplateRunner? {
|
||||||
|
val candidateBeanClasses = candidateBean.effectiveBeanType.ifEmpty { return null }
|
||||||
|
if (!GenerateSpringBeanDependenciesUtil.ensureFileWritable(klass)) return null
|
||||||
|
val property = createAutowiredProperty(klass, candidateBean, candidateBeanClasses, model) ?: return null
|
||||||
|
return addCreatePropertyTemplate(property, candidateBean, candidateBeanClasses)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun generateAutowiredDependenciesFor(klass: KtLightClass): List<BatchTemplateRunner> {
|
||||||
|
val model = SpringModelUtils.getInstance().getPsiClassSpringModel(klass)
|
||||||
|
val candidates = GenerateSpringBeanDependenciesUtil.getAutowiredBeanCandidates(model) { it.containingFile != klass.containingFile }
|
||||||
|
val dependencies = if (ApplicationManager.getApplication().isUnitTestMode) {
|
||||||
|
candidates.map { it.springBean }.filter(klass.project.beanFilter).sortedBy { it.name }
|
||||||
|
} else {
|
||||||
|
GenerateSpringBeanDependenciesUtil.chooseDependentBeans(candidates, klass.project, true)
|
||||||
|
}
|
||||||
|
return dependencies.mapNotNull { createAutowiredDependency(klass, it, model) }
|
||||||
|
}
|
||||||
+9
-6
@@ -136,7 +136,7 @@ private fun SpringBean.getFactoryFunctionName(factoryBeanClass: KtClass): String
|
|||||||
return KotlinNameSuggester.suggestNameByName("create${beanClass!!.name}") { it !in existingNames }
|
return KotlinNameSuggester.suggestNameByName("create${beanClass!!.name}") { it !in existingNames }
|
||||||
}
|
}
|
||||||
|
|
||||||
private val PsiClass.defaultTypeText: String
|
internal val PsiClass.defaultTypeText: String
|
||||||
get() {
|
get() {
|
||||||
val qName = qualifiedName ?: return "Any"
|
val qName = qualifiedName ?: return "Any"
|
||||||
val typeParameters = typeParameters
|
val typeParameters = typeParameters
|
||||||
@@ -175,29 +175,32 @@ private fun createSettable(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getSuggestedNames(
|
internal fun getSuggestedNames(
|
||||||
beanPointer: SpringBeanPointer<CommonSpringBean>,
|
beanPointer: SpringBeanPointer<CommonSpringBean>,
|
||||||
declaration: KtCallableDeclaration,
|
declaration: KtCallableDeclaration,
|
||||||
|
existingNames: Collection<String> = emptyList(),
|
||||||
getType: CallableDescriptor.() -> KotlinType?
|
getType: CallableDescriptor.() -> KotlinType?
|
||||||
): Collection<String> {
|
): Collection<String> {
|
||||||
val names = LinkedHashSet<String>()
|
val names = LinkedHashSet<String>()
|
||||||
|
|
||||||
val validator = NewDeclarationNameValidator(declaration.parent, null, NewDeclarationNameValidator.Target.VARIABLES, listOf(declaration))
|
val newDeclarationNameValidator =
|
||||||
|
NewDeclarationNameValidator(declaration.parent, null, NewDeclarationNameValidator.Target.VARIABLES, listOf(declaration))
|
||||||
|
fun validate(name: String) = name !in existingNames && newDeclarationNameValidator(name)
|
||||||
|
|
||||||
SpringBeanUtils.getInstance()
|
SpringBeanUtils.getInstance()
|
||||||
.findBeanNames(beanPointer.springBean)
|
.findBeanNames(beanPointer.springBean)
|
||||||
.asSequence()
|
.asSequence()
|
||||||
.filter { KotlinNameSuggester.isIdentifier(it) }
|
.filter { KotlinNameSuggester.isIdentifier(it) }
|
||||||
.mapTo(names) { KotlinNameSuggester.suggestNameByName(it, validator) }
|
.mapTo(names) { KotlinNameSuggester.suggestNameByName(it, ::validate) }
|
||||||
|
|
||||||
(declaration.resolveToDescriptor() as CallableDescriptor).getType()?.let {
|
(declaration.resolveToDescriptor() as CallableDescriptor).getType()?.let {
|
||||||
names += KotlinNameSuggester.suggestNamesByType(it, validator)
|
names += KotlinNameSuggester.suggestNamesByType(it, ::validate)
|
||||||
}
|
}
|
||||||
|
|
||||||
return names
|
return names
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun TemplateBuilderImpl.appendVariableTemplate(
|
internal fun TemplateBuilderImpl.appendVariableTemplate(
|
||||||
variable: KtCallableDeclaration,
|
variable: KtCallableDeclaration,
|
||||||
candidateBeanClasses: Array<out PsiClass>,
|
candidateBeanClasses: Array<out PsiClass>,
|
||||||
computeSuggestions: (() -> Collection<String>)?
|
computeSuggestions: (() -> Collection<String>)?
|
||||||
|
|||||||
+1
-1
@@ -43,7 +43,7 @@ abstract class AbstractGenerateSpringDependencyActionTest : AbstractCodeInsightA
|
|||||||
val springFileSet = TestFixtureExtension
|
val springFileSet = TestFixtureExtension
|
||||||
.getFixture<SpringTestFixtureExtension>()!!
|
.getFixture<SpringTestFixtureExtension>()!!
|
||||||
.configureFileSet(myFixture, listOf(configFilePath!!))
|
.configureFileSet(myFixture, listOf(configFilePath!!))
|
||||||
if (configFilePath != mainFilePath) {
|
if (configFilePath != mainFilePath && PathUtil.getFileName(configFilePath!!) != "spring-config.xml") {
|
||||||
configFile = springFileSet.files.single().file!!
|
configFile = springFileSet.files.single().file!!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+48
@@ -35,6 +35,54 @@ public class GenerateSpringDependencyActionTestGenerated extends AbstractGenerat
|
|||||||
KotlinTestUtils.assertAllTestsPresentInSingleGeneratedClass(this.getClass(), new File("idea/testData/spring/core/generate"), Pattern.compile("^([\\w]+)\\.kt$"));
|
KotlinTestUtils.assertAllTestsPresentInSingleGeneratedClass(this.getClass(), new File("idea/testData/spring/core/generate"), Pattern.compile("^([\\w]+)\\.kt$"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("autowiredDependencies/duplicatingPropertyAnnotationConfig.kt")
|
||||||
|
public void testAutowiredDependencies_DuplicatingPropertyAnnotationConfig() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/spring/core/generate/autowiredDependencies/duplicatingPropertyAnnotationConfig.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("autowiredDependencies/duplicatingPropertyXmlConfig.kt")
|
||||||
|
public void testAutowiredDependencies_DuplicatingPropertyXmlConfig() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/spring/core/generate/autowiredDependencies/duplicatingPropertyXmlConfig.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("autowiredDependencies/multiplePropertiesAnnotationConfig.kt")
|
||||||
|
public void testAutowiredDependencies_MultiplePropertiesAnnotationConfig() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/spring/core/generate/autowiredDependencies/multiplePropertiesAnnotationConfig.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("autowiredDependencies/multiplePropertiesXmlConfig.kt")
|
||||||
|
public void testAutowiredDependencies_MultiplePropertiesXmlConfig() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/spring/core/generate/autowiredDependencies/multiplePropertiesXmlConfig.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("autowiredDependencies/propertyWithQualifierAnnotationConfig.kt")
|
||||||
|
public void testAutowiredDependencies_PropertyWithQualifierAnnotationConfig() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/spring/core/generate/autowiredDependencies/propertyWithQualifierAnnotationConfig.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("autowiredDependencies/propertyWithQualifierXmlConfig.kt")
|
||||||
|
public void testAutowiredDependencies_PropertyWithQualifierXmlConfig() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/spring/core/generate/autowiredDependencies/propertyWithQualifierXmlConfig.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("autowiredDependencies/singlePropertyAnnotationConfig.kt")
|
||||||
|
public void testAutowiredDependencies_SinglePropertyAnnotationConfig() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/spring/core/generate/autowiredDependencies/singlePropertyAnnotationConfig.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("autowiredDependencies/singlePropertyXmlConfig.kt")
|
||||||
|
public void testAutowiredDependencies_SinglePropertyXmlConfig() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/spring/core/generate/autowiredDependencies/singlePropertyXmlConfig.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("beanDependenciesByXml/firstConstructor.kt")
|
@TestMetadata("beanDependenciesByXml/firstConstructor.kt")
|
||||||
public void testBeanDependenciesByXml_FirstConstructor() throws Exception {
|
public void testBeanDependenciesByXml_FirstConstructor() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/spring/core/generate/beanDependenciesByXml/firstConstructor.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/spring/core/generate/beanDependenciesByXml/firstConstructor.kt");
|
||||||
|
|||||||
Vendored
+19
@@ -0,0 +1,19 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class FooBean {
|
||||||
|
@Autowired lateinit var bean: BarBean<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class BarBean
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
open class Application
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class FooBean {
|
||||||
|
@Autowired lateinit var bean: BarBean
|
||||||
|
@Autowired lateinit var barBean<caret>: BarBean
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class BarBean
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
open class Application
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CONFIG_FILE: spring-config.xml
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
|
||||||
|
open class FooBean {
|
||||||
|
@Autowired lateinit var bean: BarBean<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
open class BarBean
|
||||||
Vendored
+13
@@ -0,0 +1,13 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CONFIG_FILE: spring-config.xml
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
|
||||||
|
open class FooBean {
|
||||||
|
@Autowired lateinit var bean: BarBean
|
||||||
|
@Autowired lateinit var barBean<caret>: BarBean
|
||||||
|
}
|
||||||
|
|
||||||
|
open class BarBean
|
||||||
Vendored
+18
@@ -0,0 +1,18 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CHOOSE_BEAN: barBean, application
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class FooBean {
|
||||||
|
<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class BarBean
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
open class Application
|
||||||
idea/testData/spring/core/generate/autowiredDependencies/multiplePropertiesAnnotationConfig.kt.after
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CHOOSE_BEAN: barBean, application
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
import org.springframework.stereotype.Component
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class FooBean {
|
||||||
|
@Autowired lateinit var application: Application
|
||||||
|
@Autowired lateinit var barBean<caret>: BarBean
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class BarBean
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
open class Application
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CONFIG_FILE: spring-config.xml
|
||||||
|
// CHOOSE_BEAN: barBean, fooBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
open class FooBean {
|
||||||
|
<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
open class BarBean
|
||||||
Vendored
+14
@@ -0,0 +1,14 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CONFIG_FILE: spring-config.xml
|
||||||
|
// CHOOSE_BEAN: barBean, fooBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
|
||||||
|
open class FooBean {
|
||||||
|
@Autowired lateinit var barBean: BarBean
|
||||||
|
@Autowired lateinit var fooBean: FooBean
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
open class BarBean
|
||||||
Vendored
+21
@@ -0,0 +1,21 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class FooBean {
|
||||||
|
<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class BarBean
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class BarBeanChild : BarBean()
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
open class Application
|
||||||
+24
@@ -0,0 +1,24 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier
|
||||||
|
import org.springframework.stereotype.Component
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class FooBean {
|
||||||
|
@Qualifier("barBean") @Autowired lateinit var barBean<caret>: BarBean
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class BarBean
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class BarBeanChild : BarBean()
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
open class Application
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CONFIG_FILE:
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
open class FooBean {
|
||||||
|
<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
open class BarBean
|
||||||
|
|
||||||
|
open class BarBeanChild : BarBean()
|
||||||
Vendored
+16
@@ -0,0 +1,16 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CONFIG_FILE:
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier
|
||||||
|
|
||||||
|
open class FooBean {
|
||||||
|
@Qualifier("barBean") @Autowired lateinit var barBean: BarBean
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
open class BarBean
|
||||||
|
|
||||||
|
open class BarBeanChild : BarBean()
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class FooBean {
|
||||||
|
<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class BarBean
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
open class Application
|
||||||
Vendored
+20
@@ -0,0 +1,20 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
import org.springframework.stereotype.Component
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class FooBean {
|
||||||
|
@Autowired lateinit var barBean<caret>: BarBean
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component
|
||||||
|
open class BarBean
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@ComponentScan
|
||||||
|
open class Application
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CONFIG_FILE: spring-config.xml
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
open class FooBean {
|
||||||
|
<caret>
|
||||||
|
}
|
||||||
|
|
||||||
|
open class BarBean
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinAutowiredDependencyAction
|
||||||
|
// CONFIG_FILE: spring-config.xml
|
||||||
|
// CHOOSE_BEAN: barBean
|
||||||
|
package a
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired
|
||||||
|
|
||||||
|
open class FooBean {
|
||||||
|
@Autowired lateinit var barBean<caret>: BarBean
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
open class BarBean
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
default-init-method="myDefaultInitMethod"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||||
|
<bean id="fooBean" class="a.FooBean"/>
|
||||||
|
<bean id="barBean" class="a.BarBean"/>
|
||||||
|
<bean id="barBeanChild" class="a.BarBeanChild"/>
|
||||||
|
</beans>
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: factoryMethod-config.xml
|
// CONFIG_FILE: factoryMethod-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: factoryMethod-config.xml
|
// CONFIG_FILE: factoryMethod-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: factoryMethod-config.xml
|
// CONFIG_FILE: factoryMethod-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: factoryMethod-config.xml
|
// CONFIG_FILE: factoryMethod-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: firstConstructor-config.xml
|
// CONFIG_FILE: firstConstructor-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: firstConstructor-config.xml
|
// CONFIG_FILE: firstConstructor-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: primaryConstructorAddParam-config.xml
|
// CONFIG_FILE: primaryConstructorAddParam-config.xml
|
||||||
// CHOOSE_BEAN: bazBean
|
// CHOOSE_BEAN: bazBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: primaryConstructorAddParam-config.xml
|
// CONFIG_FILE: primaryConstructorAddParam-config.xml
|
||||||
// CHOOSE_BEAN: bazBean
|
// CHOOSE_BEAN: bazBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$LateinitProperty
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$LateinitProperty
|
||||||
// CONFIG_FILE: property-config.xml
|
// CONFIG_FILE: property-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$LateinitProperty
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$LateinitProperty
|
||||||
// CONFIG_FILE: property-config.xml
|
// CONFIG_FILE: property-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: secondaryConstructor-config.xml
|
// CONFIG_FILE: secondaryConstructor-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: secondaryConstructor-config.xml
|
// CONFIG_FILE: secondaryConstructor-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: secondaryConstructorAddParam-config.xml
|
// CONFIG_FILE: secondaryConstructorAddParam-config.xml
|
||||||
// CHOOSE_BEAN: bazBean
|
// CHOOSE_BEAN: bazBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Constructor
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Constructor
|
||||||
// CONFIG_FILE: secondaryConstructorAddParam-config.xml
|
// CONFIG_FILE: secondaryConstructorAddParam-config.xml
|
||||||
// CHOOSE_BEAN: bazBean
|
// CHOOSE_BEAN: bazBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Setter
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Setter
|
||||||
// CONFIG_FILE: setter-config.xml
|
// CONFIG_FILE: setter-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanDependencyAction$Setter
|
// ACTION_CLASS: org.jetbrains.kotlin.idea.spring.generate.GenerateKotlinSpringBeanXmlDependencyAction$Setter
|
||||||
// CONFIG_FILE: setter-config.xml
|
// CONFIG_FILE: setter-config.xml
|
||||||
// CHOOSE_BEAN: barBean
|
// CHOOSE_BEAN: barBean
|
||||||
package a
|
package a
|
||||||
|
|||||||
Reference in New Issue
Block a user