4
4
5
5
module Haskell.Ide.Engine.Plugin.Ormolu ( ormoluDescriptor ) where
6
6
7
- import Data.Aeson ( Value ( Null ) )
8
- import Data.Text
9
- import Haskell.Ide.Engine.MonadTypes
10
-
11
7
#if __GLASGOW_HASKELL__ >= 806
12
8
import Control.Exception
13
9
import Control.Monad.IO.Class ( liftIO , MonadIO (.. ) )
10
+ import Data.Aeson ( Value ( Null ) )
11
+ import Data.Text
12
+ import Haskell.Ide.Engine.MonadTypes
14
13
import Ormolu
15
14
import Ormolu.Config (defaultConfig )
16
15
import Ormolu.Exception (OrmoluException )
@@ -34,16 +33,16 @@ ormoluDescriptor plId = PluginDescriptor
34
33
35
34
36
35
provider :: FormattingProvider
37
- provider contents uri typ _opts =
36
+ provider _contents _uri typ _opts =
38
37
case typ of
39
38
#if __GLASGOW_HASKELL__ >= 806
40
39
FormatRange _ -> return $ IdeResultFail (IdeError PluginError (pack " Selection formatting for Ormolu is not currently supported." ) Null )
41
- FormatText -> pluginGetFile contents uri $ \ file -> do
42
- result <- liftIO $ try @ OrmoluException (ormolu defaultConfig file (unpack contents ))
40
+ FormatText -> pluginGetFile _contents _uri $ \ file -> do
41
+ result <- liftIO $ try @ OrmoluException (ormolu defaultConfig file (unpack _contents ))
43
42
case result of
44
43
Left err -> return $ IdeResultFail (IdeError PluginError (pack $ " ormoluCmd: " ++ show err) Null )
45
- Right new -> return $ IdeResultOk [TextEdit (fullRange contents ) new]
44
+ Right new -> return $ IdeResultOk [TextEdit (fullRange _contents ) new]
46
45
#else
47
46
FormatRange _ -> return $ IdeResultOk []
48
47
FormatText -> return $ IdeResultOk []
49
- #endif
48
+ #endif
0 commit comments