Skip to content

Commit 907c5ed

Browse files
committed
Revert "Avoid setCurrentDirectory in hls-stylish-haskell-plugin"
This reverts commit 985df44.
1 parent 985df44 commit 907c5ed

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

plugins/hls-stylish-haskell-plugin/src/Ide/Plugin/StylishHaskell.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ provider recorder ide _token typ contents fp _opts = do
7878
-- | Recursively search in every directory of the given filepath for .stylish-haskell.yaml.
7979
-- If no such file has been found, return default config.
8080
loadConfigFrom :: FilePath -> IO Config
81-
loadConfigFrom file =
82-
loadConfig (makeVerbose False) (Just $ takeDirectory file)
81+
loadConfigFrom file = do
82+
currDir <- getCurrentDirectory
83+
setCurrentDirectory (takeDirectory file)
84+
config <- loadConfig (makeVerbose False) Nothing
85+
setCurrentDirectory currDir
86+
pure config
8387

8488
-- | Run stylish-haskell on the given text with the given configuration.
8589
runStylishHaskell :: FilePath -- ^ Location of the file being formatted. Used for error message

0 commit comments

Comments
 (0)