@@ -42,18 +42,13 @@ common defaults
42
42
common test-defaults
43
43
ghc-options : -threaded -rtsopts -with-rtsopts=-N
44
44
45
- common common-deps
46
- build-depends :
47
- , base >= 4.16 && < 5
48
- , directory
49
- , extra
50
- , filepath
51
- , text
52
- , prettyprinter >= 1.7
53
-
54
45
-- Default warnings in HLS
55
46
common warnings
56
- ghc-options : -Wall -Wredundant-constraints -Wno-name-shadowing -Wno-unticked-promoted-constructors
47
+ ghc-options : -Wall
48
+ -Wredundant-constraints
49
+ -Wunused-packages
50
+ -Wno-name-shadowing
51
+ -Wno-unticked-promoted-constructors
57
52
58
53
flag pedantic
59
54
description : Enable -Werror
@@ -63,7 +58,14 @@ flag pedantic
63
58
-- Allow compiling in pedantic mode
64
59
common pedantic
65
60
if flag(pedantic)
66
- ghc-options : -Werror
61
+ ghc-options :
62
+ -Werror
63
+ -- Note [unused-packages] Some packages need CPP conditioned on MIN_VERSION_ghc(x,y,z).
64
+ -- MIN_VERSION_<pkg> is CPP macro that cabal defines only when <pkg> is declared as a dependency.
65
+ -- But -Wunused-packages still reports it as unused dependency if it's not imported.
66
+ -- For packages with such "unused" dependencies we demote -Wunused-packages error
67
+ -- (enabled by --flag=pedantic) to warning via -Wwarn=unused-packages.
68
+ -Wwarn=unused-packages
67
69
68
70
-- Plugin flags are designed for 'cabal install haskell-language-server':
69
71
-- - Bulk flags should be default:False
@@ -389,9 +391,6 @@ library hls-eval-plugin
389
391
, unliftio
390
392
, unordered-containers
391
393
392
- if flag(pedantic)
393
- ghc-options : -Wwarn=redundant-constraints
394
-
395
394
default-extensions :
396
395
DataKinds
397
396
@@ -430,7 +429,7 @@ flag importLens
430
429
manual : True
431
430
432
431
library hls-explicit-imports-plugin
433
- import : defaults, warnings, pedantic
432
+ import : defaults, pedantic, warnings
434
433
exposed-modules : Ide.Plugin.ExplicitImports
435
434
hs-source-dirs : plugins/hls-explicit-imports-plugin/src
436
435
build-depends :
@@ -447,13 +446,12 @@ library hls-explicit-imports-plugin
447
446
, mtl
448
447
, text
449
448
, transformers
450
- , unordered-containers
451
449
452
450
default-extensions :
453
451
DataKinds
454
452
455
453
test-suite hls-explicit-imports-plugin-tests
456
- import : defaults, test-defaults, warnings
454
+ import : defaults, pedantic, test-defaults, warnings
457
455
type : exitcode-stdio-1.0
458
456
hs-source-dirs : plugins/hls-explicit-imports-plugin/test
459
457
main-is : Main.hs
@@ -490,8 +488,6 @@ library hls-rename-plugin
490
488
, base >= 4.12 && < 5
491
489
, containers
492
490
, extra
493
- , ghc
494
- , ghc-exactprint
495
491
, ghcide == 2.6.0.0
496
492
, hashable
497
493
, hiedb
@@ -538,15 +534,14 @@ common retrie
538
534
cpp-options : -Dhls_retrie
539
535
540
536
library hls-retrie-plugin
541
- import : defaults, warnings
537
+ import : defaults, warnings
542
538
exposed-modules : Ide.Plugin.Retrie
543
539
hs-source-dirs : plugins/hls-retrie-plugin/src
544
540
build-depends :
545
541
, aeson
546
542
, base >= 4.12 && < 5
547
543
, bytestring
548
544
, containers
549
- , deepseq
550
545
, directory
551
546
, extra
552
547
, ghc
@@ -574,7 +569,6 @@ test-suite hls-retrie-plugin-tests
574
569
hs-source-dirs : plugins/hls-retrie-plugin/test
575
570
main-is : Main.hs
576
571
build-depends :
577
- , aeson
578
572
, base
579
573
, containers
580
574
, filepath
@@ -814,7 +808,7 @@ common splice
814
808
cpp-options : -Dhls_splice
815
809
816
810
library hls-splice-plugin
817
- import : defaults, warnings
811
+ import : defaults, pedantic, warnings
818
812
exposed-modules :
819
813
Ide.Plugin.Splice
820
814
Ide.Plugin.Splice.Types
@@ -823,8 +817,6 @@ library hls-splice-plugin
823
817
build-depends :
824
818
, aeson
825
819
, base >= 4.12 && < 5
826
- , containers
827
- , dlist
828
820
, extra
829
821
, foldl
830
822
, ghc
@@ -835,18 +827,16 @@ library hls-splice-plugin
835
827
, lens
836
828
, lsp
837
829
, mtl
838
- , retrie
839
830
, syb
840
831
, text
841
832
, transformers
842
833
, unliftio-core
843
- , unordered-containers
844
834
845
835
default-extensions :
846
836
DataKinds
847
837
848
838
test-suite hls-splice-plugin-tests
849
- import : defaults, test-defaults, warnings
839
+ import : defaults, pedantic, test-defaults, warnings
850
840
type : exitcode-stdio-1.0
851
841
hs-source-dirs : plugins/hls-splice-plugin/test
852
842
main-is : Main.hs
@@ -933,22 +923,17 @@ common qualifyImportedNames
933
923
cpp-options : -Dhls_qualifyImportedNames
934
924
935
925
library hls-qualify-imported-names-plugin
936
- import : defaults, warnings
926
+ import : defaults, warnings
937
927
exposed-modules : Ide.Plugin.QualifyImportedNames
938
928
hs-source-dirs : plugins/hls-qualify-imported-names-plugin/src
939
929
build-depends :
940
- , aeson
941
930
, base >= 4.12 && < 5
942
931
, containers
943
- , deepseq
944
- , ghc
945
932
, ghcide == 2.6.0.0
946
- , hls-graph
947
933
, hls-plugin-api == 2.6.0.0
948
934
, lens
949
935
, lsp
950
936
, text
951
- , unordered-containers
952
937
, dlist
953
938
, transformers
954
939
@@ -1383,7 +1368,7 @@ library hls-ormolu-plugin
1383
1368
1384
1369
1385
1370
test-suite hls-ormolu-plugin-tests
1386
- import : defaults, test-defaults, warnings
1371
+ import : defaults, pedantic, test-defaults, warnings
1387
1372
type : exitcode-stdio-1.0
1388
1373
hs-source-dirs : plugins/hls-ormolu-plugin/test
1389
1374
main-is : Main.hs
@@ -1558,7 +1543,7 @@ common semanticTokens
1558
1543
cpp-options : -Dhls_semanticTokens
1559
1544
1560
1545
library hls-semantic-tokens-plugin
1561
- import : defaults, warnings
1546
+ import : defaults, pedantic , warnings
1562
1547
buildable : True
1563
1548
exposed-modules :
1564
1549
Ide.Plugin.SemanticTokens
@@ -1573,20 +1558,16 @@ library hls-semantic-tokens-plugin
1573
1558
1574
1559
hs-source-dirs : plugins/hls-semantic-tokens-plugin/src
1575
1560
build-depends :
1576
- , aeson
1577
1561
, base >= 4.12 && < 5
1578
1562
, containers
1579
1563
, extra
1580
- , hiedb
1581
1564
, text-rope
1582
1565
, mtl >= 2.2
1583
1566
, ghcide == 2.6.0.0
1584
1567
, hls-plugin-api == 2.6.0.0
1585
1568
, lens
1586
1569
, lsp >= 2.3
1587
- , sqlite-simple
1588
1570
, text
1589
- , unordered-containers
1590
1571
, transformers
1591
1572
, bytestring
1592
1573
, syb
@@ -1600,7 +1581,7 @@ library hls-semantic-tokens-plugin
1600
1581
default-extensions : DataKinds
1601
1582
1602
1583
test-suite hls-semantic-tokens-plugin-tests
1603
- import : defaults, test-defaults, warnings
1584
+ import : defaults, pedantic, test-defaults, warnings
1604
1585
type : exitcode-stdio-1.0
1605
1586
hs-source-dirs : plugins/hls-semantic-tokens-plugin/test
1606
1587
main-is : Main.hs
@@ -1609,23 +1590,19 @@ test-suite hls-semantic-tokens-plugin-tests
1609
1590
, aeson
1610
1591
, base
1611
1592
, containers
1612
- , extra
1613
1593
, filepath
1614
1594
, haskell-language-server :hls-semantic-tokens-plugin
1615
1595
, hls-test-utils == 2.6.0.0
1616
1596
, ghcide-test-utils
1617
1597
, hls-plugin-api
1618
1598
, lens
1619
1599
, lsp
1620
- , ghc
1621
1600
, text-rope
1622
1601
, lsp-test
1623
1602
, text
1624
1603
, data-default
1625
- , bytestring
1626
1604
, ghcide == 2.6.0.0
1627
1605
, hls-plugin-api == 2.6.0.0
1628
- , template-haskell
1629
1606
, data-default
1630
1607
1631
1608
-----------------------------
@@ -1634,7 +1611,6 @@ test-suite hls-semantic-tokens-plugin-tests
1634
1611
1635
1612
library
1636
1613
import : defaults
1637
- , common-deps
1638
1614
, warnings
1639
1615
, pedantic
1640
1616
-- plugins
@@ -1676,33 +1652,27 @@ library
1676
1652
autogen-modules : Paths_haskell_language_server
1677
1653
hs-source-dirs : src
1678
1654
build-depends :
1679
- , async
1680
- , base16-bytestring
1681
- , bytestring
1682
- , containers
1683
- , cryptohash-sha1
1655
+ , aeson-pretty
1656
+ , base >= 4.16 && < 5
1684
1657
, data-default
1658
+ , directory
1659
+ , extra
1660
+ , filepath
1685
1661
, ghc
1686
1662
, ghcide == 2.6.0.0
1687
1663
, githash >= 0.1.6.1
1688
- , lsp >= 2.3.0.0
1689
1664
, hie-bios
1690
- , hiedb
1691
1665
, hls-plugin-api == 2.6.0.0
1692
1666
, optparse-applicative
1693
1667
, optparse-simple
1668
+ , prettyprinter >= 1.7
1694
1669
, process
1695
- , hls-graph
1696
- , safe-exceptions
1697
- , sqlite-simple
1698
- , unordered-containers
1699
- , aeson-pretty
1670
+ , text
1700
1671
1701
1672
default-extensions : DataKinds
1702
1673
1703
1674
executable haskell-language-server
1704
1675
import : defaults
1705
- , common-deps
1706
1676
, warnings
1707
1677
, pedantic
1708
1678
main-is : Main.hs
@@ -1729,42 +1699,17 @@ executable haskell-language-server
1729
1699
ghc-options : -dynamic
1730
1700
1731
1701
build-depends :
1732
- , aeson
1733
- , async
1734
- , base16-bytestring
1735
- , binary
1736
- , bytestring
1737
- , containers
1738
- , cryptohash-sha1
1739
- , deepseq
1740
- , ghc
1741
- , ghc-boot-th
1742
- , ghcide
1743
- , hashable
1702
+ , base >= 4.16 && < 5
1744
1703
, haskell-language-server
1745
- , lsp
1746
- , hie-bios
1747
- , hiedb
1748
- , lens
1749
- , regex-tdfa
1750
- , optparse-applicative
1751
1704
, hls-plugin-api
1752
- , lens
1753
- , mtl
1754
- , regex-tdfa
1755
- , safe-exceptions
1756
- , hls-graph
1757
- , sqlite-simple
1758
- , stm
1759
- , temporary
1760
- , transformers
1761
- , unordered-containers
1705
+ , lsp
1706
+ , prettyprinter >= 1.7
1707
+ , text
1762
1708
1763
1709
default-extensions : DataKinds
1764
1710
1765
1711
executable haskell-language-server-wrapper
1766
1712
import : defaults
1767
- , common-deps
1768
1713
, warnings
1769
1714
, pedantic
1770
1715
main-is : Wrapper.hs
@@ -1780,33 +1725,31 @@ executable haskell-language-server-wrapper
1780
1725
"-with-rtsopts=-I0 -A128M"
1781
1726
1782
1727
build-depends :
1728
+ , base >= 4.16 && < 5
1783
1729
, data-default
1784
- , ghc
1785
- , ghc-paths
1730
+ , directory
1731
+ , extra
1732
+ , filepath
1786
1733
, ghcide
1787
- , gitrev
1788
1734
, haskell-language-server
1789
1735
, hie-bios
1790
1736
, hls-plugin-api
1791
1737
, lsp
1792
1738
, lsp-types
1793
- , mtl
1794
- , optparse-applicative
1795
- , optparse-simple
1796
- , process
1739
+ , text
1797
1740
, transformers
1798
1741
, unliftio-core
1799
1742
if !os(windows)
1800
1743
build-depends :
1801
- unix
1744
+ , unix
1802
1745
, containers
1803
-
1804
-
1746
+ else
1747
+ build-depends :
1748
+ , process
1805
1749
1806
1750
test-suite func-test
1807
1751
import : defaults
1808
1752
, test-defaults
1809
- , common-deps
1810
1753
, warnings
1811
1754
, pedantic
1812
1755
, refactor
@@ -1816,22 +1759,23 @@ test-suite func-test
1816
1759
ghcide :ghcide-test-preprocessor
1817
1760
1818
1761
build-depends :
1762
+ , aeson
1763
+ , base >= 4.16 && < 5
1819
1764
, bytestring
1820
- , data-default
1765
+ , containers
1821
1766
, deepseq
1822
- , hashable
1823
- , lens
1824
- , lens-aeson
1767
+ , extra
1768
+ , filepath
1825
1769
, ghcide
1826
1770
, ghcide-test-utils
1827
- , hls-test-utils == 2.6.0.0
1828
- , lsp-types
1829
- , aeson
1771
+ , hashable
1830
1772
, hls-plugin-api
1773
+ , hls-test-utils == 2.6.0.0
1774
+ , lens
1831
1775
, lsp-test
1832
- , containers
1776
+ , lsp-types
1777
+ , text
1833
1778
, unordered-containers
1834
- , row-types
1835
1779
1836
1780
hs-source-dirs : test/functional test/utils
1837
1781
@@ -1860,7 +1804,7 @@ test-suite func-test
1860
1804
cpp-options : -Dhls_ormolu
1861
1805
1862
1806
test-suite wrapper-test
1863
- import : defaults, common-deps
1807
+ import : defaults
1864
1808
, warnings
1865
1809
, pedantic
1866
1810
type : exitcode-stdio-1.0
@@ -1869,14 +1813,16 @@ test-suite wrapper-test
1869
1813
haskell-language-server :haskell-language-server
1870
1814
1871
1815
build-depends :
1872
- process
1816
+ , base >= 4.16 && < 5
1817
+ , extra
1873
1818
, hls-test-utils
1819
+ , process
1874
1820
1875
1821
hs-source-dirs : test/wrapper
1876
1822
main-is : Main.hs
1877
1823
1878
1824
benchmark benchmark
1879
- import : defaults, warnings, common-deps
1825
+ import : defaults, warnings
1880
1826
-- Depends on shake-bench which is unbuildable after this point
1881
1827
if impl(ghc >= 9.5 )
1882
1828
buildable : False
@@ -1894,15 +1840,19 @@ benchmark benchmark
1894
1840
ViewPatterns
1895
1841
1896
1842
build-depends :
1897
- aeson,
1898
- containers,
1899
- data-default,
1900
- ghcide-bench,
1901
- haskell-language-server,
1902
- hls-plugin-api,
1903
- lens,
1904
- lens-aeson,
1905
- optparse-applicative,
1906
- shake,
1907
- shake-bench == 0.2. *,
1908
- yaml
1843
+ , aeson
1844
+ , base >= 4.16 && < 5
1845
+ , containers
1846
+ , data-default
1847
+ , directory
1848
+ , extra
1849
+ , filepath
1850
+ , ghcide-bench
1851
+ , haskell-language-server
1852
+ , hls-plugin-api
1853
+ , lens
1854
+ , lens-aeson
1855
+ , shake
1856
+ , shake-bench == 0.2. *
1857
+ , text
1858
+ , yaml
0 commit comments