tweag/ormolu

Could imports of the same package be grouped when using `PackageImports` ?

Closed this issue · 1 comments

silky commented

Is your feature request related to a problem? Please describe.

Consider:

{-# LANGUAGE PackageImports #-}

import "servant-server" Servant (Context (EmptyContext), Get, Handler, NamedRoutes, type (:>))
import "servant" Servant.API.Generic ((:-))
import "servant-blaze" Servant.HTML.Blaze (HTML)
import "servant-server" Servant.Server.Generic (AsServerT, genericServeTWithContext)

Ormolu formats them this way, when it might be nice if the imports from the same package (servant-server) where together?

Describe the solution you'd like

To sort first by package name, instead of module name, when PackageImports is turned on.

Describe alternatives you've considered

n/a

Additional context

n/a

-- edit: ( Removing the style tag because I think I can only add that as I'm a member of tweag, not because of the repository settings; I'll leave it to a maintainer to make that call 😅 )

I'm going to take a look at this issue.