diff --git a/app/Main.hs b/app/Main.hs index 62fa4e3..361e09e 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -23,6 +23,7 @@ main = do let name = if | any (("dist-newstyle" ==) . takeFileName) files -> "cabal" | any ((".stack-work" ==) . takeFileName) files -> "stack" + | any (("cabal.project" ==) . takeFileName) files -> "cabal" | any (("stack.yaml" ==) . takeFileName) files -> "stack" | otherwise -> "cabal" cfs <- runMaybeT $ case name of diff --git a/src/Hie/Locate.hs b/src/Hie/Locate.hs index c5bd501..57bbcb5 100644 --- a/src/Hie/Locate.hs +++ b/src/Hie/Locate.hs @@ -37,7 +37,10 @@ instance FromJSON Pkgs where stackYamlPkgs :: FilePath -> MaybeT IO [FilePath] stackYamlPkgs p = liftIO $ decodeFileEither (p "stack.yaml") >>= \case - Right (Pkgs f) -> pure f + Right (Pkgs f) -> + liftIO $ + map (p ) + <$> getDirectoryFiles p (map ( "*.cabal") f) Left e -> fail $ show e cabalPkgs :: FilePath -> MaybeT IO [FilePath]