Skip to content

Commit 1402c42

Browse files
committed
better documentation for findResponsibleCabalFile
1 parent 0e95226 commit 1402c42

File tree

1 file changed

+4
-1
lines changed
  • plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal

1 file changed

+4
-1
lines changed

plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal/CabalAdd.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ getDependencyEdit recorder env cabalFilePath buildTarget dependency = do
277277
logWith recorder Debug $ LogCreatedEdit edit
278278
pure edit
279279

280-
-- | Given a path to a haskell file, returns the closest cabal file, except if package.yaml is also present.
280+
-- | Given a path to a haskell file, returns the closest cabal file.
281+
-- If package.yaml is present in same directory as .cabal file, it returns nothing, because adding a dependency to a generated cabal file
282+
-- will break propagation of changes from package.yaml to cabal file in stack project.
283+
--
281284
-- If cabal file wasn't found, gives Nothing.
282285
findResponsibleCabalFile :: FilePath -> IO (Maybe FilePath)
283286
findResponsibleCabalFile haskellFilePath = do

0 commit comments

Comments
 (0)