-
Notifications
You must be signed in to change notification settings - Fork 61
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
Report what files are dependencies of the Cradle #35
Comments
So, cradleDependencies are files that ghcide needs to watch for changes for, right? |
@fendor - yep! |
One more question, should it only contain files that exist, or all files that may be interesting? E.g. cabal.project may not always exist but as soon as one is added, we would want to know about it right? |
The files don't have to exist - anything relevant would be useful. |
After talking with @mpickering, dependencies of a cradle should be loaded when loading a cradle and it should be possible to query the corresponding build tool. -- | The environment where this library is used.
data Cradle = Cradle {
-- | The project root directory.
cradleRootDir :: FilePath
-- | The action which needs to be executed to get the correct
-- command line arguments
, cradleOptsProg :: CradleAction
} deriving (Show)
data CradleAction = CradleAction
{ actionName :: String
, getDependencies :: IO [FilePath]
-- ^ Files that cause the cradle to change, may be monitored to reload a cradle
, getOptions :: (FilePath -> IO (ExitCode, String, [String]))
-- ^ Options to compile a file in the cradle with.
} Further, extend the Cradle config to include a field cradle deps. This allows users to work around any missed cradle dependencies by supplying them themselves in data CradleType
= Cabal { component :: Maybe String }
| Stack
| Bazel
| Obelisk
| Bios { prog :: FilePath, deps :: Maybe FilePath }
| Direct { arguments :: [String] }
| Default
deriving (Show)
data CradleConfig = CradleConfig
{ cradleType :: CradleType
, cradleDependencies :: Maybe [FilePath]
-- ^ Bikeshed, `Maybe` is not necessary, empty list might be good enough
} Note, the changes to |
Looks sensible to me! |
Sounds right to me.
|
See https://github.com/digital-asset/ghcide/issues/50, which wants ghcide to reload when you update your .cabal file. One option is that a
Cradle
should have an extra fieldcradeDependencies :: [FilePath]
which would give the files which the cradle uses.The text was updated successfully, but these errors were encountered: