Remastering of documentation provider

- Remove whole file resolve
- Take already resolved element
- Get kotlin element behind the wrapper directly
- Remove outdated isKotlinDeclaration method
- More tests
This commit is contained in:
Nikolay Krasko
2013-11-11 17:46:10 +04:00
parent 3d3464d163
commit 8f12db341e
17 changed files with 257 additions and 89 deletions
@@ -0,0 +1,3 @@
fun some(<caret>f: (Int) -> String) : String? = null
//INFO: <b>value-parameter</b> <b>val</b> f: (jet.Int) &rarr; jet.String <i>defined in</i> some
@@ -0,0 +1,5 @@
trait Base
class Some<<caret>T: Base>
//INFO: &lt;T : Base> <i>defined in</i> Some
@@ -0,0 +1,8 @@
fun some() : String? = null
fun test() {
val <caret>test = some()
}
//INFO: <b>val</b> test: jet.String? <i>defined in</i> test
@@ -0,0 +1,5 @@
fun testing() {
<caret>SomeClass<List<String>>()
}
// INFO: <b>public</b> <b>constructor</b> SomeClass&lt;T : jet.List&lt;jet.Any?&gt;?>() <i>defined in</i> SomeClass<br/>Java declaration:<br/>[light_idea_test_case] public class SomeClass&lt;T extends java.util.List&gt; extends Object
@@ -0,0 +1,9 @@
import java.util.List;
/**
* Some Java Class
* @param <T>
*/
public class SomeClass<T extends List> {
}
@@ -0,0 +1,5 @@
fun ktTest() {
Test.<caret>foo("SomeTest")
}
//INFO: <b>public</b> <b>open</b> <b>fun</b> foo(param: jet.String?): jet.Array&lt;jet.Any&gt;? <i>defined in</i> Test<br/>Java declaration:<br/>Test...
@@ -0,0 +1,9 @@
class Test {
/**
* Java Method
*/
@KotlinSignature("fun foo(param: String): Array<out Any>")
public static Object[] foo(String param) {
return new Object[0];
}
}
@@ -0,0 +1,9 @@
import testing.Test
class KotlinClassUsedFromJava {
void test() {
<caret>Test()
}
}
//INFO: [light_idea_test_case] testing...
@@ -0,0 +1,6 @@
package testing
/**
* Some comment
*/
class Test
@@ -0,0 +1,9 @@
import testing.TestingPackage
class KotlinClassUsedFromJava {
void test() {
<caret>TestingPackage.foo()
}
}
// INFO: [light_idea_test_case] testing...
@@ -0,0 +1,4 @@
package testing
fun foo() {
}
@@ -0,0 +1,11 @@
package server
import some.SomePackage
class Testing {
void test() {
SomePackage.<caret>foo(12);
}
}
// INFO: <b>internal</b> <b>fun</b> foo(bar: jet.Int): jet.Unit <i>defined in</i> some<br/><p>KDoc foo<br/></p>
@@ -0,0 +1,7 @@
package some
/**
* KDoc foo
*/
fun foo(bar: Int) {
}