From cf6c91246a987b574f3d3737ea37c80ba7a36319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Tue, 16 Jan 2024 10:53:05 +0100 Subject: [PATCH] Fix -Wunused-packages in hls-cabal-plugin --- plugins/hls-cabal-plugin/hls-cabal-plugin.cabal | 5 +---- plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs | 2 +- plugins/hls-cabal-plugin/test/Context.hs | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/hls-cabal-plugin/hls-cabal-plugin.cabal b/plugins/hls-cabal-plugin/hls-cabal-plugin.cabal index 6e5a15d7cf..4c99507a2c 100644 --- a/plugins/hls-cabal-plugin/hls-cabal-plugin.cabal +++ b/plugins/hls-cabal-plugin/hls-cabal-plugin.cabal @@ -20,7 +20,7 @@ extra-source-files: test/testdata/simple-cabal/simple-cabal.cabal common warnings - ghc-options: -Wall + ghc-options: -Wall -Wunused-packages library import: warnings @@ -80,15 +80,12 @@ test-suite tests , base , bytestring , Cabal-syntax >= 3.7 - , directory , filepath - , ghcide , hls-cabal-plugin , hls-test-utils == 2.6.0.0 , lens , lsp , lsp-types - , tasty-hunit , text , text-rope , transformers diff --git a/plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs b/plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs index c92f82168b..35b8850f0e 100644 --- a/plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs +++ b/plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs @@ -286,7 +286,7 @@ completion recorder ide _ complParams = do (Just cnts, Just path) -> do pref <- VFS.getCompletionPrefix position cnts let res = result pref path cnts - liftIO $ fmap (InL) res + liftIO $ fmap InL res _ -> pure . InR $ InR Null where result :: Maybe VFS.PosPrefixInfo -> FilePath -> VFS.VirtualFile -> IO [CompletionItem] diff --git a/plugins/hls-cabal-plugin/test/Context.hs b/plugins/hls-cabal-plugin/test/Context.hs index e2a7b0290e..63b9ad24bc 100644 --- a/plugins/hls-cabal-plugin/test/Context.hs +++ b/plugins/hls-cabal-plugin/test/Context.hs @@ -78,7 +78,7 @@ getContextTests = , testCase "Cabal version keyword - no value, many spaces" $ do -- on a file, where the "cabal-version:" keyword is already written -- the context should still be top level but the keyword should be recognized - ctx <- callGetContext (Position 0 45) ("") ["cabal-version:" <> T.replicate 50 " "] + ctx <- callGetContext (Position 0 45) "" ["cabal-version:" <> T.replicate 50 " "] ctx @?= (TopLevel, KeyWord "cabal-version:") , testCase "Cabal version keyword - keyword partly written" $ do -- in the first line of the file, if the keyword