Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit d81afc6

Browse files
committed
Refactor CPP guards
1 parent b54e1e6 commit d81afc6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Haskell/Ide/Engine/Plugin/Ormolu.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,15 @@ ormoluDescriptor plId = PluginDescriptor
3232

3333

3434
provider :: FormattingProvider
35-
provider _contents _uri typ _opts =
36-
case typ of
35+
provider _contents _uri _typ _opts =
3736
#if __GLASGOW_HASKELL__ >= 806
37+
case _typ of
3838
FormatRange _ -> return $ IdeResultFail (IdeError PluginError (pack "Selection formatting for Ormolu is not currently supported.") Null)
3939
FormatText -> pluginGetFile _contents _uri $ \file -> do
4040
result <- liftIO $ try @OrmoluException (ormolu defaultConfig file (unpack _contents))
4141
case result of
4242
Left err -> return $ IdeResultFail (IdeError PluginError (pack $ "ormoluCmd: " ++ show err) Null)
4343
Right new -> return $ IdeResultOk [TextEdit (fullRange _contents) new]
4444
#else
45-
FormatRange _ -> return $ IdeResultOk []
46-
FormatText -> return $ IdeResultOk []
45+
return $ IdeResultOk [] -- NOP formatter
4746
#endif

0 commit comments

Comments
 (0)