Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fill function call arguments #17

Merged
merged 2 commits into from
Jun 13, 2019
Merged

Conversation

t-kameyama
Copy link
Contributor

fun foo(s: String, i: Int) {
}
fun test() {
    foo(<caret>) // Fill function
}

to

fun foo(s: String, i: Int) {
}
fun test() {
    foo(s = "", i = 0)
}

Copy link
Owner

@suusan2go suusan2go left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@t-kameyama
Thank you for great job !
Almost LGTM but I pointed out one.

@@ -68,7 +62,7 @@ class FillClassIntention : SelfTargetingIntention<KtValueArgumentList>(KtValueAr
KotlinBuiltIns.isListOrNullableList(type) -> "emptyList()"
KotlinBuiltIns.isSetOrNullableSet(type) -> "emptySet()"
type.isMarkedNullable -> "null"
else -> null
else -> "TODO()"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think TODO() is not preferable. Because this may cause unintentional runtime error if programmer doesn't notice it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

"Please, add `<caret>` marker to\n$before"
}
}
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for adding tests!
Great Job 🍻 🍻 🍻 🍻 🍻

@suusan2go suusan2go merged commit 5f38720 into suusan2go:master Jun 13, 2019
@suusan2go
Copy link
Owner

@t-kameyama Thanks!

@t-kameyama t-kameyama deleted the fill_function branch June 13, 2019 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants