Introduce Parameter: Fixed title of declaration chooser
#KT-11617 Fixed
This commit is contained in:
@@ -32,6 +32,7 @@ Issues fixed:
|
|||||||
- [KT-11845](https://youtrack.jetbrains.com/issue/KT-11845) Fixed exception on attempt to find derived classes
|
- [KT-11845](https://youtrack.jetbrains.com/issue/KT-11845) Fixed exception on attempt to find derived classes
|
||||||
- [KT-11736](https://youtrack.jetbrains.com/issue/KT-11736) Fixed searching of Java usages for @JvmStatic properties and @JvmStatic @JvmOverloads functions
|
- [KT-11736](https://youtrack.jetbrains.com/issue/KT-11736) Fixed searching of Java usages for @JvmStatic properties and @JvmStatic @JvmOverloads functions
|
||||||
- [KT-8817](https://youtrack.jetbrains.com/issue/KT-8817) Fixed rename of Java getters/setters through synthetic property references in Kotlin
|
- [KT-8817](https://youtrack.jetbrains.com/issue/KT-8817) Fixed rename of Java getters/setters through synthetic property references in Kotlin
|
||||||
|
- [KT-11617](https://youtrack.jetbrains.com/issue/KT-11617) Fixed title of Introduce Parameter declaration chooser
|
||||||
|
|
||||||
#### Debugger
|
#### Debugger
|
||||||
|
|
||||||
|
|||||||
+1
@@ -66,6 +66,7 @@ class ExtractKotlinFunctionHandler(
|
|||||||
EXTRACT_FUNCTION,
|
EXTRACT_FUNCTION,
|
||||||
editor,
|
editor,
|
||||||
file,
|
file,
|
||||||
|
"Select target code block",
|
||||||
{ elements, parent -> parent.getExtractionContainers(elements.size == 1, allContainersEnabled) },
|
{ elements, parent -> parent.getExtractionContainers(elements.size == 1, allContainersEnabled) },
|
||||||
continuation
|
continuation
|
||||||
)
|
)
|
||||||
|
|||||||
+1
@@ -191,6 +191,7 @@ fun selectNewParameterContext(
|
|||||||
operationName = INTRODUCE_PARAMETER,
|
operationName = INTRODUCE_PARAMETER,
|
||||||
editor = editor,
|
editor = editor,
|
||||||
file = file,
|
file = file,
|
||||||
|
title = "Introduce parameter to declaration",
|
||||||
getContainers = { elements, parent ->
|
getContainers = { elements, parent ->
|
||||||
val parents = parent.parents
|
val parents = parent.parents
|
||||||
val stopAt = (parent.parents.zip(parent.parents.drop(1)))
|
val stopAt = (parent.parents.zip(parent.parents.drop(1)))
|
||||||
|
|||||||
+1
@@ -57,6 +57,7 @@ class KotlinIntroducePropertyHandler(
|
|||||||
INTRODUCE_PROPERTY,
|
INTRODUCE_PROPERTY,
|
||||||
editor,
|
editor,
|
||||||
file,
|
file,
|
||||||
|
"Select target code block",
|
||||||
{ elements, parent ->
|
{ elements, parent ->
|
||||||
parent.getExtractionContainers(strict = true, includeAll = true).filter { it is KtClassBody || (it is KtFile && !it.isScript) }
|
parent.getExtractionContainers(strict = true, includeAll = true).filter { it is KtClassBody || (it is KtFile && !it.isScript) }
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ fun selectElementsWithTargetSibling(
|
|||||||
operationName: String,
|
operationName: String,
|
||||||
editor: Editor,
|
editor: Editor,
|
||||||
file: KtFile,
|
file: KtFile,
|
||||||
|
title: String,
|
||||||
getContainers: (elements: List<PsiElement>, commonParent: PsiElement) -> List<PsiElement>,
|
getContainers: (elements: List<PsiElement>, commonParent: PsiElement) -> List<PsiElement>,
|
||||||
continuation: (elements: List<PsiElement>, targetSibling: PsiElement) -> Unit
|
continuation: (elements: List<PsiElement>, targetSibling: PsiElement) -> Unit
|
||||||
) {
|
) {
|
||||||
@@ -66,13 +67,14 @@ fun selectElementsWithTargetSibling(
|
|||||||
continuation(elements, outermostParent)
|
continuation(elements, outermostParent)
|
||||||
}
|
}
|
||||||
|
|
||||||
selectElementsWithTargetParent(operationName, editor, file, getContainers, ::onSelectionComplete)
|
selectElementsWithTargetParent(operationName, editor, file, title, getContainers, ::onSelectionComplete)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun selectElementsWithTargetParent(
|
fun selectElementsWithTargetParent(
|
||||||
operationName: String,
|
operationName: String,
|
||||||
editor: Editor,
|
editor: Editor,
|
||||||
file: KtFile,
|
file: KtFile,
|
||||||
|
title: String,
|
||||||
getContainers: (elements: List<PsiElement>, commonParent: PsiElement) -> List<PsiElement>,
|
getContainers: (elements: List<PsiElement>, commonParent: PsiElement) -> List<PsiElement>,
|
||||||
continuation: (elements: List<PsiElement>, targetParent: PsiElement) -> Unit
|
continuation: (elements: List<PsiElement>, targetParent: PsiElement) -> Unit
|
||||||
) {
|
) {
|
||||||
@@ -94,7 +96,7 @@ fun selectElementsWithTargetParent(
|
|||||||
chooseContainerElementIfNecessary(
|
chooseContainerElementIfNecessary(
|
||||||
containers,
|
containers,
|
||||||
editor,
|
editor,
|
||||||
"Select target code block",
|
title,
|
||||||
true,
|
true,
|
||||||
{ it },
|
{ it },
|
||||||
{ continuation(elements, it) }
|
{ continuation(elements, it) }
|
||||||
|
|||||||
Reference in New Issue
Block a user