diff --git a/idea/resources/fileTemplates/code/New Kotlin Function Body.kt.ft b/idea/resources/fileTemplates/code/New Kotlin Function Body.kt.ft
new file mode 100644
index 00000000000..8c5a4e426d1
--- /dev/null
+++ b/idea/resources/fileTemplates/code/New Kotlin Function Body.kt.ft
@@ -0,0 +1 @@
+throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
\ No newline at end of file
diff --git a/idea/resources/fileTemplates/code/New Kotlin Method Body.kt.html b/idea/resources/fileTemplates/code/New Kotlin Function Body.kt.html
similarity index 81%
rename from idea/resources/fileTemplates/code/New Kotlin Method Body.kt.html
rename to idea/resources/fileTemplates/code/New Kotlin Function Body.kt.html
index c3526f30920..44f331d71f9 100644
--- a/idea/resources/fileTemplates/code/New Kotlin Method Body.kt.html
+++ b/idea/resources/fileTemplates/code/New Kotlin Function Body.kt.html
@@ -2,8 +2,8 @@
- This is a built-in template used for filling the body of a Kotlin method
- each time it is generated by the program, e.g. when using the Create Method from Usage intention action.
+ | This is a built-in template used for filling the body of a Kotlin function
+ each time it is generated by the program, e.g. when using the Create Function from Usage intention action.
The template is editable. Along with Kotlin expressions and comments, you can also use the predefined variables
that will be then expanded into the corresponding values.
|
@@ -16,22 +16,22 @@
| ${RETURN_TYPE} |
|
- a return type of a created method |
+ a return type of a created function |
- | ${METHOD_NAME} |
+ ${FUNCTION_NAME} |
|
- name of the created method |
+ name of the created function |
| ${CLASS_NAME} |
|
- qualified name of the class where method is created |
+ qualified name of the class where function is created |
| ${SIMPLE_CLASS_NAME} |
|
- non-qualified name of the class where method is implemented |
+ non-qualified name of the class where function is implemented |
diff --git a/idea/resources/fileTemplates/code/New Kotlin Method Body.kt.ft b/idea/resources/fileTemplates/code/New Kotlin Method Body.kt.ft
deleted file mode 100644
index e5364a5698f..00000000000
--- a/idea/resources/fileTemplates/code/New Kotlin Method Body.kt.ft
+++ /dev/null
@@ -1 +0,0 @@
-throw UnsupportedOperationException("not implemented") //To change body of created methods use File | Settings | File Templates.
\ No newline at end of file
diff --git a/idea/src/org/jetbrains/jet/plugin/JetBundle.properties b/idea/src/org/jetbrains/jet/plugin/JetBundle.properties
index 22535d9d944..bdd50b3a5f4 100644
--- a/idea/src/org/jetbrains/jet/plugin/JetBundle.properties
+++ b/idea/src/org/jetbrains/jet/plugin/JetBundle.properties
@@ -144,7 +144,7 @@ map.platform.class.to.kotlin.multiple=Change all usages of ''{0}'' in this file
map.platform.class.to.kotlin.advertisement=Choose an appropriate Kotlin class
map.platform.class.to.kotlin.family=Change to Kotlin class
create.from.usage.family=Create from usage
-create.method.from.usage=Create method ''{0}'' from usage
+create.function.from.usage=Create function ''{0}'' from usage
choose.target.class.or.trait.title=Choose target class or trait
surround.with=Surround with
surround.with.string.template="${expr}"
diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/CreateMethodFromUsageFix.java b/idea/src/org/jetbrains/jet/plugin/quickfix/CreateFunctionFromUsageFix.java
similarity index 96%
rename from idea/src/org/jetbrains/jet/plugin/quickfix/CreateMethodFromUsageFix.java
rename to idea/src/org/jetbrains/jet/plugin/quickfix/CreateFunctionFromUsageFix.java
index 1ce351e8c80..3ab5e083522 100644
--- a/idea/src/org/jetbrains/jet/plugin/quickfix/CreateMethodFromUsageFix.java
+++ b/idea/src/org/jetbrains/jet/plugin/quickfix/CreateFunctionFromUsageFix.java
@@ -36,7 +36,6 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.PopupChooserBuilder;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiDocumentManager;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
@@ -78,9 +77,10 @@ import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-public class CreateMethodFromUsageFix extends CreateFromUsageFixBase {
+public class CreateFunctionFromUsageFix extends CreateFromUsageFixBase {
private static final String TYPE_PARAMETER_LIST_VARIABLE_NAME = "typeParameterList";
- private static final String TEMPLATE_FROM_USAGE_METHOD_BODY = "New Kotlin Method Body.kt";
+ private static final String TEMPLATE_FROM_USAGE_FUNCTION_BODY = "New Kotlin Function Body.kt";
+ private static final String ATTRIBUTE_FUNCTION_NAME = "FUNCTION_NAME";
private static final Pattern COMPONENT_FUNCTION_PATTERN = Pattern.compile("^component(\\d+)$");
/**
@@ -272,7 +272,7 @@ public class CreateMethodFromUsageFix extends CreateFromUsageFixBase {
}
/**
- * Encapsulates information about a method parameter that is going to be created.
+ * Encapsulates information about a function parameter that is going to be created.
*/
private static class Parameter {
private final String preferredName;
@@ -522,7 +522,7 @@ public class CreateMethodFromUsageFix extends CreateFromUsageFixBase {
}
}
- private final String methodName;
+ private final String functionName;
private final TypeOrExpressionThereof ownerType;
private final TypeOrExpressionThereof returnType;
private final List