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
Copy file name to clipboardExpand all lines: documentation/release-latest/docs/rules/standard.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4343,9 +4343,9 @@ Suppress or disable rule (1)
4343
4343
ktlint_standard_condition-wrapping = disabled
4344
4344
```
4345
4345
4346
-
### Content receiver wrapping
4346
+
### Context receiver wrapping
4347
4347
4348
-
Wraps the content receiver list to a separate line regardless of maximum line length. If the maximum line length is configured and is exceeded, wrap the context receivers and if needed its projection types to separate lines.
4348
+
Wraps the context receiver list to a separate line regardless of maximum line length. If the maximum line length is configured and is exceeded, wrap the context receivers and if needed its projection types to separate lines.
Copy file name to clipboardExpand all lines: documentation/snapshot/docs/rules/standard.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4343,9 +4343,9 @@ Suppress or disable rule (1)
4343
4343
ktlint_standard_condition-wrapping = disabled
4344
4344
```
4345
4345
4346
-
### Content receiver wrapping
4346
+
### Context receiver wrapping
4347
4347
4348
-
Wraps the content receiver list to a separate line regardless of maximum line length. If the maximum line length is configured and is exceeded, wrap the context receivers and if needed its projection types to separate lines.
4348
+
Wraps the context receiver list of a function to a separate line regardless of maximum line length. If the maximum line length is configured and is exceeded, wrap the context receivers and if needed its projection types to separate lines.
Copy file name to clipboardExpand all lines: ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ContextReceiverWrappingRule.kt
Copy file name to clipboardExpand all lines: ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ContextReceiverWrappingRuleTest.kt
+12Lines changed: 12 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -199,4 +199,16 @@ class ContextReceiverWrappingRuleTest {
199
199
LintViolation(2, 36, "Newline expected before closing parenthesis as max line length is violated"),
200
200
).isFormattedAs(formattedCode)
201
201
}
202
+
203
+
@Test
204
+
fun`Issue 2854 - Given a function parameter with a context receiver then do not wrap after the context receiver`() {
205
+
val code =
206
+
"""
207
+
fun bar1(foo: context(Foo) () -> Unit = { foobar() }) {}
0 commit comments