173: Revert changes for IDEA < 181

This commit is contained in:
Simon Ogorodnik
2018-07-17 18:03:23 +03:00
parent c2e27a3c46
commit b58e35a3e5
48 changed files with 1272 additions and 0 deletions
@@ -0,0 +1,9 @@
interface OurFace
open class OurClass
fun context() {
val v = object : OurClass(), OurFace {}
v<caret>
}
//INFO: <pre><b>val</b> v: &lt;anonymous object : <a href="psi_element://OurClass">OurClass</a>, <a href="psi_element://OurFace">OurFace</a>&gt;</pre>
@@ -0,0 +1,12 @@
class C {
/** Use [SOME_REFERENCED_VAL] to do something */
fun fo<caret>o() {
}
companion object {
val SOME_REFERENCED_VAL = 1
}
}
//INFO: <pre><b>public</b> <b>final</b> <b>fun</b> foo(): Unit <i>defined in</i> C</pre><p>Use <a href="psi_element://SOME_REFERENCED_VAL">SOME_REFERENCED_VAL</a> to do something</p>
@@ -0,0 +1,3 @@
fun some(<caret>f: (Int) -> String) : String? = null
//INFO: <pre><b>value-parameter</b> f: (Int) &rarr; String</pre>
@@ -0,0 +1,7 @@
fun foo() {
listOf(1).forEach {
println(it<caret>)
}
}
//INFO: <pre><b>value-parameter</b> it: Int</pre>
@@ -0,0 +1,7 @@
fun foo() {
listOf(1).forEach {
println(i<caret>t)
}
}
//INFO: <pre><b>value-parameter</b> it: Int</pre>
+9
View File
@@ -0,0 +1,9 @@
fun context() {
fun local() {
}
<caret>local()
}
//INFO: <pre><b>local</b> <b>final</b> <b>fun</b> local(): Unit</pre>
+5
View File
@@ -0,0 +1,5 @@
interface Base
class Some<<caret>T: Base>
//INFO: <pre>&lt;T : <a href="psi_element://Base">Base</a>&gt; <i>defined in</i> Some</pre>
@@ -0,0 +1,8 @@
fun some() : String? = null
fun test() {
val <caret>test = some()
}
//INFO: <pre><b>val</b> test: String?</pre>
@@ -0,0 +1,7 @@
class C(var v: Int) {
fun foo() {
print(<caret>v)
}
}
//INFO: <pre><b>public</b> <b>final</b> <b>var</b> v: Int <i>defined in</i> C</pre>
@@ -0,0 +1,14 @@
/**
* Code block:
* ``` kotlin
* A<T>
* ```
* Code span:
* `<T>` is type parameter
*/
class <caret>A<T>
//INFO: <pre><b>public</b> <b>final</b> <b>class</b> A&lt;T&gt; <i>defined in</i> root package <i>in file</i> EscapeHtmlInsideCodeBlocks.kt</pre><p>Code block:</p>
//INFO: <pre><code>
//INFO: A&lt;T&gt;
//INFO: </code></pre><p>Code span: <code>&lt;T&gt;</code> is type parameter</p>
+10
View File
@@ -0,0 +1,10 @@
interface Foo
fun foo(a: Any) {}
fun Foo.bar() {
foo(th<caret>is)
}
//INFO: <pre><b>public</b> <b>fun</b> <a href="psi_element://Foo">Foo</a>.bar(): Unit <i>defined in</i> root package <i>in file</i> ExtensionReceiver.kt</pre>
@@ -0,0 +1,10 @@
interface Foo
fun foo(a: Any) {}
fun Foo.bar() {
foo(this<caret>)
}
//INFO: <pre><b>public</b> <b>fun</b> <a href="psi_element://Foo">Foo</a>.bar(): Unit <i>defined in</i> root package <i>in file</i> ExtensionReceiverEnd.kt</pre>
+22
View File
@@ -0,0 +1,22 @@
/**
* val a = A()
* println(a) // comment
* ```
* <fenced>Code_block</fenced>
* ```
* val b = B()
* println(b)
* some text content
*
* Indented code block with tab
* Second line
*/
class <caret>A
//INFO: <pre><b>public</b> <b>final</b> <b>class</b> A <i>defined in</i> root package <i>in file</i> IndentedCodeBlock.kt</pre><br/><pre><code>val a = A()
//INFO: println(a) // comment</code></pre><pre><code>
//INFO: &lt;fenced&gt;Code_block&lt;/fenced&gt;
//INFO: </code></pre><pre><code>val b = B()
//INFO: println(b)</code></pre><p>some text content</p>
//INFO: <pre><code>Indented code block with tab
//INFO: Second line</code></pre>
@@ -0,0 +1,8 @@
fun testing() {
<caret>SomeClass<List<String>>()
}
//INFO: <html><head> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><PRE>public class <b>SomeClass</b>&lt;T extends <a href="psi_element://java.util.List"><code>List</code></a>&gt;
//INFO: extends <a href="psi_element://java.lang.Object"><code>Object</code></a></PRE>
//INFO: Some Java Class
//INFO: <DD><DL><DT><b>Type parameters:</b><DD><code>&lt;T&gt;</code> - </DD></DL></DD></body></html>
@@ -0,0 +1,9 @@
class A : OverrideMe() {
override fun <caret>overrideMe() {
}
}
//INFO: <pre><b>protected</b> <b>open</b> <b>fun</b> overrideMe(): Unit <i>defined in</i> A</pre><DD><DL><DT><b>Description copied from class:</b>&nbsp;<a href="psi_element://OverrideMe"><code>OverrideMe</code></a><br>
//INFO: Some comment
//INFO: </DD></DL></DD><DD><DL><DT><b>Overrides:</b><DD><a href="psi_element://OverrideMe#overrideMe()"><code>overrideMe</code></a> in class <a href="psi_element://OverrideMe"><code>OverrideMe</code></a></DD></DL></DD>
@@ -0,0 +1,9 @@
class A : OverrideMe {
override fun <caret>overrideMe() {
}
}
//INFO: <pre><b>public</b> <b>open</b> <b>fun</b> overrideMe(): Unit <i>defined in</i> A</pre><DD><DL><DT><b>Description copied from interface:</b>&nbsp;<a href="psi_element://OverrideMe"><code>OverrideMe</code></a><br>
//INFO: Some comment
//INFO: </DD></DL></DD><DD><DL><DT><b>Specified by:</b><DD><a href="psi_element://OverrideMe#overrideMe()"><code>overrideMe</code></a> in interface <a href="psi_element://OverrideMe"><code>OverrideMe</code></a></DD></DL></DD>
@@ -0,0 +1,13 @@
fun ktTest() {
Test.<caret>foo("SomeTest")
}
//INFO: <html><head> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><small><b><a href="psi_element://Test"><code>Test</code></a></b></small><PRE><i>@Contract(pure = true)</i>&nbsp;
//INFO: <i>@<a href="psi_element://org.jetbrains.annotations.NotNull"><code>NotNull</code></a></i>&nbsp;
//INFO: public static&nbsp;<a href="psi_element://java.lang.Object"><code>Object</code></a>[]&nbsp;<b>foo</b>(<a href="psi_element://java.lang.String"><code>String</code></a>&nbsp;param)</PRE>
//INFO: Java Method
//INFO:
//INFO: <i>Inferred</i> annotations available:<br>
//INFO: <ul>
//INFO: <li><i>@org.jetbrains.annotations.Contract(pure = true)</i> <i>@<a href="psi_element://org.jetbrains.annotations.NotNull"><code>org.jetbrains.annotations.NotNull</code></a></i></li>
//INFO: </ul></body></html>
@@ -0,0 +1,9 @@
import testing.Test;
class KotlinClassUsedFromJava {
void test() {
<caret>Test();
}
}
//INFO: <pre><b>public</b> <b>final</b> <b>class</b> Test <i>defined in</i> testing <i>in file</i> KotlinClassUsedFromJava_Data.kt</pre><p>Some comment</p>
@@ -0,0 +1,10 @@
import testing.KotlinPackageClassUsedFromJava_DataKt;
class KotlinPackageClassUsedFromJava {
void test() {
<caret>KotlinPackageClassUsedFromJava_DataKt.foo();
}
}
//INFO: <html><head> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><small><b>testing</b></small><PRE>public final class <b>testing.KotlinPackageClassUsedFromJava_DataKt</b>
//INFO: extends <a href="psi_element://java.lang.Object"><code>Object</code></a></PRE></body></html>
+5
View File
@@ -0,0 +1,5 @@
fun test() {
listOf(1, 2, 4).<caret>filter { it > 0 }
}
//INFO: <pre><b>public</b> <b>inline</b> <b>fun</b> &lt;T&gt; <a href="psi_element://kotlin.collections.Iterable">Iterable</a>&lt;<a href="psi_element://kotlin.collections.filter.T">T</a>&gt;.filter(predicate: (<a href="psi_element://kotlin.collections.filter.T">T</a>) &rarr; Boolean): <a href="psi_element://kotlin.collections.List">List</a>&lt;<a href="psi_element://kotlin.collections.filter.T">T</a>&gt; <i>defined in</i> kotlin.collections <i>in file</i> CollectionsKt.class</pre><p>Returns a list containing only elements matching the given <a href="psi_element://predicate">predicate</a>.</p>
@@ -0,0 +1,6 @@
/**
* Usefull comment
*/
class <caret>Some
//INFO: <pre><b>public</b> <b>final</b> <b>class</b> Some <i>defined in</i> root package <i>in file</i> OnClassDeclarationWithNoPackage.kt</pre><p>Usefull comment</p>
@@ -0,0 +1,10 @@
/**
* Useless one
*/
enum class SomeEnum
fun use() {
Some<caret>Enum::class
}
//INFO: <pre><b>public</b> <b>final</b> <b>enum class</b> SomeEnum : <a href="psi_element://kotlin.Enum">Enum</a>&lt;<a href="psi_element://SomeEnum">SomeEnum</a>&gt; <i>defined in</i> root package <i>in file</i> OnEnumClassReference.kt</pre><p>Useless one</p>
@@ -0,0 +1,6 @@
/**
* Useless one
*/
enum class SomeEnum<caret>
//INFO: <pre><b>public</b> <b>final</b> <b>enum class</b> SomeEnum : <a href="psi_element://kotlin.Enum">Enum</a>&lt;<a href="psi_element://SomeEnum">SomeEnum</a>&gt; <i>defined in</i> root package <i>in file</i> OnEnumDeclaration.kt</pre><p>Useless one</p>
+7
View File
@@ -0,0 +1,7 @@
enum class TestEnum{
A, B, <caret>C
}
//INFO: <pre><b>enum entry</b> C <i>defined in</i> TestEnum</pre><b>Enum constant ordinal: 2</b>
+9
View File
@@ -0,0 +1,9 @@
enum class TestEnum{
A, B, C
}
fun test() {
TestEnum.<caret>C
}
//INFO: <pre><b>enum entry</b> C <i>defined in</i> TestEnum</pre><b>Enum constant ordinal: 2</b>
+12
View File
@@ -0,0 +1,12 @@
/**
* Enum of 1, 2
*/
enum class SomeEnum(val i: Int) {
One(1), Two(2);
}
fun use() {
Some<caret>Enum.One
}
//INFO: <pre><b>public</b> <b>final</b> <b>enum class</b> SomeEnum : <a href="psi_element://kotlin.Enum">Enum</a>&lt;<a href="psi_element://SomeEnum">SomeEnum</a>&gt; <i>defined in</i> root package <i>in file</i> OnEnumUsage.kt</pre><p>Enum of 1, 2</p>
@@ -0,0 +1,11 @@
enum class E {
A
}
fun use() {
E.valueOf<caret>("A")
}
//INFO: <b>public</b> <b>final</b> <b>fun</b> valueOf(value: String): <a href="psi_element://E">E</a> <i>defined in</i> E<p>Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)</p>
//INFO: <dl><dt><b>Throws:</b></dt><dd><code>IllegalArgumentException</code> - if this enum type has no constant with the specified name</dd></dl>
@@ -0,0 +1,9 @@
enum class E {
}
fun use() {
E.values<caret>()
}
//INFO: <b>public</b> <b>final</b> <b>fun</b> values(): Array&lt;<a href="psi_element://E">E</a>&gt; <i>defined in</i> E<p>Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants.</p>
@@ -0,0 +1,16 @@
package test
/**
*
*
* Test function
*
* @param first Some
* @param second Other
*/
fun <caret>testFun(first: String, second: Int) = 12
//INFO: <pre><b>public</b> <b>fun</b> testFun(first: String, second: Int): Int <i>defined in</i> test <i>in file</i> OnFunctionDeclarationWithPackage.kt</pre><p>Test function</p>
//INFO: <dl><dt><b>Parameters:</b></dt><dd><code>first</code> - Some</dd><dd><code>second</code> - Other</dd></dl>
@@ -0,0 +1,17 @@
open class C() {
/**
* This method returns zero.
*/
open fun foo(): Int = 0
}
class D(): C() {
override fun foo(): Int = 1
}
fun test() {
D().f<caret>oo()
}
//INFO: <pre><b>public</b> <b>open</b> <b>fun</b> foo(): Int <i>defined in</i> D</pre><p>This method returns zero.</p>
@@ -0,0 +1,17 @@
open class C() {
/**
* This property returns zero.
*/
open val foo: Int get() = 0
}
class D(): C() {
override val foo: Int get() = 1
}
fun test() {
D().f<caret>oo
}
//INFO: <pre><b>public</b> <b>open</b> <b>val</b> foo: Int <i>defined in</i> D</pre><p>This property returns zero.</p>
+16
View File
@@ -0,0 +1,16 @@
/**
Some documentation
* @param a Some int
* @param b String
*/
fun testMethod(a: Int, b: String) {
}
fun test() {
<caret>testMethod(1, "value")
}
//INFO: <pre><b>public</b> <b>fun</b> testMethod(a: Int, b: String): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsage.kt</pre><p>Some documentation</p>
//INFO: <dl><dt><b>Parameters:</b></dt><dd><code>a</code> - Some int</dd><dd><code>b</code> - String</dd></dl>
@@ -0,0 +1,13 @@
/**
* Some documentation
* on two lines.
*/
fun testMethod() {
}
fun test() {
<caret>testMethod()
}
//INFO: <pre><b>public</b> <b>fun</b> testMethod(): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsageMultiline.kt</pre><p>Some documentation on two lines.</p>
@@ -0,0 +1,16 @@
/**
Some documentation
* @param[a] Some int
* @param[b] String
*/
fun testMethod(a: Int, b: String) {
}
fun test() {
<caret>testMethod(1, "value")
}
//INFO: <pre><b>public</b> <b>fun</b> testMethod(a: Int, b: String): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsageWithBracketsInParam.kt</pre><p>Some documentation</p>
//INFO: <dl><dt><b>Parameters:</b></dt><dd><code>a</code> - Some int</dd><dd><code>b</code> - String</dd></dl>
@@ -0,0 +1,35 @@
/**
* Some documentation.
*
* ```
* Code block
* Second line
*
* Third line
* ```
*
* Text between code blocks.
* ```
* ```
* Text after code block.
*/
fun testMethod() {
}
class C {
}
fun test() {
<caret>testMethod(1, "value")
}
//INFO: <pre><b>public</b> <b>fun</b> testMethod(): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsageWithCodeBlock.kt</pre><p>Some documentation.</p>
//INFO: <pre><code>
//INFO: Code block
//INFO: Second line
//INFO:
//INFO: Third line
//INFO: </code></pre><p>Text between code blocks.</p>
//INFO: <pre><code>
//INFO: </code></pre><p>Text after code block.</p>
@@ -0,0 +1,36 @@
/**
* Some documentation. **Bold** *underline* `code` foo: bar (baz) [quux] <xyzzy> 'apos'
*
* [Kotlin](http://www.kotlinlang.org)
* [a**b**__d__ kas ](http://www.ibm.com)
*
* [C]
*
* [See **this** class][C]
*
* This is _emphasized text_ but text_with_underscores has to preserve the underscores.
* Single stars embedded in a word like Embedded*Star have to be preserved as well.
*
* Exclamation marks are also important! Also in `code blocks!`
*
* bt+ : ``prefix ` postfix``
* backslash: `\`
*/
fun testMethod() {
}
class C {
}
fun test() {
<caret>testMethod(1, "value")
}
//INFO: <pre><b>public</b> <b>fun</b> testMethod(): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsageWithMarkdown.kt</pre><p>Some documentation. <strong>Bold</strong> <em>underline</em> <code>code</code> foo: bar (baz) <a href="psi_element://quux">quux</a> 'apos'</p>
//INFO: <p><a href="http://www.kotlinlang.org">Kotlin</a> <a href="http://www.ibm.com">a<strong>b</strong><strong>d</strong> kas</a></p>
//INFO: <p><a href="psi_element://C">C</a></p>
//INFO: <p><a href="psi_element://C">See <strong>this</strong> class</a></p>
//INFO: <p>This is <em>emphasized text</em> but text_with_underscores has to preserve the underscores. Single stars embedded in a word like Embedded*Star have to be preserved as well.</p>
//INFO: <p>Exclamation marks are also important! Also in <code>code blocks!</code></p>
//INFO: <p>bt+ : <code>prefix ` postfix</code> backslash: <code>\</code></p>
@@ -0,0 +1,16 @@
/**
* Some documentation
* on two lines.
*
* @param test String
* on two lines
*/
fun testMethod(test: String) {
}
fun test() {
<caret>testMethod("")
}
//INFO: <pre><b>public</b> <b>fun</b> testMethod(test: String): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsageWithMultilineParam.kt</pre><p>Some documentation on two lines.</p>
//INFO: <dl><dt><b>Parameters:</b></dt><dd><code>test</code> - String on two lines</dd></dl>
@@ -0,0 +1,19 @@
/**
Some documentation
* @receiver Some int
* @param b String
* @return Return [a] and nothing else
*/
fun Int.testMethod(b: String) {
}
fun test() {
1.<caret>testMethod("value")
}
//INFO: <pre><b>public</b> <b>fun</b> Int.testMethod(b: String): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsageWithReceiver.kt</pre><p>Some documentation</p>
//INFO: <dl><dt><b>Receiver:</b></dt><dd>Some int</dd></dl>
//INFO: <dl><dt><b>Parameters:</b></dt><dd><code>b</code> - String</dd></dl>
//INFO: <dl><dt><b>Returns:</b></dt><dd>Return <a href="psi_element://a">a</a> and nothing else</dd></dl>
@@ -0,0 +1,18 @@
/**
Some documentation
* @param a Some int
* @param b String
* @return Return [a] and nothing else
*/
fun testMethod(a: Int, b: String) {
}
fun test() {
<caret>testMethod(1, "value")
}
//INFO: <pre><b>public</b> <b>fun</b> testMethod(a: Int, b: String): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsageWithReturnAndLink.kt</pre><p>Some documentation</p>
//INFO: <dl><dt><b>Parameters:</b></dt><dd><code>a</code> - Some int</dd><dd><code>b</code> - String</dd></dl>
//INFO: <dl><dt><b>Returns:</b></dt><dd>Return <a href="psi_element://a">a</a> and nothing else</dd></dl>
@@ -0,0 +1,20 @@
/**
Some documentation
* @param a Some int
* @param b String
* @return Return value
* @throws IllegalArgumentException if the weather is bad
*/
fun testMethod(a: Int, b: String) {
}
fun test() {
<caret>testMethod(1, "value")
}
//INFO: <pre><b>public</b> <b>fun</b> testMethod(a: Int, b: String): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsageWithReturnAndThrows.kt</pre><p>Some documentation</p>
//INFO: <dl><dt><b>Parameters:</b></dt><dd><code>a</code> - Some int</dd><dd><code>b</code> - String</dd></dl>
//INFO: <dl><dt><b>Returns:</b></dt><dd>Return value</dd></dl>
//INFO: <dl><dt><b>Throws:</b></dt><dd><code>IllegalArgumentException</code> - if the weather is bad</dd></dl>
@@ -0,0 +1,21 @@
/**
* @see C
* @see D
* @see <a href="http://kotl.in">kotlin</a>
*/
fun testMethod() {
}
class C {
}
class D {
}
fun test() {
<caret>testMethod(1, "value")
}
//INFO: <pre><b>public</b> <b>fun</b> testMethod(): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsageWithSee.kt</pre><br/>
//INFO: <DD><DL><DT><b>See Also:</b><DD><a href="psi_element://C"><code>C</code></a>, <a href="psi_element://D"><code>D</code></a>, <a href="http://kotl.in">kotlin</a></DD></DL></DD>
@@ -0,0 +1,17 @@
/**
Some documentation
* @param T the type parameter
* @param a Some int
* @param b String
*/
fun <T> testMethod(a: Int, b: String) {
}
fun test() {
<caret>testMethod(1, "value")
}
//INFO: <pre><b>public</b> <b>fun</b> &lt;T&gt; testMethod(a: Int, b: String): Unit <i>defined in</i> root package <i>in file</i> OnMethodUsageWithTypeParameter.kt</pre><p>Some documentation</p>
//INFO: <dl><dt><b>Parameters:</b></dt><dd><code>T</code> - the type parameter</dd><dd><code>a</code> - Some int</dd><dd><code>b</code> - String</dd></dl>
+28
View File
@@ -0,0 +1,28 @@
package magic
object Samples {
fun sampleMagic() {
castTextSpell("[asd] [dse] [asz]")
}
}
fun sampleScroll() {
val reader = Scroll("[asd] [dse] [asz]").reader()
castTextSpell(reader.readAll())
}
/**
* @sample Samples.sampleMagic
* @sample sampleScroll
*/
fun <caret>castTextSpell(spell: String) {
throw SecurityException("Magic prohibited outside Hogwarts")
}
//INFO: <pre><b>public</b> <b>fun</b> castTextSpell(spell: String): Unit <i>defined in</i> magic <i>in file</i> Samples.kt</pre><br/>
//INFO: <dl><dt><b>Samples:</b></dt><dd><a href="psi_element://Samples.sampleMagic"><code>Samples.sampleMagic</code></a><pre><code>
//INFO: castTextSpell("[asd] [dse] [asz]")
//INFO: </code></pre></dd><dd><a href="psi_element://sampleScroll"><code>sampleScroll</code></a><pre><code>
//INFO: val reader = Scroll("[asd] [dse] [asz]").reader()
//INFO: castTextSpell(reader.readAll())
//INFO: </code></pre></dd></dl>
@@ -0,0 +1,11 @@
package server
import some.TopLevelMethodFromJava_DataKt
class Testing {
void test() {
TopLevelMethodFromJava_DataKt.<caret>foo(12);
}
}
//INFO: <pre><b>public</b> <b>fun</b> foo(bar: Int): Unit <i>defined in</i> some <i>in file</i> TopLevelMethodFromJava_Data.kt</pre><p>KDoc foo</p>
@@ -0,0 +1,11 @@
class A {
}
fun foo(x : A) { }
fun main(args: Array<String>) {
<caret>foo()
}
//INFO: <pre><b>public</b> <b>fun</b> foo(x: <a href="psi_element://A">A</a>): Unit <i>defined in</i> root package <i>in file</i> TypeNamesFromStdLibNavigation.kt</pre>