KT-12852 Support breadcrumbs for Kotlin

#KT-12852 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-09-08 00:28:56 +03:00
parent dae4521c68
commit fcce1e3838
32 changed files with 992 additions and 4 deletions
@@ -0,0 +1,13 @@
val v = foo(object : java.lang.Runnable {
val v2 = object : A, B {
fun f() {
object : java.io.Serializable, XXX {
var o = object {
override fun equals(other: Any?): Boolean {
<caret>
}
}
}
}
}
})
@@ -0,0 +1,20 @@
Crumbs:
val v
object : …ava.lang.Runnable
val v2
object : A,…
f()
object : …a.io.Serializable,…
var o
object
equals()
Tooltips:
property <b><code>v</code></b>
object : java.lang.Runnable
property <b><code>v.&lt;no name provided&gt;.v2</code></b>
object : A, B
function <b><code>v.&lt;no name provided&gt;.v2.&lt;no name provided&gt;.f()</code></b>
object : java.io.Serializable, XXX
property <b><code>v.&lt;no name provided&gt;.v2.&lt;no name provided&gt;.f.&lt;no name provided&gt;.o</code></b>
object
function <b><code>v.&lt;no name provided&gt;.v2.&lt;no name provided&gt;.f.&lt;no name provided&gt;.o.&lt;no name provided&gt;.equals(Any?)</code></b>
+17
View File
@@ -0,0 +1,17 @@
class Outer {
companion object {
class SomeClass : java.io.Serializable {
companion object CompanionName {
private object SomeObject {
fun String.someFun(p: Int, b: Boolean): String {
fun localFun() {
val v = doIt(fun (x: Int, y: Char) {
<caret>
})
}
}
}
}
}
}
}
+18
View File
@@ -0,0 +1,18 @@
Crumbs:
Outer
companion object
SomeClass
companion object CompanionName
SomeObject
someFun()
localFun()
fun(x, y)
Tooltips:
class <b><code>Outer</code></b>
companion object <b><code>Outer.Companion</code></b>
class <b><code>Outer.Companion.SomeClass</code></b>
companion object <b><code>Outer.Companion.SomeClass.CompanionName</code></b>
object <b><code>Outer.Companion.SomeClass.CompanionName.SomeObject</code></b>
function <b><code>Outer.Companion.SomeClass.CompanionName.SomeObject.someFun(Int, Boolean) on String</code></b>
function <b><code>Outer.Companion.SomeClass.CompanionName.SomeObject.someFun.localFun()</code></b>
fun(x: Int, y: Char)
+9
View File
@@ -0,0 +1,9 @@
fun foo() {
for (i in 1..10) {
for (j: Int in collection.filter(predicate)) {
for ((x, y) in entries) {
<caret>
}
}
}
}
+10
View File
@@ -0,0 +1,10 @@
Crumbs:
foo()
for(i in 1..10)
for(j in collection…)
for((x, y) in entri…)
Tooltips:
function <b><code>foo()</code></b>
for(i in 1..10)
for(j in collection.filter(predicate))
for((x, y) in entries)
+34
View File
@@ -0,0 +1,34 @@
fun foo() {
if (x) {
if (x.y) {
if (y) {
}
else {
if (a) {
}
else if (b) {
}
else if (c) {
if (q) {
}
else if (qq) {
}
else if (qqq) {
}
else {
if (p) <caret>return
}
}
else {
}
}
}
}
}
+16
View File
@@ -0,0 +1,16 @@
Crumbs:
foo()
if (x)
if (x.y)
if (y) … else
if … else if (c)
if … else
if (p)
Tooltips:
function <b><code>foo()</code></b>
if (x)
if (x.y)
else (of 'if (y)')
if … else if (c)
else (of 'if … else if (qqq)')
if (p)
@@ -0,0 +1,14 @@
fun foo() {
OuterLoop@
for (i in 1..10) {
for (j in 1..10) {
Label1@ Label2@
while(true) {
DoWhile@
do {
<caret>
} while (x)
}
}
}
}
@@ -0,0 +1,12 @@
Crumbs:
foo()
OuterLoop@ for(i in 1..10)
for(j in 1..10)
Label1@ Label2@ while (true)
DoWhile@ do … while (x)
Tooltips:
function <b><code>foo()</code></b>
OuterLoop@ for(i in 1..10)
for(j in 1..10)
Label1@ Label2@ while (true)
DoWhile@ do … while (x)
+17
View File
@@ -0,0 +1,17 @@
fun foo() {
buildString {
with(xxx) {
with(f()) Label@ {
g()?.let Label1@ {
listOf(1, 2, 3, 4, 5).filterTo(collection) { item ->
doIt() {
val v = Label2@ { p: Int ->
x(1, Label3@ { Something().apply { <caret> } })
}
}
}
}
}
}
}
}
+22
View File
@@ -0,0 +1,22 @@
Crumbs:
foo()
buildString{…}
with(xxx) {…}
with(f()) Label@ {…}
g()?.let Label1@ {…}
….filterTo(collection) {…}
doIt() {…}
val v = Label2@ {…}
Label3@ {…}
Something().apply{…}
Tooltips:
function <b><code>foo()</code></b>
lambda <b><code>foo.&lt;anonymous&gt;() on StringBuilder</code></b>
lambda <b><code>foo.&lt;anonymous&gt;.&lt;anonymous&gt;() on ???</code></b>
lambda <b><code>foo.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;()</code></b>
lambda <b><code>foo.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;()</code></b>
lambda <b><code>foo.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;(???)</code></b>
lambda <b><code>foo.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;()</code></b>
lambda <b><code>foo.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;(Int)</code></b>
lambda <b><code>foo.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;()</code></b>
lambda <b><code>foo.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;.&lt;anonymous&gt;()</code></b>
@@ -0,0 +1,5 @@
fun foo() {
if (<caret>x) {
}
}
@@ -0,0 +1,4 @@
Crumbs:
foo()
Tooltips:
function <b><code>foo()</code></b>
@@ -0,0 +1,7 @@
fun foo() {
when (x) {
is <caret>Foo -> {
}
}
}
@@ -0,0 +1,6 @@
Crumbs:
foo()
when (x)
Tooltips:
function <b><code>foo()</code></b>
when (x)
@@ -0,0 +1,5 @@
var Int.prop: String
get() = TODO()
set(value) {
<caret>
}
@@ -0,0 +1,4 @@
Crumbs:
prop.set
Tooltips:
setter for property <b><code>prop</code></b>
+18
View File
@@ -0,0 +1,18 @@
fun foo() {
try {
try {
}
finally {
try {
}
catch (e: RuntimeException) {
<caret>
}
}
}
catch(e: Exception) {
}
}
+10
View File
@@ -0,0 +1,10 @@
Crumbs:
foo()
try
finally
catch (RuntimeException)
Tooltips:
function <b><code>foo()</code></b>
try
finally
catch (RuntimeException)
+39
View File
@@ -0,0 +1,39 @@
fun foo() {
when {
else -> {
when (x) {
x.isSomethingLong() -> {
when (y) {
y.isSomething() -> {
when (z) {
is VeryVeryVeryVeryLongName -> {
when (xxx) {
SomeEnum.SomeLongValue -> {
when (yyy) {
!in Int.MIN_VALUE..Int.MAX_VALUE -> {
when (zzz) {
is A, is B -> {
when (x1) {
A.VeryVeryVeryLongName, A.ShortName -> {
when (y1) {
is VeryVeryVeryVeryLongClassName, is ShortName -> {
<caret>
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
+40
View File
@@ -0,0 +1,40 @@
Crumbs:
foo()
when
else ->
when (x)
…isSomethingLong() ->
when (y)
y.isSomething() ->
when (z)
is VeryVeryVeryVer… ->
when (xxx)
…num.SomeLongValue ->
when (yyy)
in Int.MIN_VALUE..… ->
when (zzz)
is A,… ->
when (x1)
…yVeryVeryLongName,… ->
when (y1)
is VeryVeryVeryVer… ->
Tooltips:
function <b><code>foo()</code></b>
when
else ->
when (x)
x.isSomethingLong() ->
when (y)
y.isSomething() ->
when (z)
is VeryVeryVeryVeryLongName ->
when (xxx)
SomeEnum.SomeLongValue ->
when (yyy)
in Int.MIN_VALUE..Int.MAX_VALUE ->
when (zzz)
is A,… ->
when (x1)
A.VeryVeryVeryLongName,… ->
when (y1)
is VeryVeryVeryVeryLongClassName,… ->
+11
View File
@@ -0,0 +1,11 @@
fun foo() {
while (true) {
while (p) {
while (x > 0) {
do {
<caret>
} while (true)
}
}
}
}
+12
View File
@@ -0,0 +1,12 @@
Crumbs:
foo()
while (true)
while (p)
while (x > 0)
do … while (true)
Tooltips:
function <b><code>foo()</code></b>
while (true)
while (p)
while (x > 0)
do … while (true)