Skip to content

Commit

Permalink
Avoid setCurrentDirectory in hls-stylish-haskell-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jhrcek committed Jun 27, 2024
1 parent 147fb4a commit 985df44
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,8 @@ provider recorder ide _token typ contents fp _opts = do
-- | Recursively search in every directory of the given filepath for .stylish-haskell.yaml.
-- If no such file has been found, return default config.
loadConfigFrom :: FilePath -> IO Config
loadConfigFrom file = do
currDir <- getCurrentDirectory
setCurrentDirectory (takeDirectory file)
config <- loadConfig (makeVerbose False) Nothing
setCurrentDirectory currDir
pure config
loadConfigFrom file =
loadConfig (makeVerbose False) (Just $ takeDirectory file)

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

0 comments on commit 985df44

Please sign in to comment.