Skip to content

Fix -Wall and -Wunused-packages in module name and overloaded record dot plugins #4009

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
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
6 changes: 5 additions & 1 deletion plugins/hls-module-name-plugin/hls-module-name-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,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.ModuleName
hs-source-dirs: src
build-depends:
Expand All @@ -37,11 +41,11 @@ library
, lsp
, text
, transformers
, unordered-containers

default-language: Haskell2010

test-suite tests
import: warnings
type: exitcode-stdio-1.0
default-language: Haskell2010
hs-source-dirs: test
Expand Down
3 changes: 1 addition & 2 deletions plugins/hls-module-name-plugin/src/Ide/Plugin/ModuleName.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ViewPatterns #-}

{-# OPTIONS_GHC -Wall -Wwarn -fno-warn-type-defaults #-}
Expand Down Expand Up @@ -133,7 +132,7 @@ action recorder state uri = do
| emptyModule ->
let code = "module " <> bestName <> " where\n"
in pure [Replace uri (Range (Position 0 0) (Position 0 0)) code code]
_ -> pure $ []
_ -> pure []

-- | Possible module names, as derived by the position of the module in the
-- source directories. There may be more than one possible name, if the source
Expand Down
1 change: 0 additions & 1 deletion plugins/hls-module-name-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ tests =
let edit = TextEdit (mkRange 1 0 1 0) "f ="
_ <- applyEdit doc edit
newLens <- getCodeLenses doc
txt <- documentContents doc
liftIO $ newLens @?= oldLens
closeDoc doc
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ source-repository head
location: https://github.com/haskell/haskell-language-server

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

library
import: warnings
Expand All @@ -35,8 +35,6 @@ library
, text
, syb
, transformers
, ghc-boot-th
, unordered-containers
, containers
, deepseq
hs-source-dirs: src
Expand All @@ -51,13 +49,7 @@ test-suite tests
build-depends:
, base
, filepath
, ghcide
, text
, hls-overloaded-record-dot-plugin
, hls-plugin-api
, lens
, lsp-test
, lsp-types
, row-types
, hls-test-utils