This repository was archived by the owner on Oct 7, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed
src/Haskell/Ide/Engine/Plugin Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -32,22 +32,18 @@ ormoluDescriptor plId = PluginDescriptor
32
32
, pluginFormattingProvider = Just provider
33
33
}
34
34
35
- #if __GLASGOW_HASKELL__ >= 806
35
+
36
36
provider :: FormattingProvider
37
37
provider contents uri typ _opts =
38
38
case typ of
39
+ #if __GLASGOW_HASKELL__ >= 806
39
40
FormatRange _ -> return $ IdeResultFail (IdeError PluginError (pack " Selection formatting for Ormolu is not currently supported." ) Null )
40
41
FormatText -> pluginGetFile contents uri $ \ file -> do
41
42
result <- liftIO $ try @ OrmoluException (ormolu defaultConfig file (unpack contents))
42
43
case result of
43
44
Left err -> return $ IdeResultFail (IdeError PluginError (pack $ " ormoluCmd: " ++ show err) Null )
44
45
Right new -> return $ IdeResultOk [TextEdit (fullRange contents) new]
45
46
#else
46
- -- Work in progress
47
- provider :: FormattingProvider
48
- provider _contents _uri typ _opts = do
49
- errorm " This version of HIE does not support Ormolu as a formatter"
50
- case typ of
51
- FormatRange _ -> return $ IdeResultFail (IdeError PluginError (pack " Selection formatting for Ormolu is not currently supported." ) Null )
47
+ FormatRange _ -> return $ IdeResultOk []
52
48
FormatText -> return $ IdeResultOk []
53
49
#endif
You can’t perform that action at this time.
0 commit comments