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
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
@@ -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:
@@ -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
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
@@ -2,7 +2,6 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ViewPatterns #-}

{-# OPTIONS_GHC -Wall -Wwarn -fno-warn-type-defaults #-}
@@ -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
1 change: 0 additions & 1 deletion plugins/hls-module-name-plugin/test/Main.hs
Original file line number Diff line number Diff line change
@@ -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
]
Original file line number Diff line number Diff line change
@@ -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
@@ -35,8 +35,6 @@ library
, text
, syb
, transformers
, ghc-boot-th
, unordered-containers
, containers
, deepseq
hs-source-dirs: src
@@ -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