Extraction Engine: Suggest function names based on the name of the result variable (if applicable)

#KT-6291 Fixed
This commit is contained in:
Alexey Sedunov
2015-03-11 18:26:50 +03:00
parent 8e5b960e3d
commit 9d8cfd04d9
27 changed files with 75 additions and 31 deletions
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// SUGGESTED_NAMES: i, getT
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
// PARAM_DESCRIPTOR: value-parameter val a: kotlin.Int defined in test
@@ -1,4 +1,5 @@
// WITH_RUNTIME
// SUGGESTED_NAMES: i, getT
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
// PARAM_DESCRIPTOR: value-parameter val a: kotlin.Int defined in test
@@ -1,3 +1,4 @@
// SUGGESTED_NAMES: i, getX
class A {
val x = <selection>1 + 1</selection>
val y = 1 + 1
@@ -1,3 +1,4 @@
// SUGGESTED_NAMES: i, getX
class A {
val x = i()
val y = i()
@@ -1,3 +1,4 @@
// SUGGESTED_NAMES: i, getY
fun foo() {
val x = 1 + 1
val y = <selection>1 + 1</selection>
@@ -1,3 +1,4 @@
// SUGGESTED_NAMES: i, getY
fun foo() {
val x = i()
val y = i()
@@ -1,3 +1,4 @@
// SUGGESTED_NAMES: i, getY
// SIBLING:
fun main(args: Array<String>) {
val x = 1 + 1
@@ -1,3 +1,4 @@
// SUGGESTED_NAMES: i, getY
// SIBLING:
fun main(args: Array<String>) {
val x = i()