-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merged LambdaResultOutflowBehaviour and LambdaCallsBehaviour into one
- Loading branch information
1 parent
1e39d4a
commit 61d4383
Showing
48 changed files
with
242 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
idea/src/org/jetbrains/kotlin/idea/slicer/LambdaResultInflowBehaviour.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. | ||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. | ||
*/ | ||
|
||
package org.jetbrains.kotlin.idea.slicer | ||
|
||
import org.jetbrains.kotlin.idea.KotlinBundle | ||
import org.jetbrains.kotlin.idea.findUsages.handlers.SliceUsageProcessor | ||
import org.jetbrains.kotlin.psi.KtElement | ||
|
||
data class LambdaResultInflowBehaviour( | ||
override val originalBehaviour: KotlinSliceUsage.SpecialBehaviour? | ||
) : KotlinSliceUsage.SpecialBehaviour { | ||
|
||
override fun processUsages(element: KtElement, parent: KotlinSliceUsage, uniqueProcessor: SliceUsageProcessor) { | ||
InflowSlicer(element, uniqueProcessor, parent).processChildren(parent.forcedExpressionMode) | ||
} | ||
|
||
override val slicePresentationPrefix: String | ||
get() = KotlinBundle.message("slicer.text.tracking.enclosing.lambda") | ||
|
||
override val testPresentationPrefix: String | ||
get() = "[LAMBDA IN] " | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
idea/testData/slicer/inflow/anonymousFunctionParameter.results.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
9 val <bold>v = value</bold> | ||
9 val v = <bold>value</bold> | ||
8 foo(fun(<bold>value: Int</bold>) { | ||
8 [LAMBDA CALLS] foo(<bold>fun(value: Int) {</bold> | ||
3 [LAMBDA CALLS] fun foo(<bold>f: (Int) -> Unit</bold>) { | ||
8 [LAMBDA OUT] foo(<bold>fun(value: Int) {</bold> | ||
3 [LAMBDA OUT] fun foo(<bold>f: (Int) -> Unit</bold>) { | ||
4 f(<bold>1</bold>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
idea/testData/slicer/inflow/extensionLambdaImplicitParameter.leafGroups.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
4 f("", <bold>1</bold>) | ||
15 val v = <bold>it</bold> | ||
14 [LAMBDA CALLS] foo <bold>{</bold> | ||
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
14 [LAMBDA OUT] foo <bold>{</bold> | ||
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
4 f("", <bold>1</bold>) | ||
|
||
6 "".f(<bold>2</bold>) | ||
15 val v = <bold>it</bold> | ||
14 [LAMBDA CALLS] foo <bold>{</bold> | ||
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
14 [LAMBDA OUT] foo <bold>{</bold> | ||
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
6 "".f(<bold>2</bold>) | ||
|
||
9 f(<bold>3</bold>) | ||
15 val v = <bold>it</bold> | ||
14 [LAMBDA CALLS] foo <bold>{</bold> | ||
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
14 [LAMBDA OUT] foo <bold>{</bold> | ||
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
9 f(<bold>3</bold>) | ||
|
4 changes: 2 additions & 2 deletions
4
idea/testData/slicer/inflow/extensionLambdaImplicitParameter.results.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
15 val v = <bold>it</bold> | ||
14 [LAMBDA CALLS] foo <bold>{</bold> | ||
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
14 [LAMBDA OUT] foo <bold>{</bold> | ||
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
4 f("", <bold>1</bold>) | ||
6 "".f(<bold>2</bold>) | ||
9 f(<bold>3</bold>) |
12 changes: 6 additions & 6 deletions
12
idea/testData/slicer/inflow/extensionLambdaParameter.leafGroups.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
4 f("", <bold>1</bold>) | ||
15 val v = <bold>i</bold> | ||
14 foo { <bold>i</bold> -> | ||
14 [LAMBDA CALLS] foo <bold>{ i -></bold> | ||
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
14 [LAMBDA OUT] foo <bold>{ i -></bold> | ||
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
4 f("", <bold>1</bold>) | ||
|
||
6 "".f(<bold>2</bold>) | ||
15 val v = <bold>i</bold> | ||
14 foo { <bold>i</bold> -> | ||
14 [LAMBDA CALLS] foo <bold>{ i -></bold> | ||
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
14 [LAMBDA OUT] foo <bold>{ i -></bold> | ||
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
6 "".f(<bold>2</bold>) | ||
|
||
9 f(<bold>3</bold>) | ||
15 val v = <bold>i</bold> | ||
14 foo { <bold>i</bold> -> | ||
14 [LAMBDA CALLS] foo <bold>{ i -></bold> | ||
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
14 [LAMBDA OUT] foo <bold>{ i -></bold> | ||
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
9 f(<bold>3</bold>) | ||
|
4 changes: 2 additions & 2 deletions
4
idea/testData/slicer/inflow/extensionLambdaParameter.results.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
15 val v = <bold>i</bold> | ||
14 foo { <bold>i</bold> -> | ||
14 [LAMBDA CALLS] foo <bold>{ i -></bold> | ||
3 [LAMBDA CALLS] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
14 [LAMBDA OUT] foo <bold>{ i -></bold> | ||
3 [LAMBDA OUT] fun foo(<bold>f: String.(Int) -> Unit</bold>) { | ||
4 f("", <bold>1</bold>) | ||
6 "".f(<bold>2</bold>) | ||
9 f(<bold>3</bold>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.