Skip to content

Remove unused dependencies in hls-refactor-plugin #3953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions plugins/hls-refactor-plugin/hls-refactor-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ source-repository head
type: git
location: https://github.com/haskell/haskell-language-server.git

common warnings
ghc-options: -Wall -Wunused-packages

library
import: warnings
-- Plugins that need exactprint have not been updated for 9.8 yet
if impl(ghc >= 9.8)
buildable: False
Expand Down Expand Up @@ -66,7 +70,6 @@ library
ViewPatterns
hs-source-dirs: src
build-depends:
, aeson
, base >=4.12 && <5
, ghc
, bytestring
Expand Down Expand Up @@ -94,10 +97,11 @@ library
-- FIXME: Only needed to workaround for qualified imports in GHC 9.4
, regex-applicative
, parser-combinators
ghc-options: -Wall -Wno-name-shadowing
ghc-options: -Wno-name-shadowing
default-language: Haskell2010

test-suite tests
import: warnings
if impl(ghc >= 9.8)
buildable: False
else
Expand All @@ -116,25 +120,17 @@ test-suite tests
, lens
, lsp-types
, text
, aeson
, hls-plugin-api
, parser-combinators
, data-default
, extra
, text-rope
, containers
-- ghc is included to enable the MIN_VERSION_ghc macro
, ghc
, ghcide
, ghcide-test-utils
, shake
, hls-plugin-api
, lsp-test
, network-uri
, directory
, async
, regex-tdfa
, tasty-rerun
, tasty-hunit
, tasty-expected-failure
, tasty
60 changes: 24 additions & 36 deletions plugins/hls-refactor-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
Expand Down Expand Up @@ -2388,11 +2386,9 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
, ""
, "f = 1"
])
#if MIN_VERSION_ghc(9,4,0)
[ (DiagnosticSeverity_Warning, (3, 4), "Defaulting the type variable") ]
#else
[ (DiagnosticSeverity_Warning, (3, 4), "Defaulting the following constraint") ]
#endif
(if ghcVersion >= GHC94
then [ (DiagnosticSeverity_Warning, (3, 4), "Defaulting the type variable") ]
else [ (DiagnosticSeverity_Warning, (3, 4), "Defaulting the following constraint") ])
"Add type annotation ‘Integer’ to ‘1’"
(T.unlines [ "{-# OPTIONS_GHC -Wtype-defaults #-}"
, "module A (f) where"
Expand All @@ -2409,11 +2405,9 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
, " let x = 3"
, " in x"
])
#if MIN_VERSION_ghc(9,4,0)
[ (DiagnosticSeverity_Warning, (4, 12), "Defaulting the type variable") ]
#else
[ (DiagnosticSeverity_Warning, (4, 12), "Defaulting the following constraint") ]
#endif
(if ghcVersion >= GHC94
then [ (DiagnosticSeverity_Warning, (4, 12), "Defaulting the type variable") ]
else [ (DiagnosticSeverity_Warning, (4, 12), "Defaulting the following constraint") ])
"Add type annotation ‘Integer’ to ‘3’"
(T.unlines [ "{-# OPTIONS_GHC -Wtype-defaults #-}"
, "module A where"
Expand All @@ -2431,11 +2425,9 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
, " let x = let y = 5 in y"
, " in x"
])
#if MIN_VERSION_ghc(9,4,0)
[ (DiagnosticSeverity_Warning, (4, 20), "Defaulting the type variable") ]
#else
[ (DiagnosticSeverity_Warning, (4, 20), "Defaulting the following constraint") ]
#endif
(if ghcVersion >= GHC94
then [ (DiagnosticSeverity_Warning, (4, 20), "Defaulting the type variable") ]
else [ (DiagnosticSeverity_Warning, (4, 20), "Defaulting the following constraint") ])
"Add type annotation ‘Integer’ to ‘5’"
(T.unlines [ "{-# OPTIONS_GHC -Wtype-defaults #-}"
, "module A where"
Expand All @@ -2454,15 +2446,15 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
, ""
, "f = seq \"debug\" traceShow \"debug\""
])
#if MIN_VERSION_ghc(9,4,0)
[ (DiagnosticSeverity_Warning, (6, 8), "Defaulting the type variable")
, (DiagnosticSeverity_Warning, (6, 16), "Defaulting the type variable")
]
#else
[ (DiagnosticSeverity_Warning, (6, 8), "Defaulting the following constraint")
, (DiagnosticSeverity_Warning, (6, 16), "Defaulting the following constraint")
]
#endif
(if ghcVersion >= GHC94
then
[ (DiagnosticSeverity_Warning, (6, 8), "Defaulting the type variable")
, (DiagnosticSeverity_Warning, (6, 16), "Defaulting the type variable")
]
else
[ (DiagnosticSeverity_Warning, (6, 8), "Defaulting the following constraint")
, (DiagnosticSeverity_Warning, (6, 16), "Defaulting the following constraint")
])
("Add type annotation ‘" <> listOfChar <> "’ to ‘\"debug\"’")
(T.unlines [ "{-# OPTIONS_GHC -Wtype-defaults #-}"
, "{-# LANGUAGE OverloadedStrings #-}"
Expand All @@ -2482,11 +2474,9 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
, ""
, "f a = traceShow \"debug\" a"
])
#if MIN_VERSION_ghc(9,4,0)
[ (DiagnosticSeverity_Warning, (6, 6), "Defaulting the type variable") ]
#else
[ (DiagnosticSeverity_Warning, (6, 6), "Defaulting the following constraint") ]
#endif
(if ghcVersion >= GHC94
then [ (DiagnosticSeverity_Warning, (6, 6), "Defaulting the type variable") ]
else [ (DiagnosticSeverity_Warning, (6, 6), "Defaulting the following constraint") ])
("Add type annotation ‘" <> listOfChar <> "’ to ‘\"debug\"’")
(T.unlines [ "{-# OPTIONS_GHC -Wtype-defaults #-}"
, "{-# LANGUAGE OverloadedStrings #-}"
Expand All @@ -2506,11 +2496,9 @@ addTypeAnnotationsToLiteralsTest = testGroup "add type annotations to literals t
, ""
, "f = seq (\"debug\" :: [Char]) (seq (\"debug\" :: [Char]) (traceShow \"debug\"))"
])
#if MIN_VERSION_ghc(9,4,0)
[ (DiagnosticSeverity_Warning, (6, 54), "Defaulting the type variable") ]
#else
[ (DiagnosticSeverity_Warning, (6, 54), "Defaulting the following constraint") ]
#endif
(if ghcVersion >= GHC94
then [ (DiagnosticSeverity_Warning, (6, 54), "Defaulting the type variable") ]
else [ (DiagnosticSeverity_Warning, (6, 54), "Defaulting the following constraint") ])
("Add type annotation ‘" <> listOfChar <> "’ to ‘\"debug\"’")
(T.unlines [ "{-# OPTIONS_GHC -Wtype-defaults #-}"
, "{-# LANGUAGE OverloadedStrings #-}"
Expand Down