Skip to content

Commit 37398d3

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 d74d111 commit 37398d3

File tree

3 files changed

+583
-1
lines changed

3 files changed

+583
-1
lines changed

exe/Main.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import Ide.Plugin.Example2 as Example2
6868
import Ide.Plugin.GhcIde as GhcIde
6969
import Ide.Plugin.Floskell as Floskell
7070
import Ide.Plugin.Fourmolu as Fourmolu
71+
import Ide.Plugin.Hlint as Hlint
7172
import Ide.Plugin.Ormolu as Ormolu
7273
import Ide.Plugin.StylishHaskell as StylishHaskell
7374
import Ide.Plugin.Retrie as Retrie
@@ -110,9 +111,10 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
110111
, StylishHaskell.descriptor "stylish-haskell"
111112
, Retrie.descriptor "retrie"
112113
#if AGPL
113-
, Brittany.descriptor "brittany"
114+
, Brittany.descriptor "brittany"
114115
#endif
115116
, Eval.descriptor "eval"
117+
, Hlint.descriptor "hlint"
116118
]
117119
examplePlugins =
118120
[Example.descriptor "eg"

haskell-language-server.cabal

+48
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,53 @@ library
117117

118118
default-language: Haskell2010
119119

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

0 commit comments

Comments
 (0)