Skip to content

Commit 297058e

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 34eff96 commit 297058e

File tree

3 files changed

+582
-1
lines changed

3 files changed

+582
-1
lines changed

Diff for: exe/Main.hs

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import Ide.Plugin.GhcIde as GhcIde
1717
import Ide.Plugin.Floskell as Floskell
1818
import Ide.Plugin.Fourmolu as Fourmolu
1919
import Ide.Plugin.ImportLens as ImportLens
20+
import Ide.Plugin.Hlint as Hlint
2021
import Ide.Plugin.Ormolu as Ormolu
2122
import Ide.Plugin.StylishHaskell as StylishHaskell
2223
import Ide.Plugin.Retrie as Retrie
@@ -49,10 +50,11 @@ idePlugins includeExamples = pluginDescToIdePlugins allPlugins
4950
, StylishHaskell.descriptor "stylish-haskell"
5051
, Retrie.descriptor "retrie"
5152
#if AGPL
52-
, Brittany.descriptor "brittany"
53+
, Brittany.descriptor "brittany"
5354
#endif
5455
, Eval.descriptor "eval"
5556
, ImportLens.descriptor "importLens"
57+
, Hlint.descriptor "hlint"
5658
]
5759
examplePlugins =
5860
[Example.descriptor "eg"

Diff for: haskell-language-server.cabal

+47
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,53 @@ library
7777

7878
default-language: Haskell2010
7979

80+
flag ghc-lib
81+
default: False
82+
manual: True
83+
description: Force dependency on ghc-lib-parser even if GHC API in the ghc package is supported
84+
85+
library hls-ghc-lib
86+
exposed-modules:
87+
Ide.Plugin.Hlint
88+
hs-source-dirs:
89+
src
90+
build-depends:
91+
base
92+
, aeson
93+
, binary
94+
, bytestring
95+
, containers
96+
, data-default
97+
, deepseq
98+
, directory
99+
, extra
100+
, filepath
101+
, ghcide
102+
, hashable
103+
, haskell-lsp
104+
, haskell-src-exts
105+
, hlint >= 3.0
106+
, regex-tdfa
107+
, shake
108+
, text
109+
, transformers
110+
, unordered-containers
111+
if !flag(ghc-lib) && impl(ghc >= 8.10.1) && impl(ghc < 8.11.0)
112+
build-depends:
113+
ghc == 8.10.*
114+
else
115+
build-depends:
116+
ghc-lib == 8.10.*
117+
118+
ghc-options:
119+
-Wall
120+
-Wredundant-constraints
121+
-Wno-name-shadowing
122+
if flag(pedantic)
123+
ghc-options: -Werror
124+
125+
default-language: Haskell2010
126+
80127
executable haskell-language-server
81128
import: agpl, common-deps
82129
main-is: Main.hs

0 commit comments

Comments
 (0)