Skip to content

Commit 1ce5316

Browse files
alanzjneira
authored andcommitted
WIP on integrating hlint using DAML approach
But getting a mismatch on ghc-lib vs GHC types for the call to hlint. Closes #32
1 parent e8871ab commit 1ce5316

File tree

3 files changed

+583
-1
lines changed

3 files changed

+583
-1
lines changed

exe/Main.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Ide.Main (defaultMain)
1111
import Ide.Types (IdePlugins)
1212

1313
-- haskell-language-server plugins
14+
1415
import Ide.Plugin.Eval as Eval
1516
import Ide.Plugin.Example as Example
1617
import Ide.Plugin.Example2 as Example2
@@ -22,6 +23,7 @@ import Ide.Plugin.Ormolu as Ormolu
2223
import Ide.Plugin.Retrie as Retrie
2324
import Ide.Plugin.StylishHaskell as StylishHaskell
2425
import Ide.Plugin.Tactic as Tactic
26+
import Ide.Plugin.Hlint as Hlint
2527
#if AGPL
2628
import Ide.Plugin.Brittany as Brittany
2729
#endif
@@ -55,11 +57,12 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
5557
, StylishHaskell.descriptor "stylish-haskell"
5658
, Retrie.descriptor "retrie"
5759
#if AGPL
58-
, Brittany.descriptor "brittany"
60+
, Brittany.descriptor "brittany"
5961
#endif
6062
, Eval.descriptor "eval"
6163
, ImportLens.descriptor "importLens"
6264
, ModuleName.descriptor "moduleName"
65+
, Hlint.descriptor "hlint"
6366
]
6467
examplePlugins =
6568
[Example.descriptor "eg"

haskell-language-server.cabal

+47
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,53 @@ library
7777

7878
default-language: Haskell2010
7979

80+
flag ghc-lib
81+
default: False
82+
manual: True
83+
description: Force dependency on ghc-lib-parser even if GHC API in the ghc package is supported
84+
85+
library hls-ghc-lib
86+
exposed-modules:
87+
Ide.Plugin.Hlint
88+
hs-source-dirs:
89+
src
90+
build-depends:
91+
base
92+
, aeson
93+
, binary
94+
, bytestring
95+
, containers
96+
, data-default
97+
, deepseq
98+
, directory
99+
, extra
100+
, filepath
101+
, ghcide
102+
, hashable
103+
, haskell-lsp
104+
, haskell-src-exts
105+
, hlint >= 3.0
106+
, regex-tdfa
107+
, shake
108+
, text
109+
, transformers
110+
, unordered-containers
111+
if !flag(ghc-lib) && impl(ghc >= 8.10.1) && impl(ghc < 8.11.0)
112+
build-depends:
113+
ghc == 8.10.*
114+
else
115+
build-depends:
116+
ghc-lib == 8.10.*
117+
118+
ghc-options:
119+
-Wall
120+
-Wredundant-constraints
121+
-Wno-name-shadowing
122+
if flag(pedantic)
123+
ghc-options: -Werror
124+
125+
default-language: Haskell2010
126+
80127
executable haskell-language-server
81128
import: agpl, common-deps
82129
main-is: Main.hs

0 commit comments

Comments
 (0)