Skip to content

Commit 8f8fde0

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 8f8fde0

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
@@ -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: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,53 @@ library
107107

108108
default-language: Haskell2010
109109

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

0 commit comments

Comments
 (0)