File tree 1 file changed +3
-0
lines changed
plugins/hls-cabal-fmt-plugin/src/Ide/Plugin
1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ data Log
21
21
= LogProcessInvocationFailure Int
22
22
| LogReadCreateProcessInfo String [String ]
23
23
| LogInvalidInvocationInfo
24
+ | LogCabalFmtNotFound
24
25
deriving (Show )
25
26
26
27
instance Pretty Log where
@@ -31,6 +32,7 @@ instance Pretty Log where
31
32
[" Invocation of cabal-fmt with arguments" <+> pretty args]
32
33
++ [" failed with standard error:" <+> pretty stdErrorOut | not (null stdErrorOut)]
33
34
LogInvalidInvocationInfo -> " Invocation of cabal-fmt with range was called but is not supported."
35
+ LogCabalFmtNotFound -> " Couldn't find executable 'cabal-fmt'"
34
36
35
37
descriptor :: Recorder (WithPriority Log ) -> PluginId -> PluginDescriptor IdeState
36
38
descriptor recorder plId =
@@ -66,6 +68,7 @@ provider recorder _ide FormatText contents nfp opts = liftIO $ do
66
68
let fmtDiff = makeDiffTextEdit contents (T. pack out)
67
69
pure $ Right fmtDiff
68
70
Nothing -> do
71
+ log Error LogCabalFmtNotFound
69
72
pure $ Left (ResponseError InvalidRequest " No installation of cabal-fmt could be found. Please install it into your global environment." Nothing )
70
73
where
71
74
fp = fromNormalizedFilePath nfp
You can’t perform that action at this time.
0 commit comments