Skip to content

Commit 58d7293

Browse files
committed
Make ordering consistent with hie-bios + Fix stack
1 parent b794a57 commit 58d7293

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

app/Main.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ main = do
2323
let name =
2424
if | any (("dist-newstyle" ==) . takeFileName) files -> "cabal"
2525
| any ((".stack-work" ==) . takeFileName) files -> "stack"
26+
| any (("cabal.project" ==) . takeFileName) files -> "cabal"
2627
| any (("stack.yaml" ==) . takeFileName) files -> "stack"
2728
| otherwise -> "cabal"
2829
cfs <- runMaybeT $ case name of

src/Hie/Locate.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ instance FromJSON Pkgs where
3737
stackYamlPkgs :: FilePath -> MaybeT IO [FilePath]
3838
stackYamlPkgs p = liftIO $
3939
decodeFileEither (p </> "stack.yaml") >>= \case
40-
Right (Pkgs f) -> pure f
40+
Right (Pkgs f) ->
41+
liftIO $
42+
map (p </>)
43+
<$> getDirectoryFiles p (map (</> "*.cabal") f)
4144
Left e -> fail $ show e
4245

4346
cabalPkgs :: FilePath -> MaybeT IO [FilePath]

0 commit comments

Comments
 (0)