Skip to content

Commit

Permalink
Router: extension is probably also a keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Mar 15, 2023
1 parent cd58833 commit 860a828
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ class Router(formatOps: FormatOps) {
isSymbolicName(name.value) && name.parent.exists(isDefDef) =>
Space
case _: Defn.ExtensionGroup if left.is[soft.KwExtension] =>
Space
Space(style.spaces.afterKeywordBeforeParen)
case _ => Space(left.is[T.Comment])
}
def baseNoSplit(implicit fileLine: FileLine) = Split(modification, 0)
Expand Down
4 changes: 2 additions & 2 deletions scalafmt-tests/src/test/resources/scala3/Extension.stat
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,12 @@ spaces.afterKeywordBeforeParen = false
extension (s: String)
def foo(): Unit = ???
>>>
extension (s: String) def foo(): Unit = ???
extension(s: String) def foo(): Unit = ???
<<< #3499 4
spaces.afterKeywordBeforeParen = false
newlines.beforeOpenParenDefnSite = unfold
===
extension (s: String)
def foo(): Unit = ???
>>>
extension (s: String) def foo(): Unit = ???
extension(s: String) def foo(): Unit = ???

0 comments on commit 860a828

Please sign in to comment.