Skip to content

Commit 74ee34b

Browse files
committed
Avoid setCurrentDirectory in hls-stylish-haskell-plugin
1 parent f523690 commit 74ee34b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,8 @@ 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 = do
82-
currDir <- getCurrentDirectory
83-
setCurrentDirectory (takeDirectory file)
84-
config <- loadConfig (makeVerbose False) Nothing
85-
setCurrentDirectory currDir
86-
pure config
81+
loadConfigFrom file =
82+
loadConfig (makeVerbose False) (Just $ takeDirectory file)
8783

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

0 commit comments

Comments
 (0)