Skip to content

Commit b118dfa

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 d265418 commit b118dfa

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
@@ -93,6 +93,7 @@ import Ide.Plugin.Example as Example
9393
import Ide.Plugin.Example2 as Example2
9494
import Ide.Plugin.GhcIde as GhcIde
9595
import Ide.Plugin.Floskell as Floskell
96+
import Ide.Plugin.Hlint as Hlint
9697
import Ide.Plugin.Ormolu as Ormolu
9798
import Ide.Plugin.StylishHaskell as StylishHaskell
9899
#if AGPL
@@ -132,8 +133,9 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
132133
, Ormolu.descriptor "ormolu"
133134
, StylishHaskell.descriptor "stylish-haskell"
134135
#if AGPL
135-
, Brittany.descriptor "brittany"
136+
, Brittany.descriptor "brittany"
136137
#endif
138+
, Hlint.descriptor "hlint"
137139
]
138140
examplePlugins =
139141
[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
, shake >= 0.17.5

0 commit comments

Comments
 (0)