-
Notifications
You must be signed in to change notification settings - Fork 506
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
Formatting with many generics #295
Comments
Yeah, unless combineLatest is kept on the same line as
inline fun <T1, ..., R> combineLatest(
...
/* ktlint-disable parameter-list-wrapping */
inline fun <T1 : Any, ...>
combineLatest(
... |
Who fixes this? Is this a ktlint or an intellij issue?
I explicitly want the upper bound to be of type |
Ideally, IntelliJ would allow inline fun <
T1 : Any,
T2 : Any,
...
> combineLatest(
source1: ObservableSource<T1>,
source2: ObservableSource<T2>,
...
) {
...
} In this case, no changes would be needed in ktlint. We could add a workaround on ktlint side to accept inline fun <T1 : Any, ...>
combineLatest(
source1: ObservableSource<T1>,
... but, personally, I don't think that's a good idea. It's inconsistent at best.
Got it. P.S. there is a way to force IntelliJ to skip reformatting certain regions - https://stackoverflow.com/a/23485817/482225. |
Not sure if this is still an issue with the new indentation rule promoted from experimental, and just landed #769, I will close this for now, feel free to reopen if it's still a problem |
I have a function with a lot of generics. I can't make intellij autoformat it in a way t hat ktlint stops complaining.
I installed the settings for intellij
ktlint --apply-to-idea-project --android
. However it complains about the intendation.If you run ktlint, it fails:
The text was updated successfully, but these errors were encountered: