Skip to content

HLS's fourmolu plugin does not respect import-grouping: by-scope-then-qualified #4720

@bfeitknecht

Description

@bfeitknecht

Your environment

Which OS do you use?

$ uname -a
Darwin *** 24.6.0 Darwin Kernel Version 24.6.0: Mon Jul 14 11:30:30 PDT 2025; root:xnu-11417.140.69~1/RELEASE_ARM64_T6020 arm64

Which version of GHC do you use and how did you install it?

$ which ghc
/Users/bf/.ghcup/bin/ghc
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.10.2

How is your project built (alternative: link to the project)?
link

Which LSP client (editor/plugin) do you use?
Zed with the Haskell extension
Which version of HLS do you use and how did you install it?

$ haskell-language-server-wrapper --version
haskell-language-server version: 2.11.0.0 (GHC: 9.10.2) (PATH: /Users/bf/.ghcup/hls/2.11.0.0/lib/haskell-language-server-2.11.0.0/bin/haskell-language-server-wrapper)

Have you configured HLS in any way (especially: a hie.yaml file)?

"hls": {
  "initialization_options": {
    "haskell": {
      "formattingProvider": "fourmolu",
      "plugin": {
        "fourmolu": {
          "enabled": true,
          "config": {
            "external": true
          }
        },
        "hlint": {
          "enabled": true
        }
      }
    }
  }
}

Steps to reproduce

Let config.yaml contain import-grouping: by-scope-then-qualified. Format via HLS (e.g. on save). Format with fourmolu binary. There is a diff.

Expected behaviour

No diff.

Actual behaviour

There is a diff.

Debug information

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triagetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions