Skip to content

Commit ae8a8b7

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 8d37a64 commit ae8a8b7

File tree

3 files changed

+588
-1
lines changed

3 files changed

+588
-1
lines changed

exe/Main.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import Ide.Plugin.Example as Example
101101
import Ide.Plugin.Example2 as Example2
102102
import Ide.Plugin.GhcIde as GhcIde
103103
import Ide.Plugin.Floskell as Floskell
104+
import Ide.Plugin.Hlint as Hlint
104105
import Ide.Plugin.Ormolu as Ormolu
105106
import Ide.Plugin.StylishHaskell as StylishHaskell
106107
#if AGPL
@@ -141,8 +142,9 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
141142
, Ormolu.descriptor "ormolu"
142143
, StylishHaskell.descriptor "stylish-haskell"
143144
#if AGPL
144-
, Brittany.descriptor "brittany"
145+
, Brittany.descriptor "brittany"
145146
#endif
147+
, Hlint.descriptor "hlint"
146148
]
147149
examplePlugins =
148150
[Example.descriptor "eg"

haskell-language-server.cabal

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ library
7676
, gitrev
7777
, hashable
7878
, haskell-lsp == 0.22.*
79+
<<<<<<< HEAD
7980
, hie-bios ^>= 0.6.1
81+
=======
82+
, haskell-src-exts
83+
, hie-bios >= 0.4
84+
>>>>>>> WIP on integrating hlint using DAML approach
8085
, hslogger
8186
, lens
8287
, ormolu ^>= 0.1.2
@@ -107,6 +112,53 @@ library
107112

108113
default-language: Haskell2010
109114

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

0 commit comments

Comments
 (0)