Skip to content

Commit

Permalink
Slicer tree view: better highlighting range inside nodes and in the e…
Browse files Browse the repository at this point in the history
…ditor
  • Loading branch information
valentinkip committed Apr 17, 2020
1 parent 64fec54 commit 91a793d
Show file tree
Hide file tree
Showing 252 changed files with 696 additions and 644 deletions.
102 changes: 86 additions & 16 deletions idea/src/org/jetbrains/kotlin/idea/slicer/KotlinSliceUsage.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,29 @@

package org.jetbrains.kotlin.idea.slicer

import com.intellij.ide.SelectInEditorManager
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.fileEditor.OpenFileDescriptor
import com.intellij.openapi.util.ProperTextRange
import com.intellij.openapi.util.Segment
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import com.intellij.slicer.SliceAnalysisParams
import com.intellij.slicer.SliceUsage
import com.intellij.usageView.UsageInfo
import org.jetbrains.kotlin.idea.findUsages.handlers.SliceUsageProcessor
import org.jetbrains.kotlin.psi.KtElement
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject
import org.jetbrains.kotlin.psi.psiUtil.endOffset
import org.jetbrains.kotlin.psi.psiUtil.startOffset

open class KotlinSliceUsage : SliceUsage {

val mode: KotlinSliceAnalysisMode
val forcedExpressionMode: Boolean

private var usageInfo: UsageInfo? = null
private var usageInfo: AdaptedUsageInfo? = null

constructor(
element: PsiElement,
Expand All @@ -47,25 +57,37 @@ open class KotlinSliceUsage : SliceUsage {
initializeUsageInfo()
}

//TODO: it's all hacks due to UsageInfo stored in the base class - fix it in IDEA
private fun initializeUsageInfo() {
val originalInfo = getUsageInfo()
if (mode != KotlinSliceAnalysisMode.Default) {
val element = originalInfo.element
if (element != null) {
usageInfo = UsageInfoWrapper(element, mode)
} else {
usageInfo = null
}
} else {
usageInfo = originalInfo
}
usageInfo = getUsageInfo().element?.let { AdaptedUsageInfo(it, mode) }
}

// we have to replace UsageInfo with another one whose equality takes into account mode
override fun getUsageInfo(): UsageInfo {
return usageInfo ?: super.getUsageInfo()
}

override fun getMergedInfos(): Array<UsageInfo> {
return arrayOf(getUsageInfo())
}

override fun openTextEditor(focus: Boolean): Editor? {
val project = getUsageInfo().project
val descriptor = OpenFileDescriptor(project, file, getUsageInfo().navigationOffset)
return FileEditorManager.getInstance(project).openTextEditor(descriptor, focus)
}

override fun highlightInEditor() {
if (!isValid) return

val usageInfo = getUsageInfo()
val range = usageInfo.navigationRange ?: return
SelectInEditorManager.getInstance(getUsageInfo().project).selectInEditor(file, range.startOffset, range.endOffset, false, false)

if (usageInfo.navigationOffset != range.startOffset) {
openTextEditor(false) // to position the caret at the identifier
}
}

override fun copy(): KotlinSliceUsage {
val element = getUsageInfo().element!!
return if (parent == null)
Expand Down Expand Up @@ -97,9 +119,57 @@ open class KotlinSliceUsage : SliceUsage {
}

@Suppress("EqualsOrHashCode")
private class UsageInfoWrapper(element: PsiElement, private val mode: KotlinSliceAnalysisMode) : UsageInfo(element) {
private class AdaptedUsageInfo(element: PsiElement, private val mode: KotlinSliceAnalysisMode) : UsageInfo(element) {
override fun equals(other: Any?): Boolean {
return other is UsageInfoWrapper && super.equals(other) && mode == other.mode
return other is AdaptedUsageInfo && super.equals(other) && mode == other.mode
}

override fun getNavigationRange(): Segment? {
val element = element ?: return null
return when (element) {
is KtParameter -> {
val nameRange = element.nameIdentifier?.textRange ?: return super.getNavigationRange()
val start = element.valOrVarKeyword?.startOffset ?: nameRange.startOffset
val end = element.typeReference?.endOffset ?: nameRange.endOffset
TextRange(start, end)
}

is KtVariableDeclaration -> {
val nameRange = element.nameIdentifier?.textRange ?: return super.getNavigationRange()
val start = element.valOrVarKeyword?.startOffset ?: nameRange.startOffset
val end = element.typeReference?.endOffset ?: nameRange.endOffset
TextRange(start, end)
}

is KtNamedFunction -> {
val funKeyword = element.funKeyword
val parameterList = element.valueParameterList
val typeReference = element.typeReference
if (funKeyword != null && parameterList != null)
TextRange(funKeyword.startOffset, typeReference?.endOffset ?: parameterList.endOffset)
else
null
}

is KtPrimaryConstructor -> {
element.containingClassOrObject?.nameIdentifier
?.let { TextRange(it.startOffset, element.endOffset) }
}

else -> null
} ?: TextRange(element.textOffset, element.endOffset)
}

override fun getRangeInElement(): ProperTextRange? {
val elementRange = element?.textRange ?: return null
return navigationRange
?.takeIf { it in elementRange }
?.let { ProperTextRange(it.startOffset, it.endOffset).shiftRight(-elementRange.startOffset) }
?: super.getRangeInElement()
}

override fun getNavigationOffset(): Int {
return element?.textOffset ?: -1
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
4 return f(<bold>1</bold>) (in foo((Int) -> Int))
8 val <bold>x = foo(fun(n: Int) = n)</bold> (in test())
8 <bold>val x</bold> = foo(fun(n: Int) = n) (in test())
8 val x = <bold>foo(fun(n: Int) = n)</bold> (in test())
3 fun <bold>foo(f: (Int) -> Int): Int {</bold>
3 <bold>fun foo(f: (Int) -> Int): Int</bold> {
4 return <bold>f(1)</bold> (in foo((Int) -> Int))
4 [LAMBDA IN] return <bold>f</bold>(1) (in foo((Int) -> Int))
3 [LAMBDA IN] fun foo(<bold>f: (Int) -> Int</bold>): Int { (in foo((Int) -> Int))
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int) = n</bold>) (in test())
8 val x = foo(<bold>fun(n: Int) = n</bold>) (in test())
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int)</bold> = n) (in test())
8 val x = foo(<bold>fun(n: Int)</bold> = n) (in test())
8 val x = foo(fun(n: Int) = <bold>n</bold>) (in test())
8 val x = foo(fun(<bold>n: Int</bold>) = n) (in test())
8 [LAMBDA CALLS ARGUMENT #0] val x = foo(<bold>fun(n: Int) = n</bold>) (in test())
8 [LAMBDA CALLS ARGUMENT #0] val x = foo(<bold>fun(n: Int)</bold> = n) (in test())
3 [LAMBDA CALLS ARGUMENT #0] fun foo(<bold>f: (Int) -> Int</bold>): Int { (in foo((Int) -> Int))
4 return f(<bold>1</bold>) (in foo((Int) -> Int))
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[NotNull Values]
8 val <bold>x = foo(fun(n: Int) = n)</bold> (in test())
8 val <bold>x = foo(fun(n: Int) = n)</bold> (in test())
8 <bold>val x</bold> = foo(fun(n: Int) = n) (in test())
8 <bold>val x</bold> = foo(fun(n: Int) = n) (in test())
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
8 val <bold>x = foo(fun(n: Int) = n)</bold> (in test())
8 <bold>val x</bold> = foo(fun(n: Int) = n) (in test())
8 val x = <bold>foo(fun(n: Int) = n)</bold> (in test())
3 fun <bold>foo(f: (Int) -> Int): Int {</bold>
3 <bold>fun foo(f: (Int) -> Int): Int</bold> {
4 return <bold>f(1)</bold> (in foo((Int) -> Int))
4 [LAMBDA IN] return <bold>f</bold>(1) (in foo((Int) -> Int))
3 [LAMBDA IN] fun foo(<bold>f: (Int) -> Int</bold>): Int { (in foo((Int) -> Int))
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int) = n</bold>) (in test())
8 val x = foo(<bold>fun(n: Int) = n</bold>) (in test())
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int)</bold> = n) (in test())
8 val x = foo(<bold>fun(n: Int)</bold> = n) (in test())
8 val x = foo(fun(n: Int) = <bold>n</bold>) (in test())
8 val x = foo(fun(<bold>n: Int</bold>) = n) (in test())
8 [LAMBDA CALLS ARGUMENT #0] val x = foo(<bold>fun(n: Int) = n</bold>) (in test())
8 [LAMBDA CALLS ARGUMENT #0] val x = foo(<bold>fun(n: Int)</bold> = n) (in test())
3 [LAMBDA CALLS ARGUMENT #0] fun foo(<bold>f: (Int) -> Int</bold>): Int { (in foo((Int) -> Int))
4 return f(<bold>1</bold>) (in foo((Int) -> Int))
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
4 return f(<bold>1</bold>) (in foo((Int) -> Int))
8 val <bold>x = foo(fun(n: Int): Int { return n })</bold> (in test())
8 <bold>val x</bold> = foo(fun(n: Int): Int { return n }) (in test())
8 val x = <bold>foo(fun(n: Int): Int { return n })</bold> (in test())
3 fun <bold>foo(f: (Int) -> Int): Int {</bold>
3 <bold>fun foo(f: (Int) -> Int): Int</bold> {
4 return <bold>f(1)</bold> (in foo((Int) -> Int))
4 [LAMBDA IN] return <bold>f</bold>(1) (in foo((Int) -> Int))
3 [LAMBDA IN] fun foo(<bold>f: (Int) -> Int</bold>): Int { (in foo((Int) -> Int))
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int): Int { return n }</bold>) (in test())
8 val x = foo(<bold>fun(n: Int): Int { return n }</bold>) (in test())
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int): Int</bold> { return n }) (in test())
8 val x = foo(<bold>fun(n: Int): Int</bold> { return n }) (in test())
8 val x = foo(fun(n: Int): Int { return <bold>n</bold> }) (in test())
8 val x = foo(fun(<bold>n: Int</bold>): Int { return n }) (in test())
8 [LAMBDA CALLS ARGUMENT #0] val x = foo(<bold>fun(n: Int): Int { return n }</bold>) (in test())
8 [LAMBDA CALLS ARGUMENT #0] val x = foo(<bold>fun(n: Int): Int</bold> { return n }) (in test())
3 [LAMBDA CALLS ARGUMENT #0] fun foo(<bold>f: (Int) -> Int</bold>): Int { (in foo((Int) -> Int))
4 return f(<bold>1</bold>) (in foo((Int) -> Int))
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[NotNull Values]
8 val <bold>x = foo(fun(n: Int): Int { return n })</bold> (in test())
8 val <bold>x = foo(fun(n: Int): Int { return n })</bold> (in test())
8 <bold>val x</bold> = foo(fun(n: Int): Int { return n }) (in test())
8 <bold>val x</bold> = foo(fun(n: Int): Int { return n }) (in test())
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
8 val <bold>x = foo(fun(n: Int): Int { return n })</bold> (in test())
8 <bold>val x</bold> = foo(fun(n: Int): Int { return n }) (in test())
8 val x = <bold>foo(fun(n: Int): Int { return n })</bold> (in test())
3 fun <bold>foo(f: (Int) -> Int): Int {</bold>
3 <bold>fun foo(f: (Int) -> Int): Int</bold> {
4 return <bold>f(1)</bold> (in foo((Int) -> Int))
4 [LAMBDA IN] return <bold>f</bold>(1) (in foo((Int) -> Int))
3 [LAMBDA IN] fun foo(<bold>f: (Int) -> Int</bold>): Int { (in foo((Int) -> Int))
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int): Int { return n }</bold>) (in test())
8 val x = foo(<bold>fun(n: Int): Int { return n }</bold>) (in test())
8 [LAMBDA IN] val x = foo(<bold>fun(n: Int): Int</bold> { return n }) (in test())
8 val x = foo(<bold>fun(n: Int): Int</bold> { return n }) (in test())
8 val x = foo(fun(n: Int): Int { return <bold>n</bold> }) (in test())
8 val x = foo(fun(<bold>n: Int</bold>): Int { return n }) (in test())
8 [LAMBDA CALLS ARGUMENT #0] val x = foo(<bold>fun(n: Int): Int { return n }</bold>) (in test())
8 [LAMBDA CALLS ARGUMENT #0] val x = foo(<bold>fun(n: Int): Int</bold> { return n }) (in test())
3 [LAMBDA CALLS ARGUMENT #0] fun foo(<bold>f: (Int) -> Int</bold>): Int { (in foo((Int) -> Int))
4 return f(<bold>1</bold>) (in foo((Int) -> Int))
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
4 f(<bold>1</bold>) (in foo((Int) -> Unit))
9 val <bold>v = value</bold> (in test())
9 <bold>val v</bold> = value (in test())
9 val v = <bold>value</bold> (in test())
8 foo(fun(<bold>value: Int</bold>) { (in test())
8 [LAMBDA CALLS ARGUMENT #0] foo(<bold>fun(value: Int) {</bold> (in test())
8 [LAMBDA CALLS ARGUMENT #0] foo(<bold>fun(value: Int)</bold> { (in test())
3 [LAMBDA CALLS ARGUMENT #0] fun foo(<bold>f: (Int) -> Unit</bold>) { (in foo((Int) -> Unit))
4 f(<bold>1</bold>) (in foo((Int) -> Unit))
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[NotNull Values]
9 val <bold>v = value</bold> (in test())
9 val <bold>v = value</bold> (in test())
9 <bold>val v</bold> = value (in test())
9 <bold>val v</bold> = value (in test())
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
9 val <bold>v = value</bold> (in test())
9 <bold>val v</bold> = value (in test())
9 val v = <bold>value</bold> (in test())
8 foo(fun(<bold>value: Int</bold>) { (in test())
8 [LAMBDA CALLS ARGUMENT #0] foo(<bold>fun(value: Int) {</bold> (in test())
8 [LAMBDA CALLS ARGUMENT #0] foo(<bold>fun(value: Int)</bold> { (in test())
3 [LAMBDA CALLS ARGUMENT #0] fun foo(<bold>f: (Int) -> Unit</bold>) { (in foo((Int) -> Unit))
4 f(<bold>1</bold>) (in foo((Int) -> Unit))
2 changes: 1 addition & 1 deletion idea/testData/slicer/inflow/cast.leafGroups.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
3 fun test(<bold>o: Any</bold>) { (in test(Any))
4 val <bold>x = o as String</bold> (in test(Any))
4 <bold>val x</bold> = o as String (in test(Any))
4 val x = <bold>o as String</bold> (in test(Any))
4 val x = <bold>o</bold> as String (in test(Any))
3 fun test(<bold>o: Any</bold>) { (in test(Any))
4 changes: 2 additions & 2 deletions idea/testData/slicer/inflow/cast.nullnessGroups.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[NotNull Values]
4 val <bold>x = o as String</bold> (in test(Any))
4 val <bold>x = o as String</bold> (in test(Any))
4 <bold>val x</bold> = o as String (in test(Any))
4 <bold>val x</bold> = o as String (in test(Any))
2 changes: 1 addition & 1 deletion idea/testData/slicer/inflow/cast.results.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
4 val <bold>x = o as String</bold> (in test(Any))
4 <bold>val x</bold> = o as String (in test(Any))
4 val x = <bold>o as String</bold> (in test(Any))
4 val x = <bold>o</bold> as String (in test(Any))
3 fun test(<bold>o: Any</bold>) { (in test(Any))
12 changes: 6 additions & 6 deletions idea/testData/slicer/inflow/compositeAssignments.leafGroups.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
7 <bold>--result</bold> (in assignmentWithSum(Int))
3 fun <bold>assignmentWithSum(n: Int): Int {</bold>
3 <bold>fun assignmentWithSum(n: Int): Int</bold> {
8 return <bold>result</bold> (in assignmentWithSum(Int))
4 var <bold>result = 0</bold> (in assignmentWithSum(Int))
4 <bold>var result</bold> = 0 (in assignmentWithSum(Int))
7 <bold>--result</bold> (in assignmentWithSum(Int))

4 var result = <bold>0</bold> (in assignmentWithSum(Int))
3 fun <bold>assignmentWithSum(n: Int): Int {</bold>
3 <bold>fun assignmentWithSum(n: Int): Int</bold> {
8 return <bold>result</bold> (in assignmentWithSum(Int))
4 var <bold>result = 0</bold> (in assignmentWithSum(Int))
4 <bold>var result</bold> = 0 (in assignmentWithSum(Int))
4 var result = <bold>0</bold> (in assignmentWithSum(Int))

5 <bold>result += n</bold> (in assignmentWithSum(Int))
3 fun <bold>assignmentWithSum(n: Int): Int {</bold>
3 <bold>fun assignmentWithSum(n: Int): Int</bold> {
8 return <bold>result</bold> (in assignmentWithSum(Int))
4 var <bold>result = 0</bold> (in assignmentWithSum(Int))
4 <bold>var result</bold> = 0 (in assignmentWithSum(Int))
5 <bold>result += n</bold> (in assignmentWithSum(Int))
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[NotNull Values]
3 fun <bold>assignmentWithSum(n: Int): Int {</bold>
3 fun <bold>assignmentWithSum(n: Int): Int {</bold>
3 <bold>fun assignmentWithSum(n: Int): Int</bold> {
3 <bold>fun assignmentWithSum(n: Int): Int</bold> {
6 changes: 3 additions & 3 deletions idea/testData/slicer/inflow/compositeAssignments.results.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
3 fun <bold>assignmentWithSum(n: Int): Int {</bold>
3 <bold>fun assignmentWithSum(n: Int): Int</bold> {
8 return <bold>result</bold> (in assignmentWithSum(Int))
4 var <bold>result = 0</bold> (in assignmentWithSum(Int))
4 <bold>var result</bold> = 0 (in assignmentWithSum(Int))
4 var result = <bold>0</bold> (in assignmentWithSum(Int))
5 <bold>result += n</bold> (in assignmentWithSum(Int))
6 <bold>result++</bold> (in assignmentWithSum(Int))
4 DUPLICATE: var <bold>result = 0</bold> (in assignmentWithSum(Int))
4 DUPLICATE: <bold>var result</bold> = 0 (in assignmentWithSum(Int))
7 <bold>--result</bold> (in assignmentWithSum(Int))
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
4 var foo: Int = <bold>0</bold> (in A.foo)
10 val x = <bold>foo</bold> (in A.test())
4 var <bold>foo: Int = 0</bold> (in A)
4 <bold>var foo: Int</bold> = 0 (in A)
4 var foo: Int = <bold>0</bold> (in A.foo)

11 foo = <bold>1</bold> (in A.test())
10 val x = <bold>foo</bold> (in A.test())
4 var <bold>foo: Int = 0</bold> (in A)
4 <bold>var foo: Int</bold> = 0 (in A)
6 field = <bold>if (b) value else 0</bold> (in A.foo.set)
6 field = if (b) <bold>value</bold> else 0 (in A.foo.set)
5 set(<bold>value</bold>) { (in A.foo.set)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
10 val x = <bold>foo</bold> (in A.test())
4 var <bold>foo: Int = 0</bold> (in A)
4 <bold>var foo: Int</bold> = 0 (in A)
4 var foo: Int = <bold>0</bold> (in A.foo)
6 field = <bold>if (b) value else 0</bold> (in A.foo.set)
6 field = if (b) <bold>value</bold> else 0 (in A.foo.set)
Expand Down
6 changes: 3 additions & 3 deletions idea/testData/slicer/inflow/delegateGetter.leafGroups.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
6 operator fun getValue(thisRef: Any?, property: KProperty<*>) = <bold>1</bold> (in D.getValue(Any?, KProperty<*>))
12 val <bold>x = foo</bold> (in test())
12 <bold>val x</bold> = foo (in test())
12 val x = <bold>foo</bold> (in test())
9 val <bold>foo: Int by D</bold>
6 operator fun <bold>getValue(thisRef: Any?, property: KProperty<*>) = 1</bold> (in D)
9 <bold>val foo: Int</bold> by D
6 operator <bold>fun getValue(thisRef: Any?, property: KProperty<*>)</bold> = 1 (in D)
6 operator fun getValue(thisRef: Any?, property: KProperty<*>) = <bold>1</bold> (in D.getValue(Any?, KProperty<*>))
4 changes: 2 additions & 2 deletions idea/testData/slicer/inflow/delegateGetter.nullnessGroups.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[NotNull Values]
12 val <bold>x = foo</bold> (in test())
12 val <bold>x = foo</bold> (in test())
12 <bold>val x</bold> = foo (in test())
12 <bold>val x</bold> = foo (in test())
6 changes: 3 additions & 3 deletions idea/testData/slicer/inflow/delegateGetter.results.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
12 val <bold>x = foo</bold> (in test())
12 <bold>val x</bold> = foo (in test())
12 val x = <bold>foo</bold> (in test())
9 val <bold>foo: Int by D</bold>
6 operator fun <bold>getValue(thisRef: Any?, property: KProperty<*>) = 1</bold> (in D)
9 <bold>val foo: Int</bold> by D
6 operator <bold>fun getValue(thisRef: Any?, property: KProperty<*>)</bold> = 1 (in D)
6 operator fun getValue(thisRef: Any?, property: KProperty<*>) = <bold>1</bold> (in D.getValue(Any?, KProperty<*>))
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
9 return <bold>1</bold>;
7 val <bold>x = foo</bold> (in test())
7 <bold>val x</bold> = foo (in test())
7 val x = <bold>foo</bold> (in test())
4 val <bold>foo: Int by D.INSTANCE</bold>
4 <bold>val foo: Int</bold> by D.INSTANCE
9 return <bold>1</bold>;
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[NotNull Values]
7 val <bold>x = foo</bold> (in test())
7 val <bold>x = foo</bold> (in test())
7 <bold>val x</bold> = foo (in test())
7 <bold>val x</bold> = foo (in test())
4 changes: 2 additions & 2 deletions idea/testData/slicer/inflow/delegateToJavaGetter.results.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
7 val <bold>x = foo</bold> (in test())
7 <bold>val x</bold> = foo (in test())
7 val x = <bold>foo</bold> (in test())
4 val <bold>foo: Int by D.INSTANCE</bold>
4 <bold>val foo: Int</bold> by D.INSTANCE
9 return <bold>1</bold>;
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
4 override fun foo() = <bold>2</bold> (in B.foo())
9 val <bold>y = b.foo()</bold> (in test(A, B,…))
9 <bold>val y</bold> = b.foo() (in test(A, B,…))
9 val y = <bold>b.foo()</bold> (in test(A, B,…))
4 override fun <bold>foo() = 2</bold> (in B)
4 override <bold>fun foo()</bold> = 2 (in B)
4 override fun foo() = <bold>2</bold> (in B.foo())

11 return <bold>4</bold>;
9 val <bold>y = b.foo()</bold> (in test(A, B,…))
9 <bold>val y</bold> = b.foo() (in test(A, B,…))
9 val y = <bold>b.foo()</bold> (in test(A, B,…))
11 return <bold>4</bold>;
Loading

0 comments on commit 91a793d

Please sign in to comment.