Skip to content

Commit 40dbab5

Browse files
committed
hls-cabal-fmt-plugin
1 parent c4a07f6 commit 40dbab5

File tree

5 files changed

+44
-266
lines changed

5 files changed

+44
-266
lines changed

cabal.project

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ packages:
99
./hls-plugin-api
1010
./hls-test-utils
1111
./plugins/hls-cabal-plugin
12-
./plugins/hls-cabal-fmt-plugin
1312
./plugins/hls-stylish-haskell-plugin
1413
./plugins/hls-fourmolu-plugin
1514
./plugins/hls-class-plugin

haskell-language-server.cabal

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,51 @@ flag cabalfmt
8383

8484
common cabalfmt
8585
if flag(cabalfmt)
86-
build-depends: hls-cabal-fmt-plugin == 2.5.0.0
86+
build-depends: hls-cabal-fmt-plugin
8787
cpp-options: -Dhls_cabalfmt
8888

89+
flag isolateCabalfmtTests
90+
description: Should tests search for 'cabal-fmt' on the $PATH or shall we install it via build-tool-depends?
91+
-- By default, search on the PATH
92+
default: False
93+
manual: True
94+
95+
library hls-cabal-fmt-plugin
96+
import: warnings
97+
exposed-modules: Ide.Plugin.CabalFmt
98+
hs-source-dirs: plugins/hls-cabal-fmt-plugin/src
99+
build-depends:
100+
, base >=4.12 && <5
101+
, directory
102+
, filepath
103+
, ghcide == 2.5.0.0
104+
, hls-plugin-api == 2.5.0.0
105+
, lens
106+
, lsp-types
107+
, mtl
108+
, process-extras
109+
, text
110+
, transformers
111+
112+
default-language: Haskell2010
113+
114+
test-suite hls-cabal-fmt-plugin-tests
115+
import: warnings
116+
type: exitcode-stdio-1.0
117+
default-language: Haskell2010
118+
hs-source-dirs: plugins/hls-cabal-fmt-plugin/test
119+
main-is: Main.hs
120+
ghc-options: -threaded -rtsopts -with-rtsopts=-N
121+
build-depends:
122+
, base
123+
, directory
124+
, filepath
125+
, hls-cabal-fmt-plugin
126+
, hls-test-utils == 2.5.0.0
127+
128+
if flag(isolateCabalfmtTests)
129+
build-tool-depends: cabal-fmt:cabal-fmt ^>=0.1.6
130+
89131
-----------------------------
90132
-- cabal plugin
91133
-----------------------------

plugins/hls-cabal-fmt-plugin/LICENSE

Lines changed: 0 additions & 201 deletions
This file was deleted.

plugins/hls-cabal-fmt-plugin/hls-cabal-fmt-plugin.cabal

Lines changed: 0 additions & 62 deletions
This file was deleted.

plugins/hls-cabal-fmt-plugin/test/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,4 @@ cabalFmtGolden Found title path desc act = goldenWithCabalDocFormatter def cabal
5757
conf = def
5858

5959
testDataDir :: FilePath
60-
testDataDir = "test" </> "testdata"
60+
testDataDir = "plugins" </> "hls-cabal-fmt-plugin" </> "test" </> "testdata"

0 commit comments

Comments
 (0)