From 77d097b9570a61cc0f85399b21e06afe1012c5a4 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Wed, 13 May 2015 16:33:34 +0300 Subject: [PATCH] TODO's --- .../declarations/ConvertMemberToExtensionIntention.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/declarations/ConvertMemberToExtensionIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/declarations/ConvertMemberToExtensionIntention.kt index e5fb9596361..429169c5b57 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/declarations/ConvertMemberToExtensionIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/declarations/ConvertMemberToExtensionIntention.kt @@ -41,6 +41,8 @@ public class ConvertMemberToExtensionIntention : JetSelfTargetingRangeIntention< return (element.getNameIdentifier() ?: return null).getTextRange() } + //TODO: local class + override fun applyTo(element: JetCallableDeclaration, editor: Editor) { val descriptor = element.resolveToDescriptor() val containingClass = descriptor.getContainingDeclaration() as ClassDescriptor @@ -85,6 +87,7 @@ public class ConvertMemberToExtensionIntention : JetSelfTargetingRangeIntention< when (extension) { is JetFunction -> { if (!extension.hasBody()) { + //TODO: methods in PSI for setBody extension.add(psiFactory.createBlock(THROW_UNSUPPORTED_OPERATION_EXCEPTION)) selectBody(extension) } @@ -133,6 +136,7 @@ public class ConvertMemberToExtensionIntention : JetSelfTargetingRangeIntention< } } + //TODO: reuse TEMPLATE_FROM_USAGE_FUNCTION_BODY private val THROW_UNSUPPORTED_OPERATION_EXCEPTION = "throw UnsupportedOperationException()" private fun newTypeParameterList(member: JetCallableDeclaration): JetTypeParameterList? {