Skip to content

Commit f605535

Browse files
committed
Reintroduce ghc-lib flag for hlint plugin
The ghc-lib flag was removed in #3015, but it's still useful to be able to compile hls-hlint-plugin using the GHC API if you've done so for hlint and ghc-lib-parser-ex, rather than using ghc-lib-parser as it simplifies the build and dependencies.
1 parent 6207dbc commit f605535

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

haskell-language-server.cabal

+16-1
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,13 @@ test-suite hls-retrie-plugin-tests
593593
-- hlint plugin
594594
-----------------------------
595595

596+
flag ghc-lib
597+
description:
598+
Use ghc-lib-parser rather than the ghc library (requires hlint and
599+
ghc-lib-parser-ex to also be built with it)
600+
default: True
601+
manual: True
602+
596603
flag hlint
597604
description: Enable hlint plugin
598605
default: True
@@ -628,10 +635,18 @@ library hls-hlint-plugin
628635
, text
629636
, transformers
630637
, unordered-containers
631-
, ghc-lib-parser
632638
, ghc-lib-parser-ex
633639
, apply-refact
634640

641+
if flag(ghc-lib)
642+
cpp-options: -DGHC_LIB
643+
build-depends:
644+
ghc-lib-parser
645+
else
646+
build-depends:
647+
ghc
648+
, ghc-boot
649+
635650
default-extensions:
636651
DataKinds
637652

0 commit comments

Comments
 (0)