From 89a3acb3d8cf7507a8423c509d5519d3322a2ff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sat, 20 Jan 2024 14:20:55 +0100 Subject: [PATCH 1/2] Fix -Wall and -Wunused-packages in explicit-record-fields plugin --- .../hls-explicit-record-fields-plugin.cabal | 11 +---------- .../src/Ide/Plugin/ExplicitFields.hs | 4 ++-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal b/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal index 89dd02e5fa..a2ed53a84b 100644 --- a/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal +++ b/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal @@ -25,16 +25,13 @@ flag pedantic manual: True common warnings - ghc-options: -Wall + ghc-options: -Wall -Wunused-packages -Wincomplete-record-updates library import: warnings exposed-modules: Ide.Plugin.ExplicitFields - -- other-modules: - -- other-extensions: build-depends: , base >=4.12 && <5 - , ghc , ghcide == 2.6.0.0 , hls-plugin-api == 2.6.0.0 , lsp @@ -43,8 +40,6 @@ library , text , syb , transformers - , ghc-boot-th - , unordered-containers , containers , aeson hs-source-dirs: src @@ -52,13 +47,10 @@ library if flag(pedantic) ghc-options: -Werror - -Wwarn=incomplete-record-updates test-suite tests import: warnings default-language: Haskell2010 - -- other-modules: - -- other-extensions: type: exitcode-stdio-1.0 hs-source-dirs: test main-is: Main.hs @@ -67,5 +59,4 @@ test-suite tests , filepath , text , hls-explicit-record-fields-plugin - , lsp-test , hls-test-utils diff --git a/plugins/hls-explicit-record-fields-plugin/src/Ide/Plugin/ExplicitFields.hs b/plugins/hls-explicit-record-fields-plugin/src/Ide/Plugin/ExplicitFields.hs index a51c283c77..0a2119f9d2 100644 --- a/plugins/hls-explicit-record-fields-plugin/src/Ide/Plugin/ExplicitFields.hs +++ b/plugins/hls-explicit-record-fields-plugin/src/Ide/Plugin/ExplicitFields.hs @@ -40,6 +40,8 @@ import Development.IDE.Core.RuleTypes (TcModuleResult (..), TypeCheck (..)) import qualified Development.IDE.Core.Shake as Shake import Development.IDE.GHC.Compat (HsConDetails (RecCon), + HsExpansion (HsExpanded), + HsExpr (XExpr), HsRecFields (..), LPat, Outputable, getLoc, recDotDot, unLoc) @@ -85,8 +87,6 @@ import Language.LSP.Protocol.Types (CodeAction (..), WorkspaceEdit (WorkspaceEdit), type (|?) (InL, InR)) -import Development.IDE.GHC.Compat (HsExpansion (HsExpanded), - HsExpr (XExpr)) data Log = LogShake Shake.Log From e5089dcadf5c50c982d8f10390f6ccedf03bd271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sat, 20 Jan 2024 20:02:59 +0100 Subject: [PATCH 2/2] Don't remove -Wwarn=incomplete-record-updates --- .../hls-explicit-record-fields-plugin.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal b/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal index a2ed53a84b..8e3e16ed8e 100644 --- a/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal +++ b/plugins/hls-explicit-record-fields-plugin/hls-explicit-record-fields-plugin.cabal @@ -47,6 +47,7 @@ library if flag(pedantic) ghc-options: -Werror + -Wwarn=incomplete-record-updates test-suite tests import: warnings