You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 16, 2018. It is now read-only.
The Kotlin language code style documentation makes clear that for multi-line, multi-argument method calls the arguments should appear on their own lines (potentially in groups):
drawSquare(
x =10, y =10,
width =100, height =100,
fill =true
)
where ( ends the line it is on while the ) appears on its own line. The specific rule is
In long argument lists, put a line break after the opening parenthesis. Indent arguments by 4 spaces. Group multiple closely related arguments on the same line.
Is there any guidance for long method calls that wrap to multiple lines when there is only a single argument?
or is one preferred (ignoring for now that you'd just use a lambda here)? What if there is wrapping involved in the argument value itself? Are each of these valid:
The text was updated successfully, but these errors were encountered:
byencho
changed the title
Clarify formatting for multi-line, single argument method calls
Clarify formatting for multi-line, single-argument method calls
Jun 8, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The Kotlin language code style documentation makes clear that for multi-line, multi-argument method calls the arguments should appear on their own lines (potentially in groups):
where
(
ends the line it is on while the)
appears on its own line. The specific rule isIs there any guidance for long method calls that wrap to multiple lines when there is only a single argument?
For example, are both the following correct?
or is one preferred (ignoring for now that you'd just use a lambda here)? What if there is wrapping involved in the argument value itself? Are each of these valid:
The text was updated successfully, but these errors were encountered: