Skip to content

Commit 68781ca

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 6c7b43a commit 68781ca

File tree

3 files changed

+583
-1
lines changed

3 files changed

+583
-1
lines changed

exe/Main.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ import Ide.Plugin.Example as Example
6767
import Ide.Plugin.Example2 as Example2
6868
import Ide.Plugin.GhcIde as GhcIde
6969
import Ide.Plugin.Floskell as Floskell
70+
import Ide.Plugin.Hlint as Hlint
7071
import Ide.Plugin.Ormolu as Ormolu
7172
import Ide.Plugin.StylishHaskell as StylishHaskell
7273
#if AGPL
@@ -106,9 +107,10 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
106107
, Ormolu.descriptor "ormolu"
107108
, StylishHaskell.descriptor "stylish-haskell"
108109
#if AGPL
109-
, Brittany.descriptor "brittany"
110+
, Brittany.descriptor "brittany"
110111
#endif
111112
, Eval.descriptor "eval"
113+
, Hlint.descriptor "hlint"
112114
]
113115
examplePlugins =
114116
[Example.descriptor "eg"

haskell-language-server.cabal

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,53 @@ library
109109

110110
default-language: Haskell2010
111111

112+
flag ghc-lib
113+
default: False
114+
manual: True
115+
description: Force dependency on ghc-lib-parser even if GHC API in the ghc package is supported
116+
117+
library hls-ghc-lib
118+
exposed-modules:
119+
Ide.Plugin.Hlint
120+
hs-source-dirs:
121+
src
122+
build-depends:
123+
base
124+
, aeson
125+
, binary
126+
, bytestring
127+
, containers
128+
, data-default
129+
, deepseq
130+
, directory
131+
, extra
132+
, filepath
133+
, ghcide
134+
, hashable
135+
, haskell-lsp
136+
, haskell-src-exts
137+
, hlint >= 3.0
138+
, regex-tdfa
139+
, shake
140+
, text
141+
, transformers
142+
, unordered-containers
143+
if !flag(ghc-lib) && impl(ghc >= 8.10.1) && impl(ghc < 8.11.0)
144+
build-depends:
145+
ghc == 8.10.*
146+
else
147+
build-depends:
148+
ghc-lib == 8.10.*
149+
150+
ghc-options:
151+
-Wall
152+
-Wredundant-constraints
153+
-Wno-name-shadowing
154+
if flag(pedantic)
155+
ghc-options: -Werror
156+
157+
default-language: Haskell2010
158+
112159
executable haskell-language-server
113160
import: agpl
114161
main-is: Main.hs
@@ -150,6 +197,7 @@ executable haskell-language-server
150197
, haskell-lsp
151198
, hie-bios
152199
, haskell-language-server
200+
, hls-ghc-lib
153201
, hslogger
154202
, optparse-applicative
155203
, safe-exceptions

0 commit comments

Comments
 (0)