Skip to content

Commit 5d35c6c

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 12c0e44 commit 5d35c6c

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
@@ -67,6 +67,7 @@ import Ide.Plugin.Example as Example
6767
import Ide.Plugin.Example2 as Example2
6868
import Ide.Plugin.GhcIde as GhcIde
6969
import Ide.Plugin.Floskell as Floskell
70+
import Ide.Plugin.Hlint as Hlint
7071
import Ide.Plugin.Ormolu as Ormolu
7172
import Ide.Plugin.StylishHaskell as StylishHaskell
7273
#if AGPL
@@ -106,9 +107,10 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
106107
, Ormolu.descriptor "ormolu"
107108
, StylishHaskell.descriptor "stylish-haskell"
108109
#if AGPL
109-
, Brittany.descriptor "brittany"
110+
, Brittany.descriptor "brittany"
110111
#endif
111112
, Eval.descriptor "eval"
113+
, Hlint.descriptor "hlint"
112114
]
113115
examplePlugins =
114116
[Example.descriptor "eg"

haskell-language-server.cabal

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,53 @@ library
108108

109109
default-language: Haskell2010
110110

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

0 commit comments

Comments
 (0)