[RESTORED] Spring Support: Show Spring line markers for Kotlin classes

#KT-3741 Fixed
This commit is contained in:
Alexey Sedunov
2016-03-22 21:26:30 +03:00
parent 962b312fb7
commit a89dbfcfd4
66 changed files with 836 additions and 2 deletions
@@ -8,4 +8,5 @@ annotation class MyAnnotation(val first: String, val second: String)
// ANNOTATION: MyAnnotation
// SEARCH: method:test1
// SEARCH: class:Test1
// SEARCH: class:Test1
// SEARCH: field:test3
@@ -0,0 +1,17 @@
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Bean
class Bean {
@Autowired
fun setProp1(autowiredProp: String) {
}
@Autowired
lateinit var prop2: String
@Be<caret>an(name = "myBean")
@Autowired
fun myBean(collab: String): String {
return "aaa" + collab
}
}
@@ -0,0 +1,9 @@
{
withRuntime: "true",
springConfig: ["config.xml"],
file: "Bean.kt",
icon: "ShowAutowiredDependencies",
tooltip: "Navigate to autowired candidates",
naming: "generic",
targets: ["myBean(String)", "prop2", "setProp1(String)"]
}
@@ -0,0 +1,11 @@
<?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="bean" class="Bean"/>
<bean id="stringBean1" class="java.lang.String"/>
<bean id="stringBean2" class="java.lang.String"/>
</beans>
@@ -0,0 +1,6 @@
import org.springframework.beans.factory.annotation.Autowired
class Bean {
@Autowired
lateinit var pr<caret>op: String
}
@@ -0,0 +1,8 @@
{
springConfig: ["config.xml"],
file: "Bean.kt",
icon: "ShowAutowiredDependencies",
tooltip: "Navigate to the autowired dependencies",
naming: "bean",
targets: ["stringBean1", "stringBean2"]
}
@@ -0,0 +1,11 @@
<?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="bean" class="Bean"/>
<bean id="stringBean1" class="java.lang.String"/>
<bean id="stringBean2" class="java.lang.String"/>
</beans>
@@ -0,0 +1,6 @@
import org.springframework.beans.factory.annotation.Autowired
class Bean {
@Autowired
fun setProp(autowired<caret>Prop: String) { }
}
@@ -0,0 +1,9 @@
{
withRuntime: "true",
"springConfig": ["config.xml"],
file: "Bean.kt",
icon: "ShowAutowiredDependencies",
tooltip: "Navigate to the autowired dependencies",
naming: "bean",
targets: ["stringBean1", "stringBean2"]
}
@@ -0,0 +1,11 @@
<?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="bean" class="Bean"/>
<bean id="stringBean1" class="java.lang.String"/>
<bean id="stringBean2" class="java.lang.String"/>
</beans>
+7
View File
@@ -0,0 +1,7 @@
class Be<caret>an {
var prop1: String
fun setProp2(value: String) {
}
}
@@ -0,0 +1,8 @@
{
springConfig: ["config.xml"],
file: "Bean.kt",
icon: "SpringBean",
tooltip: "Navigate to the spring bean declaration(s)",
naming: "bean",
targets: ["bean"]
}
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="bean" class="Bean"/>
</beans>
@@ -0,0 +1 @@
abstract class Abstract<caret>Bean
@@ -0,0 +1 @@
class AbstractBeanInheritor : AbstractBean()
@@ -0,0 +1 @@
class AbstractBeanInheritor2 : AbstractBean()
@@ -0,0 +1,8 @@
{
springConfig: ["inheritors.xml"],
file: "AbstractBean.kt",
icon: "SpringBean",
tooltip: "Navigate to the spring bean declaration(s)",
naming: "bean",
targets: ["inheritor", "inheritor2"]
}
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="inheritor" class="AbstractBeanInheritor"/>
<bean id="inheritor2" class="AbstractBeanInheritor2"/>
</beans>
@@ -0,0 +1,3 @@
package test
class Bean(val n: Int)
@@ -0,0 +1,6 @@
import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
@Component<caret>Scan("beans")
@Configuration
open class ComponentScan
@@ -0,0 +1,6 @@
package beans
import org.springframework.stereotype.Controller
@Controller(value = "customControllerName")
class MyController
@@ -0,0 +1,18 @@
package beans
import org.springframework.stereotype.Component
import javax.annotation.Resource
import test.Bean
@Component
class ResourceGutter {
@Resource(name = "bean1")
fun setResource(be<caret>an: Bean) {
}
@Resource
fun setUnknown(booo: Boolean) {
}
}
@@ -0,0 +1,8 @@
{
springConfig: ["ComponentScan.kt"],
file: "ComponentScan.kt",
icon: "SpringJavaBean",
tooltip: "Navigate to the spring bean declaration(s)",
naming: "bean",
targets: ["resourceGutter", "customControllerName"]
}
@@ -0,0 +1,21 @@
import pkg.*
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
@Configuration
class ContextBeanInjectionPoints {
@Bean
fun foo(): Foo {
return Foo()
}
@Bean
fun foo2(): Foo {
return Foo()
}
@Bean
fun bar(f: F<caret>oo): Bar {
return Bar(f)
}
}
@@ -0,0 +1,5 @@
package pkg
class Foo
class Bar(foo: Foo)
@@ -0,0 +1,8 @@
{
springConfig: [],
file: "ContextBeanInjectionPoints.kt",
icon: "ShowAutowiredDependencies",
tooltip: "Navigate to the autowired dependencies",
naming: "generic",
targets: ["foo()", "foo2()"]
}
@@ -0,0 +1,22 @@
import pkg.*
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
import org.springframework.beans.factory.annotation.Qualifier
@Configuration
class ContextBeanWithQualifierInjectionPoints {
@Bean
fun foo(): Foo {
return Foo()
}
@Bean
fun foo2(): Foo {
return Foo()
}
@Bean
fun bar(@Qualifier("foo2") f: F<caret>oo): Bar {
return Bar(f)
}
}
@@ -0,0 +1,5 @@
package pkg
class Foo
class Bar(foo: Foo)
@@ -0,0 +1,9 @@
{
withRuntime: "true",
springConfig: [],
file: "ContextBeanWithQualifierInjectionPoints.kt",
icon: "ShowAutowiredDependencies",
tooltip: "Navigate to the autowired dependencies",
naming: "generic",
targets: ["foo2()"]
}
@@ -0,0 +1 @@
class Inner<caret>Bean
@@ -0,0 +1,8 @@
{
springConfig: ["innerBeanGutter.xml"],
file: "InnerBean.kt",
icon: "SpringBean",
tooltip: "Navigate to the spring bean declaration(s)",
naming: "bean",
targets: ["InnerBean"]
}
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="bean" class="Bean">
<property name="foo">
<bean class="InnerBean"/>
</property>
</bean>
</beans>
@@ -0,0 +1,4 @@
class Bean {
fun my<caret>Init() {
}
}
@@ -0,0 +1,7 @@
<?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="myInit"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="bean" class="Bean"/>
</beans>
@@ -0,0 +1,8 @@
{
springConfig: ["config.xml"],
file: "Bean.kt",
icon: "SpringBeanMethod",
tooltip: "Navigate to the spring bean init method declaration",
naming: "generic",
targets: ["default-init-method"]
}
@@ -0,0 +1,6 @@
class Bean {
companion object {
@JvmStatic
fun my<caret>Factory() = "TEST"
}
}
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="bean" class="Bean" factory-method="myFactory"/>
</beans>
@@ -0,0 +1,9 @@
{
withRuntime: "true",
springConfig: ["config.xml"],
file: "Bean.kt",
icon: "FactoryMethodBean",
tooltip: "Navigate to the spring bean factory method declaration",
naming: "generic",
targets: ["factory-method"]
}
@@ -0,0 +1,4 @@
class Bean {
fun my<caret>Init() {
}
}
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="bean" class="Bean" init-method="myInit"/>
</beans>
@@ -0,0 +1,8 @@
{
springConfig: ["config.xml"],
file: "Bean.kt",
icon: "SpringBeanMethod",
tooltip: "Navigate to the spring bean init method declaration",
naming: "generic",
targets: ["init-method"]
}
@@ -0,0 +1,4 @@
class Bean {
fun my<caret>Fun() {
}
}
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="bean" class="Bean" destroy-method="myFun" factory-method="myFun" init-method="myFun"/>
</beans>
@@ -0,0 +1,8 @@
{
springConfig: ["config.xml"],
file: "Bean.kt",
icon: "SpringBeanMethod",
tooltip: "Navigate to the spring bean method declarations",
naming: "generic",
targets: ["destroy-method", "init-method"]
}
@@ -0,0 +1,3 @@
class BeanWithProperties {
lateinit var pr<caret>op: String
}
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="my" class="BeanWithProperties" p:prop="2">
<property name="prop" value="2"/>
</bean>
</beans>
@@ -0,0 +1,8 @@
{
springConfig: ["propertyGutter.xml"],
file: "BeanWithProperties.kt",
icon: "SpringProperty",
tooltip: "Navigate to the spring bean property",
naming: "property",
targets: ["prop", "prop"]
}
@@ -0,0 +1,3 @@
class BeanWithProperties {
fun set<caret>Prop(prop: String) { }
}
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="my" class="BeanWithProperties" p:prop="2">
<property name="prop" value="2"/>
</bean>
</beans>
@@ -0,0 +1,8 @@
{
springConfig: ["propertyGutter.xml"],
file: "BeanWithProperties.kt",
icon: "SpringProperty",
tooltip: "Navigate to the spring bean property",
naming: "property",
targets: ["prop", "prop"]
}
@@ -0,0 +1,3 @@
package test
class Bean(val n: Int)
@@ -0,0 +1,3 @@
package javax.annotation
annotation class Resource(val name: String = "")
@@ -0,0 +1,13 @@
package beans
import org.springframework.stereotype.Component
import javax.annotation.Resource
import test.Bean
@Component
class ResourceGutter {
@Resource(name = "bean1")
fun setResource(be<caret>an: Bean) {
}
}
@@ -0,0 +1,8 @@
{
springConfig: ["resourceGutter.xml"],
file: "beans/ResourceGutter.kt",
icon: "ShowAutowiredDependencies",
tooltip: "Navigate to the autowired dependencies",
naming: "bean",
targets: ["bean1"]
}
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ctx="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd ">
<ctx:component-scan annotation-config="true" base-package="beans"/>
<bean id="bean1" class="test.Bean">
<constructor-arg type="int" value="1"/>
</bean>
<bean id="bean2" class="test.Bean">
<constructor-arg type="int" value="2"/>
</bean>
</beans>