Skip to content

Fix -Wall and -Wunused-packages in change-type-signature plugin #3970

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
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,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
exposed-modules: Ide.Plugin.ChangeTypeSignature
hs-source-dirs: src
build-depends:
Expand All @@ -34,9 +38,7 @@ library
, syb
, text
, transformers
, unordered-containers
, containers
ghc-options: -Wall
default-language: Haskell2010
default-extensions:
ConstraintKinds
Expand All @@ -50,18 +52,17 @@ library


test-suite tests
import: warnings
type: exitcode-stdio-1.0
default-language: Haskell2010
hs-source-dirs: test
main-is: Main.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts -Wall
ghc-options: -threaded -rtsopts -with-rtsopts=-N -fno-ignore-asserts
build-depends:
, base >=4.12 && < 5
, filepath
, hls-change-type-signature-plugin
, hls-test-utils == 2.6.0.0
, lsp
, QuickCheck
, regex-tdfa
, text
default-extensions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ codeActionHandler plId ideState _ CodeActionParams {_textDocument = TextDocument
getDecls :: MonadIO m => PluginId -> IdeState -> NormalizedFilePath -> ExceptT PluginError m [LHsDecl GhcPs]
getDecls (PluginId changeTypeSignatureId) state =
runActionE (T.unpack changeTypeSignatureId <> ".GetParsedModule") state
. (fmap (hsmodDecls . unLoc . pm_parsed_source))
. fmap (hsmodDecls . unLoc . pm_parsed_source)
. useE GetParsedModule

-- | Text representing a Declaration's Name
Expand Down
4 changes: 2 additions & 2 deletions plugins/hls-change-type-signature-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ goldenChangeSignature fp = goldenWithHaskellDoc def changeTypeSignaturePlugin (f

codeActionTest :: FilePath -> Int -> Int -> TestTree
codeActionTest fp line col = goldenChangeSignature fp $ \doc -> do
void $ waitForDiagnostics -- code actions are triggered from Diagnostics
void $ waitForAllProgressDone -- apparently some tests need this to get the CodeAction to show up
void waitForDiagnostics -- code actions are triggered from Diagnostics
void waitForAllProgressDone -- apparently some tests need this to get the CodeAction to show up
actions <- getCodeActions doc (pointRange line col)
foundActions <- findChangeTypeActions actions
liftIO $ length foundActions @?= 1
Expand Down