-
-
Notifications
You must be signed in to change notification settings - Fork 401
Open
Labels
Description
Currently we need to use a regex to figure out whether an error message relates to an unknown module.
With a structured erro, we could handle this in a cleaner and safer way.
We are currently generating it like this:
unknownModuleMessage :: String -> [String]
unknownModuleMessage moduleFileName =
[ "Loading the module '" <> moduleFileName <> "' failed."
, ""
, "It may not be listed in your .cabal file!"
, "Perhaps you need to add `"<> dropExtension (takeFileName moduleFileName) <> "` to other-modules or exposed-modules."
, ""
, "For more information, visit: https://cabal.readthedocs.io/en/3.4/developing-packages.html#modules-included-in-the-package"
]
Specifically, this would help in the new cabal-add-module code action, where I had to parse the string using a regex.