Skip to content

Language Pragmas Auto-Insert After Module Docs  #1726

Closed
@emilypi

Description

@emilypi

Your environment

Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools:

haskell-language-server version: 1.1.0.0 (GHC: 8.10.4) (PATH: /Users/emilypi/.ghcup/bin/haskell-language-server-wrapper-1.1.0) (GIT hash: f1c096927186a93d8e3ccd4fe8385cc1b070350b)
Tool versions found on the $PATH
cabal:		3.4.0.0
stack:		2.5.1
ghc:		8.10.4

Which OS do you use:
Big Sur OSX

Which lsp-client do you use:
Emacs lsp-haskell
Describe your project (alternative: link to the project):
Cabal project
Contents of hie.yaml:

cradle:
  cabal:
    - path: "Cabal/src"
      component: "lib:Cabal"

    - path: "cabal-install/src"
      component: "lib:cabal-install"

    - path: "cabal-install/main/Main.hs"
      component: "cabal-install:exe:cabal"

    - path: "cabal-install/tests"
      component: "cabal-install:test:unit-tests"

    - path: "cabal-install/tests"
      component: "cabal-install:test:memory-usage-tests"

    - path: "cabal-install/tests"
      component: "cabal-install:test:integration-tests2"

    - path: "cabal-install/tests"
      component: "cabal-install:test:long-tests"

    - path: "cabal-install-solver/src"
      component: "lib:cabal-install-solver"

    - path: "cabal-install-solver/src-assertion"
      component: "lib:cabal-install-solver"

Steps to reproduce

On HLS 1.1, auto-insert any language pragma in a module with header documentation

Expected behaviour

Pragmas should be inserted before docs

Actual behaviour

Pragmas are inserted after docs:

{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
-- | Cabal-like file AST types: 'Field', 'Section' etc,
--
-- This (intermediate) data type is used for pretty-printing.
--
-- @since 3.0.0.0
--
{-# LANGUAGE LambdaCase #-}
module Distribution.Fields.Pretty 

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: hls-pragmas-plugintype: 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