cabal-version:      2.4
category:           Development
name:               hls-tactics-plugin
version:            1.7.0.0
synopsis:           Wingman plugin for Haskell Language Server
description:
  Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
author:             Sandy Maguire, Reed Mullanix
maintainer:         sandy@sandymaguire.me
copyright:          Sandy Maguire, Reed Mullanix
homepage:           https://haskellwingman.dev
bug-reports:        https://github.com/haskell/haskell-language-server/issues
license:            Apache-2.0
license-file:       LICENSE
build-type:         Simple
extra-source-files:
  README.md
  test/golden/*.cabal
  test/golden/*.hs
  test/golden/*.yaml

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

library
  if impl(ghc >= 9.3)
    buildable: False
  else
    buildable: True
  hs-source-dirs:     src
  exposed-modules:
    Ide.Plugin.Tactic
    Refinery.Future
    Wingman.AbstractLSP
    Wingman.AbstractLSP.TacticActions
    Wingman.AbstractLSP.Types
    Wingman.Auto
    Wingman.CaseSplit
    Wingman.CodeGen
    Wingman.CodeGen.Utils
    Wingman.Context
    Wingman.Debug
    Wingman.EmptyCase
    Wingman.GHC
    Wingman.Judgements
    Wingman.Judgements.SYB
    Wingman.Judgements.Theta
    Wingman.KnownStrategies
    Wingman.KnownStrategies.QuickCheck
    Wingman.LanguageServer
    Wingman.LanguageServer.Metaprogram
    Wingman.LanguageServer.TacticProviders
    Wingman.Machinery
    Wingman.Metaprogramming.Lexer
    Wingman.Metaprogramming.Parser
    Wingman.Metaprogramming.Parser.Documentation
    Wingman.Metaprogramming.ProofState
    Wingman.Naming
    Wingman.Plugin
    Wingman.Range
    Wingman.Simplify
    Wingman.StaticPlugin
    Wingman.Tactics
    Wingman.Types

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

  if flag(pedantic)
    ghc-options: -Werror

  build-depends:
    , aeson
    , base                  >=4.12    && <5
    , containers
    , deepseq
    , directory
    , extra                 >=1.7.8
    , filepath
    , fingertree
    , generic-lens
    , ghc
    , ghc-boot-th
    , ghc-exactprint
    , ghc-source-gen        ^>=0.4.1
    , ghcide                ^>= 1.8
    , hls-graph
    , hls-plugin-api        ^>=1.5
    , hls-refactor-plugin
    , hyphenation
    , lens
    , lsp
    , megaparsec            >=8       && <10
    , mtl
    , parser-combinators
    , prettyprinter
    , refinery              ^>=0.4
    , retrie                >=0.1.1.0
    , syb
    , unagi-chan
    , text
    , transformers
    , unordered-containers

  default-language:   Haskell2010
  default-extensions:
    DataKinds
    DeriveAnyClass
    DeriveDataTypeable
    DeriveFoldable
    DeriveFunctor
    DeriveGeneric
    DeriveTraversable
    DerivingStrategies
    DerivingVia
    FlexibleContexts
    FlexibleInstances
    GADTs
    GeneralizedNewtypeDeriving
    LambdaCase
    MultiParamTypeClasses
    NumDecimals
    OverloadedLabels
    PatternSynonyms
    ScopedTypeVariables
    TypeApplications
    TypeOperators
    ViewPatterns

test-suite tests
  if impl(ghc >= 9.3)
    buildable: False
  else
    buildable: True
  type:               exitcode-stdio-1.0
  main-is:            Main.hs
  other-modules:
    AutoTupleSpec
    CodeAction.AutoSpec
    CodeAction.DestructAllSpec
    CodeAction.DestructPunSpec
    CodeAction.DestructSpec
    CodeAction.IntrosSpec
    CodeAction.IntroDestructSpec
    CodeAction.RefineSpec
    CodeAction.RunMetaprogramSpec
    CodeAction.UseDataConSpec
    CodeLens.EmptyCaseSpec
    ProviderSpec
    Spec
    UnificationSpec
    Utils

  hs-source-dirs:     test
  ghc-options:
    -Wall -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N

  build-depends:
    , aeson
    , base
    , containers
    , deepseq
    , directory
    , filepath
    , ghc
    , ghcide
    , hls-plugin-api
    , hls-tactics-plugin
    , hls-test-utils      ^>=1.4
    , hspec
    , hspec-expectations
    , lens
    , lsp-types
    , mtl
    , QuickCheck
    , tasty-hspec
    , tasty-hunit
    , text

  build-tool-depends: hspec-discover:hspec-discover -any
  default-language:   Haskell2010