Create expect/actual should move cursor to target declaration
#KT-34411 Fixed
This commit is contained in:
+2
-1
@@ -89,7 +89,8 @@ abstract class AbstractCreateDeclarationFix<D : KtNamedDeclaration>(
|
|||||||
val reformatted = CodeStyleManager.getInstance(project).reformat(generatedDeclaration)
|
val reformatted = CodeStyleManager.getInstance(project).reformat(generatedDeclaration)
|
||||||
val shortened = ShortenReferences.DEFAULT.process(reformatted as KtElement)
|
val shortened = ShortenReferences.DEFAULT.process(reformatted as KtElement)
|
||||||
EditorHelper.openInEditor(shortened)?.caretModel?.moveToOffset(
|
EditorHelper.openInEditor(shortened)?.caretModel?.moveToOffset(
|
||||||
(shortened as? KtNamedDeclaration)?.nameIdentifier?.startOffset ?: shortened.startOffset
|
(shortened as? KtNamedDeclaration)?.nameIdentifier?.startOffset ?: shortened.startOffset,
|
||||||
|
true
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
// Abstract: to be implemented
|
// Abstract: to be implemented
|
||||||
actual abstract class Abstract {
|
actual abstract class <caret>Abstract {
|
||||||
actual fun foo(param: String): Int {
|
actual fun foo(param: String): Int {
|
||||||
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
expect fun foo(i: Int, d: Double, s: String): Boolean
|
expect fun <caret>foo(i: Int, d: Double, s: String): Boolean
|
||||||
Reference in New Issue
Block a user