Introduce Parameter: Fixed title of declaration chooser

#KT-11617 Fixed
This commit is contained in:
Alexey Sedunov
2016-04-19 20:17:02 +03:00
parent cc5c3c2353
commit 070923f03a
5 changed files with 8 additions and 2 deletions
+1
View File
@@ -32,6 +32,7 @@ Issues fixed:
- [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-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
@@ -66,6 +66,7 @@ class ExtractKotlinFunctionHandler(
EXTRACT_FUNCTION,
editor,
file,
"Select target code block",
{ elements, parent -> parent.getExtractionContainers(elements.size == 1, allContainersEnabled) },
continuation
)
@@ -191,6 +191,7 @@ fun selectNewParameterContext(
operationName = INTRODUCE_PARAMETER,
editor = editor,
file = file,
title = "Introduce parameter to declaration",
getContainers = { elements, parent ->
val parents = parent.parents
val stopAt = (parent.parents.zip(parent.parents.drop(1)))
@@ -57,6 +57,7 @@ class KotlinIntroducePropertyHandler(
INTRODUCE_PROPERTY,
editor,
file,
"Select target code block",
{ elements, parent ->
parent.getExtractionContainers(strict = true, includeAll = true).filter { it is KtClassBody || (it is KtFile && !it.isScript) }
},
@@ -44,6 +44,7 @@ fun selectElementsWithTargetSibling(
operationName: String,
editor: Editor,
file: KtFile,
title: String,
getContainers: (elements: List<PsiElement>, commonParent: PsiElement) -> List<PsiElement>,
continuation: (elements: List<PsiElement>, targetSibling: PsiElement) -> Unit
) {
@@ -66,13 +67,14 @@ fun selectElementsWithTargetSibling(
continuation(elements, outermostParent)
}
selectElementsWithTargetParent(operationName, editor, file, getContainers, ::onSelectionComplete)
selectElementsWithTargetParent(operationName, editor, file, title, getContainers, ::onSelectionComplete)
}
fun selectElementsWithTargetParent(
operationName: String,
editor: Editor,
file: KtFile,
title: String,
getContainers: (elements: List<PsiElement>, commonParent: PsiElement) -> List<PsiElement>,
continuation: (elements: List<PsiElement>, targetParent: PsiElement) -> Unit
) {
@@ -94,7 +96,7 @@ fun selectElementsWithTargetParent(
chooseContainerElementIfNecessary(
containers,
editor,
"Select target code block",
title,
true,
{ it },
{ continuation(elements, it) }