Rodrigo Mesquita pushed to branch wip/romes/hsmodulename at Glasgow Haskell Compiler / GHC Commits: f2ed9eea by Rodrigo Mesquita at 2026-09-18T14:29:28+01:00 fixes - - - - - 5 changed files: - ghc/GHCi/UI.hs - ghc/GHCi/UI/Info.hs - linters/lint-codes/LintCodes/Static.hs - testsuite/tests/ghc-api/downsweep/IncrementalDownsweep.hs - testsuite/tests/profiling/should_run/caller-cc/CallerCcParser.hs Changes: ===================================== ghc/GHCi/UI.hs ===================================== @@ -1229,8 +1229,8 @@ getInfoForPrompt = do rev_imports = reverse imports -- rightmost are the most recent myIdeclName :: ImportDecl GhcPs -> ModuleName - myIdeclName d | Just m <- ideclAs d = unLoc m - | otherwise = unLoc (ideclName d) + myIdeclName d | Just m <- ideclAs d = hsModuleName (unLoc m) + | otherwise = hsModuleName (unLoc (ideclName d)) modules_names = ['*':(moduleNameString (moduleName m)) | IIModule m <- rev_imports] ++ @@ -2592,7 +2592,7 @@ keepPackageImports = filterM is_pkg_import Left _ -> return False Right m -> return $ not (HUG.memberHugUnit (moduleUnit m) hug) where - mod_name = unLoc (ideclName d) + mod_name = hsModuleName (unLoc (ideclName d)) {- Note [GHCi and local Preludes] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -2976,8 +2976,9 @@ guessCurrentModule cmd = do [] -> throwGhcException $ CmdLineError (':' : cmd ++ ": no current module") IIModule m : _ -> pure m IIDecl d : _ -> do - pkgqual <- GHC.renameRawPkgQualM (unLoc $ ideclName d) (ideclPkgQual d) - GHC.findQualifiedModule pkgqual (unLoc (ideclName d)) + let mod_name = hsModuleName (unLoc (ideclName d)) + pkgqual <- GHC.renameRawPkgQualM mod_name (ideclPkgQual d) + GHC.findQualifiedModule pkgqual mod_name -- without bang, show items in context of their parents and omit children -- with bang, show class methods and data constructors separately, and @@ -3177,7 +3178,7 @@ checkAdd ii = do | otherwise -> checkInterpretedModule mod >> return () IIDecl d -> do - let modname = unLoc (ideclName d) + let modname = hsModuleName (unLoc (ideclName d)) pkgqual <- GHC.renameRawPkgQualM modname (ideclPkgQual d) m <- lookupQualifiedModuleName pkgqual modname when safe $ do @@ -3257,7 +3258,7 @@ isIIModule _ = False iiModuleName :: InteractiveImport -> ModuleName iiModuleName (IIModule m) = moduleName m -iiModuleName (IIDecl d) = unLoc (ideclName d) +iiModuleName (IIDecl d) = hsModuleName (unLoc (ideclName d)) preludeModuleName :: ModuleName preludeModuleName = GHC.mkModuleName "Prelude" ===================================== ghc/GHCi/UI/Info.hs ===================================== @@ -127,7 +127,7 @@ findLoc infos span0 string = do case getSrcSpan name' of UnhelpfulSpan{} -> throwE $ GhciNoLocationInfoForModule - (maybe (ModuleName "<unknown>") moduleName (nameModule_maybe name')) + (maybe (mkModuleName "<unknown>") moduleName (nameModule_maybe name')) span' -> return (info,name',span') -- | Find any uses of the given identifier in the codebase. ===================================== linters/lint-codes/LintCodes/Static.hs ===================================== @@ -70,7 +70,7 @@ import GHC.Unit.Finder ( FindResult(..), ModuleLookupScope(..), findImportedModule ) import GHC.Utils.Outputable ( text ) -import Language.Haskell.Syntax.Module.Name +import GHC.Unit.Module.Name ( mkModuleName ) -------------------------------------------------------------------------------- ===================================== testsuite/tests/ghc-api/downsweep/IncrementalDownsweep.hs ===================================== @@ -10,7 +10,7 @@ import System.Environment (getArgs) import System.Exit (exitFailure) import System.IO (stderr) import System.Directory (removeFile) -import Language.Haskell.Syntax.Module.Name (moduleNameString) +import GHC.Unit.Module.Name (moduleNameString) import GHC.Utils.Ppr (Mode (PageMode)) import GHC.Utils.Outputable (vcat, defaultSDocContext, printSDocLn, ppr) import GHC.Utils.Logger (getLogger) ===================================== testsuite/tests/profiling/should_run/caller-cc/CallerCcParser.hs ===================================== @@ -3,7 +3,7 @@ module Main where import GHC.Core.Opt.CallerCC -import Language.Haskell.Syntax.Module.Name +import GHC.Unit.Module.Name deriving instance Eq CallerCcFilter deriving instance Show CallerCcFilter View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f2ed9eea98286e2c7b3ddd65a247d626... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f2ed9eea98286e2c7b3ddd65a247d626... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Rodrigo Mesquita (@alt-romes)