Skip to content

Commit

Permalink
SortSettings: add erased
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Feb 23, 2024
1 parent 959bb63 commit 5a751f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3276,7 +3276,7 @@ The following modifiers are recognized currently:
- `private`, `protected`
- `implicit`
- `final`, `sealed`, `abstract`
- `lazy`, `open`, `transparent`, `inline`, `infix`, `opaque`
- `erased`, `lazy`, `open`, `transparent`, `inline`, `infix`, `opaque`

### `PreferCurlyFors`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ object SortSettings {
}

private val modImplicit = ModKey[Mod.Implicit]("implicit")
private val modErased = ModKey[Mod.Erased]("erased")
private val modFinal = ModKey[Mod.Final]("final")
private val modSealed = ModKey[Mod.Sealed]("sealed")
private val modAbstract = ModKey[Mod.Abstract]("abstract")
Expand All @@ -50,6 +51,7 @@ object SortSettings {
modPrivate,
modProtected,
// other
modErased,
modLazy,
modOpen,
modTransparent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class SortModifiers(implicit ctx: RewriteCtx) extends RewriteSession {
case p: Term.Param =>
val start = p.pos.start
sortMods(p.mods.filterNot { m =>
m.is[Mod.ValParam] || m.is[Mod.VarParam] || m.is[Mod.Using] ||
m.is[Mod.ValParam] || m.is[Mod.VarParam] ||
m.is[Mod.Using] || m.is[Mod.Erased] ||
TreeOps.noExplicitImplicit(start, false)(m)
})
case _ =>
Expand Down

0 comments on commit 5a751f7

Please sign in to comment.