Skip to content

Commit

Permalink
Merge pull request #27 from arktekk/fix/packageobjectexport
Browse files Browse the repository at this point in the history
fix: put impl and export in correct package
  • Loading branch information
hamnis authored Feb 15, 2023
2 parents 95c3b75 + f2a40d5 commit 25b1eba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions output/src/main/scala-3/fix/OldPackageObject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package fix
// format: off
package foo {
def zzz: String = ???
}

private object fooImpl extends doobie.Aliases
export fooImpl.*
private object fooImpl extends doobie.Aliases
export fooImpl.*
}
6 changes: 3 additions & 3 deletions rules/src/main/scala/fix/PackageObjectExport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ class PackageObjectExport extends SemanticRule("PackageObjectExport") {
val extendsObject = maybeExtends match {
case Some((_, extendsTokens)) =>
val privatePackage =
s"""|private object ${newTerm} ${extendsTokens.syntax.trim}
|export ${newTerm}.*
s"""| private object ${newTerm} ${extendsTokens.syntax.trim}
| export ${newTerm}.*
|""".stripMargin
Patch.addRight(restTokens.last, "\n\n" + privatePackage)
Patch.addLeft(restTokens.last, "\n" + privatePackage)
case None => Patch.empty
}
val packagePatch =
Expand Down

0 comments on commit 25b1eba

Please sign in to comment.