packages feed

haskell-language-server-1.2.0.0: haskell-language-server.cabal

cabal-version:      2.4
category:           Development
name:               haskell-language-server
version:            1.2.0.0
synopsis:           LSP server for GHC
description:
  Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>

homepage:           https://github.com/haskell/haskell-language-server#readme
bug-reports:        https://github.com/haskell/haskell-language-server/issues
author:             The Haskell IDE Team
maintainer:         alan.zimm@gmail.com
copyright:          The Haskell IDE Team
license:            Apache-2.0
license-file:       LICENSE
build-type:         Simple
tested-with:        GHC == 8.6.4 || == 8.6.5 || == 8.8.2 || == 8.8.3 || == 8.8.4 || == 8.10.2 || == 8.10.3 || == 8.10.4 || == 8.10.5
extra-source-files:
  README.md
  ChangeLog.md
  test/testdata/**/*.project
  test/testdata/**/*.cabal
  test/testdata/**/*.yaml
  -- this one is not matched by the previous glob
  test/testdata/hlint/ignore/.hlint.yaml
  test/testdata/**/*.h
  test/testdata/**/*.hs

flag pedantic
  description: Enable -Werror
  default:     False
  manual:      True

source-repository head
  type:     git
  location: https://github.com/haskell/haskell-language-server

common common-deps
  build-depends:
    , base       >=4.12 && <5
    , directory
    , extra
    , filepath
    , text

library
  import:           common-deps
  exposed-modules:
    Ide.Arguments
    Ide.Main
    Ide.Version

  other-modules:    Paths_haskell_language_server
  autogen-modules:  Paths_haskell_language_server
  hs-source-dirs:   src
  build-depends:
    , async
    , base16-bytestring
    , bytestring
    , containers
    , cryptohash-sha1
    , data-default
    , ghc
    , ghcide                ^>=1.4
    , gitrev
    , lsp
    , hie-bios
    , hiedb
    , hls-plugin-api        ^>= 1.1
    , hslogger
    , optparse-applicative
    , optparse-simple
    , process
    , hls-graph
    , safe-exceptions
    , sqlite-simple
    , unordered-containers
    , aeson-pretty

  ghc-options:      -Wall -Wredundant-constraints -Wno-name-shadowing -Wno-unticked-promoted-constructors

  if flag(pedantic)
    ghc-options: -Werror

  default-language: Haskell2010
  default-extensions: DataKinds, TypeOperators

-- Plugin flags are designed for 'cabal install haskell-language-server':
-- - Packaged plugins should be manual:False
-- - Non packaged plugins and bulk flags should be manual:True
-- - Bulk flags should be default:False
-- - Individual flags should be default:True

flag all-plugins
  description: Enable all non formatter plugins
  default:     False
  manual:      True

flag all-formatters
  description: Enable all fomatters
  default:     False
  manual:      True

flag class
  description: Enable class plugin
  default:     True
  manual:      True

flag haddockComments
  description: Enable haddockComments plugin
  default:     True
  manual:      True

flag eval
  description: Enable eval plugin
  default:     True
  manual:      True

flag importLens
  description: Enable importLens plugin
  default:     True
  manual:      True

flag refineImports
  description: Enable refineImports plugin
  default:     True
  manual:      True

flag retrie
  description: Enable retrie plugin
  default:     True
  manual:      True

flag tactic
  description: Enable tactic plugin
  default:     True
  manual:      True

flag hlint
  description: Enable hlint plugin
  default:     True
  manual:      True

flag moduleName
  description: Enable moduleName plugin
  default:     True
  manual:      True

flag pragmas
  description: Enable pragmas plugin
  default:     True
  manual:      True

flag splice
  description: Enable splice plugin
  default:     True
  manual:      True

-- formatters

flag floskell
  description: Enable floskell plugin
  default:     True
  manual:      True

flag fourmolu
  description: Enable fourmolu plugin
  default:     True
  manual:      True

flag ormolu
  description: Enable ormolu plugin
  default:     True
  manual:      True

flag stylishHaskell
  description: Enable stylishHaskell plugin
  default:     True
  manual:      True

flag brittany
  description: Enable brittany plugin
  default:     True
  manual:      True

common example-plugins
  hs-source-dirs: plugins/default/src
  other-modules: Ide.Plugin.Example,
                 Ide.Plugin.Example2

common class
  if flag(class) || flag(all-plugins)
    build-depends: hls-class-plugin ^>= 1.0.0.1
    cpp-options: -Dclass

common haddockComments
  if flag(haddockComments) || flag(all-plugins)
    build-depends: hls-haddock-comments-plugin ^>= 1.0.0.1
    cpp-options: -DhaddockComments

common eval
  if flag(eval) || flag(all-plugins)
    build-depends: hls-eval-plugin ^>= 1.1.0.0
    cpp-options: -Deval

common importLens
  if flag(importLens) || flag(all-plugins)
    build-depends: hls-explicit-imports-plugin ^>= 1.0.0.1
    cpp-options: -DimportLens

common refineImports
  if flag(refineImports) || flag(all-plugins)
    build-depends: hls-refine-imports-plugin
    cpp-options: -DrefineImports

common retrie
  if flag(retrie) || flag(all-plugins)
    build-depends: hls-retrie-plugin ^>= 1.0.0.1
    cpp-options: -Dretrie

common tactic
  if flag(tactic) || flag(all-plugins)
    build-depends: hls-tactics-plugin ^>= 1.2.0.0
    cpp-options: -Dtactic

common hlint
  if flag(hlint) || flag(all-plugins)
    build-depends: hls-hlint-plugin ^>= 1.0.0.2
    cpp-options: -Dhlint

common moduleName
  if flag(moduleName) || flag(all-plugins)
    build-depends: hls-module-name-plugin ^>= 1.0.0.0
    cpp-options: -DmoduleName

common pragmas
  if flag(pragmas) || flag(all-plugins)
    build-depends: hls-pragmas-plugin ^>= 1.0.0.0
    cpp-options: -Dpragmas

common splice
  if flag(splice) || flag(all-plugins)
    build-depends: hls-splice-plugin ^>= 1.0.0.1
    cpp-options: -Dsplice

-- formatters

common floskell
  if flag(floskell) || flag(all-formatters)
    build-depends: hls-floskell-plugin      ^>=1.0.0.0
    cpp-options: -Dfloskell

common fourmolu
  if flag(fourmolu) || flag(all-formatters)
    build-depends: hls-fourmolu-plugin ^>= 1.0.0.0
    cpp-options: -Dfourmolu

common ormolu
  if flag(ormolu) || flag(all-formatters)
    build-depends: hls-ormolu-plugin ^>= 1.0.0.0
    cpp-options: -Dormolu

common stylishHaskell
  if flag(stylishHaskell) || flag(all-formatters)
    build-depends: hls-stylish-haskell-plugin ^>= 1.0.0.0
    cpp-options: -DstylishHaskell

common brittany
  if (flag(brittany) || flag(all-formatters))
    build-depends: hls-brittany-plugin ^>= 1.0.0.1
    cpp-options: -Dbrittany

executable haskell-language-server
  import:             common-deps
                    -- plugins
                    , example-plugins
                    , class
                    , haddockComments
                    , eval
                    , importLens
                    , refineImports
                    , retrie
                    , tactic
                    , hlint
                    , moduleName
                    , pragmas
                    , splice
                    , floskell
                    , fourmolu
                    , ormolu
                    , stylishHaskell
                    , brittany

  main-is:          Main.hs
  hs-source-dirs:   exe
  other-modules:    Plugins

  ghc-options:
    -threaded -Wall -Wno-name-shadowing -Wredundant-constraints
    -- allow user RTS overrides
    -rtsopts
    -- disable idle GC
    -- increase nursery size
    "-with-rtsopts=-I0 -A128M"
    -Wno-unticked-promoted-constructors
  if flag(pedantic)
    ghc-options: -Werror

  build-depends:
    , aeson
    , async
    , base16-bytestring
    , binary
    , bytestring
    , containers
    , cryptohash-sha1
    , deepseq
    , ghc
    , ghc-api-compat
    , ghc-boot-th
    , ghcide
    , hashable
    , haskell-language-server
    , lsp
    , hie-bios
    , hiedb
    , lens
    , regex-tdfa
    , hslogger
    , optparse-applicative
    , hls-plugin-api
    , lens
    , mtl
    , regex-tdfa
    , safe-exceptions
    , hls-graph
    , sqlite-simple
    , temporary
    , transformers
    , unordered-containers

  default-language: Haskell2010
  default-extensions: DataKinds, TypeOperators

executable haskell-language-server-wrapper
  import:           common-deps
  main-is:          Wrapper.hs
  hs-source-dirs:   exe
  other-modules:    Paths_haskell_language_server
  autogen-modules:  Paths_haskell_language_server
  ghc-options:
    -threaded -Wall -Wno-name-shadowing -Wredundant-constraints
    -- allow user RTS overrides
    -rtsopts
    -- disable idle GC
    -- increase nursery size
    "-with-rtsopts=-I0 -A128M"
  if flag(pedantic)
    ghc-options: -Werror

  build-depends:
    , data-default
    , ghc
    , ghc-paths
    , ghcide
    , gitrev
    , haskell-language-server
    , hie-bios
    , optparse-applicative
    , optparse-simple
    , process

  default-language: Haskell2010


test-suite func-test
  import:             common-deps
  type:               exitcode-stdio-1.0
  default-language:   Haskell2010
  build-tool-depends:
    haskell-language-server:haskell-language-server -any,
    ghcide:ghcide-test-preprocessor -any

  build-depends:
    , bytestring
    , data-default
    , hspec-expectations
    , lens
    , ghcide
    , hls-test-utils ^>= 1.0.0.0
    , lsp-types
    , aeson
    , hls-plugin-api
    , lsp-test
    , containers
    , unordered-containers

  hs-source-dirs:     test/functional test/utils

  main-is:            Main.hs
  other-modules:
    Command
    Completion
    Config
    Deferred
    Definition
    Diagnostic
    Format
    FunctionalBadProject
    FunctionalCodeAction
    FunctionalLiquid
    HieBios
    Highlight
    Progress
    Reference
    Rename
    Symbol
    TypeDefinition
    Test.Hls.Command
    Test.Hls.Flags

  default-extensions: OverloadedStrings
  ghc-options:
    -Wall -Wno-name-shadowing -threaded -rtsopts -with-rtsopts=-N -Wno-unticked-promoted-constructors

  if flag(pedantic)
    ghc-options: -Werror -Wredundant-constraints

  if flag(class) || flag(all-plugins)
    cpp-options: -Dclass
  if flag(haddockComments) || flag(all-plugins)
    cpp-options: -DhaddockComments
  if flag(eval) || flag(all-plugins)
    cpp-options: -Deval
  if flag(importLens) || flag(all-plugins)
    cpp-options: -DimportLens
  if flag(retrie) || flag(all-plugins)
    cpp-options: -Dretrie
  if flag(tactic) || flag(all-plugins)
    cpp-options: -Dtactic
  if flag(hlint) || flag(all-plugins)
    cpp-options: -Dhlint
  if flag(moduleName) || flag(all-plugins)
    cpp-options: -DmoduleName
  if flag(pragmas) || flag(all-plugins)
    cpp-options: -Dpragmas
  if flag(splice) || flag(all-plugins)
    cpp-options: -Dsplice

-- formatters
  if flag(floskell) || flag(all-formatters)
    cpp-options: -Dfloskell
  if flag(fourmolu) || flag(all-formatters)
    cpp-options: -Dfourmolu
  if flag(ormolu) || flag(all-formatters)
    cpp-options: -Dormolu
  if flag(stylishHaskell) || flag(all-formatters)
    cpp-options: -DstylishHaskell
  if (flag(brittany) || flag(all-formatters))
    cpp-options: -Dbrittany

test-suite wrapper-test
  type:               exitcode-stdio-1.0
  build-tool-depends:
    haskell-language-server:haskell-language-server-wrapper -any,
    haskell-language-server:haskell-language-server -any

  default-language:   Haskell2010
  build-depends:
    , base
    , directory
    , process
    , hls-test-utils
    , extra

  hs-source-dirs:     test/wrapper
  main-is:            Main.hs
  ghc-options:        -Wall