From c77dda060ecc5d72519a27d172f67778630c7b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sat, 11 Apr 2026 15:37:19 +0200 Subject: [PATCH 1/4] Cleanup 9.4 leftovers, fix couple -Wunused-packages and import warnings --- .gitignore | 4 -- cabal.project | 43 ++++++++----------- ghcide-test/exe/BootTests.hs | 2 +- ghcide-test/exe/DiagnosticTests.hs | 2 - ghcide-test/exe/IfaceTests.hs | 1 - ghcide/ghcide.cabal | 1 - ghcide/src/Development/IDE/Core/Compile.hs | 38 ++++++---------- ghcide/src/Development/IDE/Core/FileStore.hs | 1 - ghcide/src/Development/IDE/Core/RuleTypes.hs | 3 +- ghcide/src/Development/IDE/Core/Rules.hs | 4 +- ghcide/src/Development/IDE/Core/Shake.hs | 1 - ghcide/src/Development/IDE/GHC/Compat.hs | 1 + ghcide/src/Development/IDE/GHC/Compat/Core.hs | 4 -- .../src/Development/IDE/Plugin/TypeLenses.hs | 6 +-- ghcide/src/Development/IDE/Spans/Pragmas.hs | 5 --- ghcide/src/Development/IDE/Types/HscEnvEq.hs | 4 -- haskell-language-server.cabal | 9 ---- .../src/Ide/Plugin/Eval/Handlers.hs | 1 - 18 files changed, 38 insertions(+), 92 deletions(-) diff --git a/.gitignore b/.gitignore index 2413a1fcf5..995653ecf8 100644 --- a/.gitignore +++ b/.gitignore @@ -20,10 +20,6 @@ shake.yaml.lock .vscode /test-logs/*.log -# stack 2.1 stack.yaml lock files -stack*.yaml.lock -shake.yaml.lock - # ignore hie.yaml's for testdata test/testdata/**/hie.yaml diff --git a/cabal.project b/cabal.project index df38c76543..85cd507433 100644 --- a/cabal.project +++ b/cabal.project @@ -59,36 +59,31 @@ if impl(ghc >= 9.11) if impl(ghc >= 9.14) allow-newer: + aeson:containers, + aeson:template-haskell, + aeson:time, + binary-instances:base, + binary-instances:tagged, + binary-orphans:base, + boring:base, + cabal-install-parsers:containers, + constraints-extras:template-haskell, + dependent-map:containers, + ghc-trace-events:base, + hie-compat:base, + indexed-traversable:base, indexed-traversable:containers, + indexed-traversable-instances:base, + lukko:base, + quickcheck-instances:base, quickcheck-instances:containers, - dependent-map:containers, - aeson:containers, + semialign:base, semialign:containers, string-interpolate:template-haskell, tasty-hspec:base, - tagged:template-haskell, - indexed-traversable:base, - quickcheck-instances:base, + text-iso8601:time, + these:base, time-compat:base, time-compat:time, - these:base, - some:base, - boring:base, - indexed-traversable-instances:base, uuid-types:template-haskell, - hie-compat:base, - ghc-trace-events:base, - constraints-extras:template-haskell, - aeson:time, - text-iso8601:time, - semialign:base, - aeson:template-haskell, - lukko:base, - binary-instances:base, - binary-orphans:base, - cabal-install-parsers:containers, - haddock-library:base, websockets:containers, - monad-control:transformers, - mmorph:transformers-compat, - binary-instances:tagged, diff --git a/ghcide-test/exe/BootTests.hs b/ghcide-test/exe/BootTests.hs index e6bec54dae..a2b73a88be 100644 --- a/ghcide-test/exe/BootTests.hs +++ b/ghcide-test/exe/BootTests.hs @@ -1,6 +1,6 @@ module BootTests (tests) where -import Config (checkDefs, mkR, runInDir, +import Config (checkDefs, mkR, runWithExtraFiles) import Control.Applicative.Combinators import Control.Monad diff --git a/ghcide-test/exe/DiagnosticTests.hs b/ghcide-test/exe/DiagnosticTests.hs index a0e9ae2768..99f2191f3b 100644 --- a/ghcide-test/exe/DiagnosticTests.hs +++ b/ghcide-test/exe/DiagnosticTests.hs @@ -9,7 +9,6 @@ import Control.Monad import Control.Monad.IO.Class (liftIO) import Data.List.Extra import qualified Data.Text as T -import Development.IDE.GHC.Compat (GhcVersion (..), ghcVersion) import Development.IDE.GHC.Util import Development.IDE.Test (diagnostic, expectCurrentDiagnostics, @@ -28,7 +27,6 @@ import Language.LSP.Protocol.Types hiding import Language.LSP.Test import System.Directory import System.FilePath -import System.IO.Extra hiding (withTempDir) import Config import Control.Lens ((^.)) diff --git a/ghcide-test/exe/IfaceTests.hs b/ghcide-test/exe/IfaceTests.hs index e1e94c926d..3ba630834e 100644 --- a/ghcide-test/exe/IfaceTests.hs +++ b/ghcide-test/exe/IfaceTests.hs @@ -17,7 +17,6 @@ import Language.LSP.Protocol.Types hiding import Language.LSP.Test import System.Directory import System.FilePath -import System.IO.Extra hiding (withTempDir) import Test.Hls.FileSystem import Test.Tasty import Test.Tasty.HUnit diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index 479760074c..18091e2ddc 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -87,7 +87,6 @@ library , mtl , opentelemetry >=0.6.1 , optparse-applicative - , os-string , parallel , process , prettyprinter >=1.7 diff --git a/ghcide/src/Development/IDE/Core/Compile.hs b/ghcide/src/Development/IDE/Core/Compile.hs index 5a83300006..c3ee912a18 100644 --- a/ghcide/src/Development/IDE/Core/Compile.hs +++ b/ghcide/src/Development/IDE/Core/Compile.hs @@ -1172,13 +1172,10 @@ withBootSuffix _ = id getModSummaryFromImports :: HscEnv -> FilePath - -> UTCTime -> Maybe Util.StringBuffer -> ExceptT [FileDiagnostic] IO ModSummaryResult --- modTime is only used in GHC < 9.4 -getModSummaryFromImports env fp _modTime mContents = do --- src_hash is only used in GHC >= 9.4 - (contents, opts, ppEnv, _src_hash) <- preprocessor env fp mContents +getModSummaryFromImports env fp mContents = do + (contents, opts, ppEnv, src_hash) <- preprocessor env fp mContents let dflags = hsc_dflags ppEnv @@ -1194,8 +1191,7 @@ getModSummaryFromImports env fp _modTime mContents = do (src_idecls, ord_idecls) = partition ((== IsBoot) . ideclSource.unLoc) imps -- GHC.Prim doesn't exist physically, so don't go looking for it. - -- ghc_prim_imports is only used in GHC >= 9.4 - (ordinary_imps, _ghc_prim_imports) + (ordinary_imps, ghc_prim_imports) = partition ((/= moduleName gHC_PRIM) . unLoc . ideclName . unLoc) ord_idecls @@ -1233,7 +1229,7 @@ getModSummaryFromImports env fp _modTime mContents = do srcImports = rn_imps $ map convImport src_idecls textualImports = rn_imps $ map convImport (implicit_imports ++ ordinary_imps) #endif - ghc_prim_import = not (null _ghc_prim_imports) + ghc_prim_import = not (null ghc_prim_imports) -- Force bits that might keep the string buffer and DynFlags alive unnecessarily @@ -1253,11 +1249,11 @@ getModSummaryFromImports env fp _modTime mContents = do ModSummary { ms_mod = modl , ms_hie_date = Nothing - , ms_dyn_obj_date = Nothing + , ms_dyn_obj_date = Nothing #if !MIN_VERSION_ghc(9,13,0) , ms_ghc_prim_import = ghc_prim_import #endif - , ms_hs_hash = _src_hash + , ms_hs_hash = src_hash , ms_hsc_src = sourceType -- The contents are used by the GetModSummary rule @@ -1539,25 +1535,15 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do Just ver -> pure $ Just ver Nothing -> get_file_version (toNormalizedFilePath' iface_file) - -- The source is modified if it is newer than the destination (iface file) - -- A more precise check for the core file is performed later - let _sourceMod = case mb_dest_version of -- sourceMod is only used in GHC < 9.4 - Nothing -> SourceModified -- destination file doesn't exist, assume modified source - Just dest_version - | source_version <= dest_version -> SourceUnmodified - | otherwise -> SourceModified - - -- old_iface is only used in GHC >= 9.4 - _old_iface <- case mb_old_iface of + old_iface <- case mb_old_iface of Just iface -> pure (Just iface) Nothing -> do - -- ncu and read_dflags are only used in GHC >= 9.4 - let _ncu = hsc_NC sessionWithMsDynFlags - _read_dflags = hsc_dflags sessionWithMsDynFlags + let ncu = hsc_NC sessionWithMsDynFlags + read_dflags = hsc_dflags sessionWithMsDynFlags #if MIN_VERSION_ghc(9,13,0) - read_result <- liftIO $ readIface (hsc_hooks sessionWithMsDynFlags) (hsc_logger sessionWithMsDynFlags) _read_dflags _ncu mod iface_file + read_result <- liftIO $ readIface (hsc_hooks sessionWithMsDynFlags) (hsc_logger sessionWithMsDynFlags) read_dflags ncu mod iface_file #else - read_result <- liftIO $ readIface _read_dflags _ncu mod iface_file + read_result <- liftIO $ readIface read_dflags ncu mod iface_file #endif case read_result of Util.Failed{} -> return Nothing @@ -1568,7 +1554,7 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do -- If mb_old_iface is nothing then checkOldIface will load it for us -- given that the source is unmodified (recomp_iface_reqd, mb_checked_iface) - <- liftIO $ checkOldIface sessionWithMsDynFlags ms _old_iface >>= \case + <- liftIO $ checkOldIface sessionWithMsDynFlags ms old_iface >>= \case UpToDateItem x -> pure (UpToDate, Just x) OutOfDateItem reason x -> pure (NeedsRecompile reason, x) diff --git a/ghcide/src/Development/IDE/Core/FileStore.hs b/ghcide/src/Development/IDE/Core/FileStore.hs index 37177a22d1..7d253131d6 100644 --- a/ghcide/src/Development/IDE/Core/FileStore.hs +++ b/ghcide/src/Development/IDE/Core/FileStore.hs @@ -25,7 +25,6 @@ module Development.IDE.Core.FileStore( ) where import Control.Concurrent.STM.Stats (STM, atomically) -import Control.Concurrent.STM.TQueue (writeTQueue) import Control.Exception import Control.Lens ((^.)) import Control.Monad.Extra diff --git a/ghcide/src/Development/IDE/Core/RuleTypes.hs b/ghcide/src/Development/IDE/Core/RuleTypes.hs index 8798068b45..e10c26e953 100644 --- a/ghcide/src/Development/IDE/Core/RuleTypes.hs +++ b/ghcide/src/Development/IDE/Core/RuleTypes.hs @@ -25,8 +25,7 @@ import qualified Data.Map as M import Data.Time.Clock.POSIX import Data.Typeable import Development.IDE.GHC.Compat hiding - (HieFileResult, - assert) + (HieFileResult) import Development.IDE.GHC.Compat.Util import Development.IDE.GHC.CoreFile import Development.IDE.GHC.Util diff --git a/ghcide/src/Development/IDE/Core/Rules.hs b/ghcide/src/Development/IDE/Core/Rules.hs index 6a9b8bd274..fbd2a5e426 100644 --- a/ghcide/src/Development/IDE/Core/Rules.hs +++ b/ghcide/src/Development/IDE/Core/Rules.hs @@ -924,10 +924,10 @@ getModSummaryRule displayTHWarning recorder = do session' <- hscEnv <$> use_ GhcSession f modify_dflags <- getModifyDynFlags dynFlagsModifyGlobal let session = setNonHomeFCHook $ hscSetFlags (modify_dflags $ hsc_dflags session') session' -- TODO wz1000 - (modTime, mFileContent) <- getFileModTimeContents f + (_modTime, mFileContent) <- getFileModTimeContents f let fp = fromNormalizedFilePath f modS <- liftIO $ runExceptT $ - getModSummaryFromImports session fp modTime (textToStringBuffer . Rope.toText <$> mFileContent) + getModSummaryFromImports session fp (textToStringBuffer . Rope.toText <$> mFileContent) case modS of Right res -> do -- Check for Template Haskell diff --git a/ghcide/src/Development/IDE/Core/Shake.hs b/ghcide/src/Development/IDE/Core/Shake.hs index c9e8b7b45e..ca31414b32 100644 --- a/ghcide/src/Development/IDE/Core/Shake.hs +++ b/ghcide/src/Development/IDE/Core/Shake.hs @@ -130,7 +130,6 @@ import Development.IDE.Core.RuleTypes import Development.IDE.Types.Options as Options import qualified Language.LSP.Protocol.Message as LSP import qualified Language.LSP.Server as LSP -import qualified Language.LSP.VFS as VFS import Development.IDE.Core.Tracing import Development.IDE.Core.WorkerThread diff --git a/ghcide/src/Development/IDE/GHC/Compat.hs b/ghcide/src/Development/IDE/GHC/Compat.hs index c8f6282338..ab581de480 100644 --- a/ghcide/src/Development/IDE/GHC/Compat.hs +++ b/ghcide/src/Development/IDE/GHC/Compat.hs @@ -506,5 +506,6 @@ recDotDot x = unRecFieldsDotDot <$> unLoc <$> rec_dotdot x +extract_cons :: DataDefnCons a -> [a] extract_cons (NewTypeCon x) = [x] extract_cons (DataTypeCons _ xs) = xs diff --git a/ghcide/src/Development/IDE/GHC/Compat/Core.hs b/ghcide/src/Development/IDE/GHC/Compat/Core.hs index 93c860ac7b..3123c15003 100644 --- a/ghcide/src/Development/IDE/GHC/Compat/Core.hs +++ b/ghcide/src/Development/IDE/GHC/Compat/Core.hs @@ -484,7 +484,6 @@ import qualified GHC.Utils.Panic.Plain as Plain import Data.Foldable (toList) import GHC.Core.Multiplicity (scaledThing) -import GHC.Data.Bag import qualified GHC.Data.Strict as Strict import qualified GHC.Driver.Config.Finder as GHC import qualified GHC.Driver.Config.Tidy as GHC @@ -531,9 +530,6 @@ import GHC.Unit.Module.Graph import GHC.Unit.Module.Imported import GHC.Unit.Module.ModDetails import GHC.Unit.Module.ModGuts -#if !MIN_VERSION_ghc(9,9,0) -import GHC.Hs (SrcSpanAnn') -#endif import GHC.Unit.Module.ModIface (IfaceExport, ModIface, ModIface_ (..), mi_fix #if MIN_VERSION_ghc(9,11,0) diff --git a/ghcide/src/Development/IDE/Plugin/TypeLenses.hs b/ghcide/src/Development/IDE/Plugin/TypeLenses.hs index 63a0a9a7fa..cad7fdc65a 100644 --- a/ghcide/src/Development/IDE/Plugin/TypeLenses.hs +++ b/ghcide/src/Development/IDE/Plugin/TypeLenses.hs @@ -16,7 +16,7 @@ module Development.IDE.Plugin.TypeLenses ( import Control.Concurrent.STM.Stats (atomically) import Control.DeepSeq (rwhnf) -import Control.Lens (to, (?~), (^?)) +import Control.Lens ((?~), (^?)) import Control.Monad (mzero) import Control.Monad.Extra (whenMaybe) import Control.Monad.IO.Class (MonadIO (liftIO)) @@ -51,8 +51,7 @@ import qualified Development.IDE.Core.Shake as Shake import Development.IDE.GHC.Compat import Development.IDE.GHC.Compat.Error (_TcRnMessage, _TcRnMissingSignature, - msgEnvelopeErrorL, - stripTcRnMessageContext) + msgEnvelopeErrorL) import Development.IDE.GHC.Util (printName) import Development.IDE.Graph.Classes import Development.IDE.Types.Location (Position (Position, _line), @@ -91,7 +90,6 @@ import Language.LSP.Protocol.Types (ApplyWorkspaceEditParams TextEdit (TextEdit), WorkspaceEdit (WorkspaceEdit), type (|?) (..)) -import Text.Regex.TDFA ((=~)) data Log = LogShake Shake.Log deriving Show diff --git a/ghcide/src/Development/IDE/Spans/Pragmas.hs b/ghcide/src/Development/IDE/Spans/Pragmas.hs index 4df16c6704..96766c4e7c 100644 --- a/ghcide/src/Development/IDE/Spans/Pragmas.hs +++ b/ghcide/src/Development/IDE/Spans/Pragmas.hs @@ -40,12 +40,7 @@ getNextPragmaInfo dynFlags mbSource = | otherwise -> NextPragmaInfo 0 Nothing --- NOTE(ozkutuk): `RecordPuns` extension is renamed to `NamedFieldPuns` --- in GHC 9.4, but we still want to insert `NamedFieldPuns` in pre-9.4 --- GHC as well, hence the replacement. --- https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6156 showExtension :: Extension -> Text -showExtension NamedFieldPuns = "NamedFieldPuns" showExtension ext = pack (show ext) insertNewPragma :: NextPragmaInfo -> Extension -> LSP.TextEdit diff --git a/ghcide/src/Development/IDE/Types/HscEnvEq.hs b/ghcide/src/Development/IDE/Types/HscEnvEq.hs index 293326c372..e288e7b99b 100644 --- a/ghcide/src/Development/IDE/Types/HscEnvEq.hs +++ b/ghcide/src/Development/IDE/Types/HscEnvEq.hs @@ -15,7 +15,6 @@ import Control.Exception (evaluate, mask, throwIO) import Control.Monad.Extra (eitherM, join, mapMaybeM) import Data.Either (fromRight) import Data.IORef -import qualified Data.Map as M import Data.Unique (Unique) import qualified Data.Unique as Unique import Development.IDE.GHC.Compat hiding (newUnique) @@ -25,9 +24,7 @@ import Development.IDE.GHC.Util (lookupPackageConfig) import Development.IDE.Graph.Classes import Development.IDE.Types.Exports (ExportsMap, createExportsMap) import GHC.Driver.Env (hsc_all_home_unit_ids) -import Ide.PluginUtils (toAbsolute) import OpenTelemetry.Eventlog (withSpan) -import System.Directory (makeAbsolute) -- | An 'HscEnv' with equality. Two values are considered equal @@ -54,7 +51,6 @@ newHscEnvEq :: HscEnv -> IO HscEnvEq newHscEnvEq hscEnv' = do mod_cache <- newIORef emptyInstalledModuleEnv - file_cache <- newIORef M.empty -- This finder cache is for things which are outside of things which are tracked -- by HLS. For example, non-home modules, dependent object files etc #if MIN_VERSION_ghc(9,11,0) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 682d81dd10..0b18f35805 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -899,9 +899,6 @@ test-suite hls-signature-help-plugin-tests , ghcide , haskell-language-server:hls-signature-help-plugin , hls-test-utils == 2.13.0.0 - , lens - , lsp-types - , string-interpolate >= 0.3.1 , text default-extensions: DerivingStrategies @@ -934,10 +931,8 @@ library hls-pragmas-plugin , ghcide == 2.13.0.0 , hls-plugin-api == 2.13.0.0 , lens - , lens-aeson , lsp , text - , transformers , containers test-suite hls-pragmas-plugin-tests @@ -1667,9 +1662,6 @@ library hls-refactor-plugin , mtl , lens , time - -- FIXME: Only needed to workaround for qualified imports in GHC 9.4 - , regex-applicative - , parser-combinators if impl(ghc < 9.10) build-depends: data-default @@ -1697,7 +1689,6 @@ test-suite hls-refactor-plugin-tests , regex-tdfa , shake , tasty - , tasty-expected-failure , tasty-hunit , text diff --git a/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Handlers.hs b/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Handlers.hs index 6aa3b94dad..46e7366d06 100644 --- a/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Handlers.hs +++ b/plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Handlers.hs @@ -90,7 +90,6 @@ import GHC.Types.SrcLoc (UnhelpfulSpanReas #if MIN_VERSION_ghc(9,13,0) import GHC.Types.Avail (DetOrdAvails (DefinitelyDeterministicAvails), sortAvails) -import GHC.Tc.Types (tcg_exports) import GHC.Types.Name.Set (nameSetElemsStable) #endif import Ide.Logger (Priority (..), From a7c1685476b270c27f092eaea75bac0b80855372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sat, 11 Apr 2026 16:04:56 +0200 Subject: [PATCH 2/4] modTime no longer needed --- ghcide/src/Development/IDE/Core/Rules.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ghcide/src/Development/IDE/Core/Rules.hs b/ghcide/src/Development/IDE/Core/Rules.hs index fbd2a5e426..723e1784e6 100644 --- a/ghcide/src/Development/IDE/Core/Rules.hs +++ b/ghcide/src/Development/IDE/Core/Rules.hs @@ -101,7 +101,6 @@ import Development.IDE.Core.Compile import Development.IDE.Core.FileExists hiding (Log, LogShake) import Development.IDE.Core.FileStore (getFileContents, - getFileModTimeContents, getModTime) import Development.IDE.Core.IdeConfiguration import Development.IDE.Core.OfInterest hiding (Log, @@ -924,7 +923,7 @@ getModSummaryRule displayTHWarning recorder = do session' <- hscEnv <$> use_ GhcSession f modify_dflags <- getModifyDynFlags dynFlagsModifyGlobal let session = setNonHomeFCHook $ hscSetFlags (modify_dflags $ hsc_dflags session') session' -- TODO wz1000 - (_modTime, mFileContent) <- getFileModTimeContents f + mFileContent <- getFileContents f let fp = fromNormalizedFilePath f modS <- liftIO $ runExceptT $ getModSummaryFromImports session fp (textToStringBuffer . Rope.toText <$> mFileContent) From dfd760da00ff85a3076aa45a9967a3fc657d1e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sat, 11 Apr 2026 19:25:17 +0200 Subject: [PATCH 3/4] More cleanups --- haskell-language-server.cabal | 2 -- plugins/hls-gadt-plugin/src/Ide/Plugin/GADT.hs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 0b18f35805..60d4a5c810 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1224,7 +1224,6 @@ test-suite hls-change-type-signature-plugin-tests build-depends: , filepath , haskell-language-server:hls-change-type-signature-plugin - , hls-plugin-api , hls-test-utils == 2.13.0.0 , regex-tdfa , text @@ -1735,7 +1734,6 @@ library hls-semantic-tokens-plugin , text , transformers , bytestring - , syb , array , deepseq , dlist diff --git a/plugins/hls-gadt-plugin/src/Ide/Plugin/GADT.hs b/plugins/hls-gadt-plugin/src/Ide/Plugin/GADT.hs index 7aefa2c524..2e7996db0b 100644 --- a/plugins/hls-gadt-plugin/src/Ide/Plugin/GADT.hs +++ b/plugins/hls-gadt-plugin/src/Ide/Plugin/GADT.hs @@ -86,7 +86,7 @@ codeActionHandler :: PluginMethodHandler IdeState Method_TextDocumentCodeAction codeActionHandler state plId (CodeActionParams _ _ doc range _) = withExceptT handleGhcidePluginError $ do nfp <- withExceptT GhcidePluginErrors $ getNormalizedFilePathE (doc ^. L.uri) (inRangeH98Decls, _) <- getInRangeH98DeclsAndExts state range nfp - let actions = map (mkAction . printOutputable . tcdLName . unLoc) inRangeH98Decls + let actions = map (mkAction . printOutputable . tyClDeclLName . unLoc) inRangeH98Decls pure $ InL actions where mkAction :: T.Text -> Command |? CodeAction From cd0d5d8cc21d28080d726609ea20eb3daf700ded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sun, 12 Apr 2026 11:26:41 +0200 Subject: [PATCH 4/4] Fix more warnings that afflict all supported ghc versions --- ghcide-test/exe/FindImplementationAndHoverTests.hs | 2 +- ghcide/src/Development/IDE/Core/Compile.hs | 5 ----- ghcide/src/Development/IDE/Types/Diagnostics.hs | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/ghcide-test/exe/FindImplementationAndHoverTests.hs b/ghcide-test/exe/FindImplementationAndHoverTests.hs index 6a0a0bba8f..8a435ab6d8 100644 --- a/ghcide-test/exe/FindImplementationAndHoverTests.hs +++ b/ghcide-test/exe/FindImplementationAndHoverTests.hs @@ -168,7 +168,7 @@ tests = let ] where yes :: (TestTree -> Maybe TestTree) yes = Just -- test should run and pass - no = const Nothing -- don't run this test at all + _no = const Nothing -- don't run this test at all -- ---------------------------------------------------------------------------- -- Helper functions for creating hover message verification diff --git a/ghcide/src/Development/IDE/Core/Compile.hs b/ghcide/src/Development/IDE/Core/Compile.hs index c3ee912a18..6ce05b5236 100644 --- a/ghcide/src/Development/IDE/Core/Compile.hs +++ b/ghcide/src/Development/IDE/Core/Compile.hs @@ -1524,17 +1524,12 @@ loadInterface loadInterface session ms linkableNeeded RecompilationInfo{..} = do let sessionWithMsDynFlags = hscSetFlags (ms_hspp_opts ms) session mb_old_iface = hirModIface . fst <$> old_value - mb_old_version = snd <$> old_value core_file = ml_core_file (ms_location ms) iface_file = ml_hi_file (ms_location ms) !mod = ms_mod ms - mb_dest_version <- case mb_old_version of - Just ver -> pure $ Just ver - Nothing -> get_file_version (toNormalizedFilePath' iface_file) - old_iface <- case mb_old_iface of Just iface -> pure (Just iface) Nothing -> do diff --git a/ghcide/src/Development/IDE/Types/Diagnostics.hs b/ghcide/src/Development/IDE/Types/Diagnostics.hs index 5072fa7ffa..d91a12ddad 100644 --- a/ghcide/src/Development/IDE/Types/Diagnostics.hs +++ b/ghcide/src/Development/IDE/Types/Diagnostics.hs @@ -29,7 +29,6 @@ module Development.IDE.Types.Diagnostics ( attachReason, attachedReason) where -import Control.Applicative ((<|>)) import Control.DeepSeq import Control.Lens import qualified Data.Aeson as JSON