File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed
plugins/hls-cabal-plugin/test
testdata/cabal-add-testdata/hidden-package-dashed Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,6 @@ import System.FilePath
25
25
import Test.Hls
26
26
import Utils
27
27
28
- import Debug.Trace
29
-
30
28
main :: IO ()
31
29
main = do
32
30
defaultTestRunner $
@@ -227,9 +225,21 @@ codeActionTests = testGroup "Code Actions"
227
225
cas <- Maybe. mapMaybe (^? _R) <$> getAllCodeActions hsdoc
228
226
let selectedCas = filter (\ ca -> " Add dependency" `T.isPrefixOf` (ca ^. L. title)) cas
229
227
mapM_ executeCodeAction selectedCas
230
- _ <- skipManyTill anyMessage $ getDocumentEdit cabDoc -- Needed to wait for the changes in cabal file
228
+ _ <- skipManyTill anyMessage $ getDocumentEdit cabDoc -- Wait for the changes in cabal file
231
229
contents <- documentContents cabDoc
232
230
liftIO $ assertEqual " Split isn't found in the cabal file" (Text. indices " split" contents) [256 ]
231
+ , runHaskellTestCaseSession " Code Actions - Can add dashed hidden package" (" cabal-add-testdata" </> " hidden-package-dashed" ) $ do
232
+ hsdoc <- openDoc (" src" </> " Main.hs" ) " haskell"
233
+ cabDoc <- openDoc " hidden-package-dashed.cabal" " cabal"
234
+ _ <- waitForDiagnosticsFrom hsdoc
235
+ cas <- Maybe. mapMaybe (^? _R) <$> getAllCodeActions hsdoc
236
+ let selectedCas = filter (\ ca -> " Add dependency" `T.isPrefixOf` (ca ^. L. title)) cas
237
+ mapM_ executeCodeAction selectedCas
238
+ _ <- skipManyTill anyMessage $ getDocumentEdit cabDoc -- Wait for the changes in cabal file
239
+ contents <- documentContents cabDoc
240
+ liftIO $ assertEqual " hls-plugin-api isn't found in the cabal file" (Text. indices " hls-plugin-api" contents) [263 ]
241
+
242
+
233
243
]
234
244
where
235
245
getLicenseAction :: T. Text -> [Command |? CodeAction ] -> [CodeAction ]
Original file line number Diff line number Diff line change
1
+ cabal-version : 2.4
2
+
3
+ name : hidden-package
4
+ version : 0.1.0.0
5
+ build-type : Simple
6
+
7
+ executable hidden-package-dashed
8
+ main-is : Main.hs
9
+ hs-source-dirs : src
10
+ ghc-options : -Wall
11
+ build-depends : base
12
+ default-language : Haskell2010
Original file line number Diff line number Diff line change
1
+ module Main where
2
+
3
+ import Ide.Types
4
+
5
+ main = putStrLn " Hello, Haskell!"
You can’t perform that action at this time.
0 commit comments