Can't add comment inside import section
- Dominant language
- Haskell
- Stars
- 1.3k
- Forks
- 147
- PR merge metrics
- No merged PRs in 30d
Description
**Problem**
All comments inside the import declaration block will get moved to the top of the block by elm-format. This is annoying because their may be cases where a user may decide that a comment should be (and stay) there.
**Example**
For example in a project using `ianmackenzie/elm-3d-scene` I would like to annotate which package a module comes from in a long list of imports.
```elm
import Angle -- ianmackenzie/elm-units
import Camera3d -- ianmackenzie/camera-3d
import Color -- tesk9/palette
import Color.Transparent -- tesk9/palette
import Direction3d -- tesk9/palette
import Length -- ianmackenzie/elm-units
import Pixels exposing (Pixels, pixels) -- ianmackenzie/elm-units
import Point3d -- ianmackenzie/elm-geometry
import Scene3d exposing (noDirectLighting, noEnvironmentalLighting) -- ianmackenzie/elm-3d-scene
import Scene3d.Chromaticity as Chromaticity -- ianmackenzie/elm-3d-scene
import Scene3d.Drawable as Drawable -- ianmackenzie/elm-3d-scene
import Scene3d.Exposure as Exposure -- ianmackenzie/elm-3d-scene
import Scene3d.Mesh as Mesh -- ianmackenzie/elm-3d-scene
import Triangle3d -- ianmackenzie/elm-geometry
import Viewpoint3d -- ianmackenzie/camera-3d
```
but instead after formatting it will look like this
```elm
-- ianmackenzie/elm-units
-- ianmackenzie/camera-3d
-- tesk9/palette
-- tesk9/palette
-- tesk9/palette
-- ianmackenzie/elm-units
-- ianmackenzie/elm-units
-- ianmackenzie/elm-geometry
-- ianmackenzie/elm-3d-scene
-- ianmackenzie/elm-3d-scene
-- ianmackenzie/elm-3d-scene
-- ianmackenzie/elm-3d-scene
-- ianmackenzie/elm-3d-scene
-- ianmackenzie/elm-geometry
-- ianmackenzie/camera-3d
import Angle
import Camera3d
import Color
import Color.Transparent
import Direction3d
import Length
import Pixels exposing (Pixels, pixels)
import Point3d
import Scene3d exposing (noDirectLighting, noEnvironmentalLighting)
import Scene3d.Chromaticity as Chromaticity
import Scene3d.Drawable as Drawable
import Scene3d.Exposure as Exposure
import Scene3d.Mesh as Mesh
import Triangle3d
import Viewpoint3d
```
Contributor guide
No contributing guide indexed for this repository
Research direction
No source files or tests are named. Start by locating elm-format's import-declaration formatting and comment handling, then reproduce the supplied Elm example; done means comments placed after imports remain attached to their imports instead of moving to the top of the block.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100