Skip to content

Commit 88f84f4

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 8e8a189 commit 88f84f4

File tree

3 files changed

+584
-1
lines changed

3 files changed

+584
-1
lines changed

Diff for: exe/Main.hs

+3-1
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"

Diff for: haskell-language-server.cabal

+49
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ library
7777
, gitrev
7878
, hashable
7979
, haskell-lsp == 0.22.*
80+
, haskell-src-exts
8081
, hie-bios >= 0.4
8182
, hslogger
8283
, lens
@@ -108,6 +109,53 @@ library
108109

109110
default-language: Haskell2010
110111

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+
111159
executable haskell-language-server
112160
import: agpl
113161
main-is: Main.hs
@@ -162,6 +210,7 @@ executable haskell-language-server
162210
, haskell-lsp
163211
, hie-bios >= 0.4
164212
, haskell-language-server
213+
, hls-ghc-lib
165214
, hslogger
166215
, optparse-applicative
167216
, safe-exceptions

0 commit comments

Comments
 (0)