Add some additional information to psi renderer

1) Trim unused spaces in annotations
2) Rewrote fq name rendering
3) Added annotations to for loop variable
4) Added type arguments render along to type parameters in functions
This commit is contained in:
Ivan Cilcic
2019-08-23 11:46:53 +03:00
committed by Mikhail Glukhikh
parent 8fb2383845
commit fe328f8c7a
36 changed files with 284 additions and 223 deletions
@@ -13,7 +13,7 @@ class B {
}
fun foo(a: Int, b: Int): Int {
// fun <T, R> with(A, A.() -> Int): Int
// fun <T, R> with<A, Int>(A, A.() -> Int): Int
// │ constructor A()
// │ │ with@0
// │ │ │
@@ -23,7 +23,7 @@ fun foo(a: Int, b: Int): Int {
// │
aProp
// fun <T, R> with(B, B.() -> Int): Int
// fun <T, R> with<B, Int>(B, B.() -> Int): Int
// │ constructor B()
// │ │ with@1
// │ │ │
@@ -43,7 +43,7 @@ fun foo(a: Int, b: Int): Int {
}
}
// fun <T, R> with(A, A.() -> Int): Int
// fun <T, R> with<A, Int>(A, A.() -> Int): Int
// │ constructor A()
// │ │ with@0
// │ │ │
@@ -53,7 +53,7 @@ fun foo(a: Int, b: Int): Int {
// │
aProp
// fun <T, R> with(B, B.() -> Int): Int
// fun <T, R> with<B, Int>(B, B.() -> Int): Int
// │ constructor B()
// │ │ with@1
// │ │ │
@@ -68,7 +68,7 @@ fun foo(a: Int, b: Int): Int {
bProp
}
// fun <T, R> with(B, B.() -> Int): Int
// fun <T, R> with<B, Int>(B, B.() -> Int): Int
// │ constructor B()
// │ │ with@1
// │ │ │
@@ -1,7 +1,7 @@
package org.jetbrains.kotlin.test
// collections/List<Int>
// │ fun <T> collections/listOf(vararg Int): collections/List<Int>
// │ fun <T> collections/listOf<Int>(vararg Int): collections/List<Int>
// │ │ Int
// │ │ │ Int
// │ │ │ │ Int
@@ -9,7 +9,7 @@ package org.jetbrains.kotlin.test
val listOfInt = listOf(1, 2, 3)
// java/util/ArrayList<Int>
// │ package java
// │ │ constructor util/ArrayList<E : Any!>()
// │ │ constructor java/util/ArrayList<E : Any!>()
// │ │ │
val javaList = java.util.ArrayList<Int>()
@@ -17,8 +17,8 @@ val javaList = java.util.ArrayList<Int>()
// │ package java/util
// │ │
fun move(): java.util.ArrayList<Int> {
// val listOfInt: collections/List<Int>
//
// Int val listOfInt: collections/List<Int>
//
for (elem in listOfInt) {
// val javaList: java/util/ArrayList<Int>
// │ fun (java/util/ArrayList<Int>).add(Int): Boolean
@@ -45,8 +45,8 @@ var withSetter
// val p4: String
// │
get() = p4
// <set-withSetter>.value: String
//
// String <set-withSetter>.value: String
//
set(value) = value
// Boolean
@@ -62,6 +62,8 @@ val withGetter2: Boolean
// │
var withSetter2: String
get() = "1"
// String
// │
set(value) {
// var <set-withSetter2>.field: String
// │ <set-withSetter2>.value: String
@@ -4,11 +4,11 @@ fun <T> copyWhenGreater(list: List<T>, threshold: T): List<String>
where T : CharSequence,
T : Comparable<T> {
// copyWhenGreater.list: collections/List<T>
// │ fun <T> collections/Iterable<T>.filter((T) -> Boolean): collections/List<T>
// │ fun <T> collections/Iterable<T>.filter<T>((T) -> Boolean): collections/List<T>
// │ │ copyWhenGreater.<anonymous>.it: T
// │ │ │ fun (Comparable<T>).compareTo(T): Int
// │ │ │ │ copyWhenGreater.threshold: T
// │ │ │ │ │ fun <T, R> collections/Iterable<T>.map((T) -> String): collections/List<String>
// │ │ │ │ │ fun <T, R> collections/Iterable<T>.map<T, String>((T) -> String): collections/List<String>
// │ │ │ │ │ │ copyWhenGreater.<anonymous>.it: T
// │ │ │ │ │ │ │ fun (Any).toString(): String
// │ │ │ │ │ │ │ │
@@ -17,11 +17,11 @@ fun <T> copyWhenGreater(list: List<T>, threshold: T): List<String>
fun main() {
// collections/List<String>
// │ fun <T> collections/listOf(vararg String): collections/List<String>
// │ fun <T> collections/listOf<String>(vararg String): collections/List<String>
// │ │
val list = listOf("1", "2", "3")
// collections/List<String>
// │ fun <T : CharSequence> copyWhenGreater(collections/List<String>, String): collections/List<String> where copyWhenGreater.T : Comparable<String>
// │ fun <T : CharSequence> copyWhenGreater<String>(collections/List<String>, String): collections/List<String> where T : Comparable<String>
// │ │ val main.list: collections/List<String>
// │ │ │
val copy = copyWhenGreater(list, "2")