File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
plugins/hls-cabal-fmt-plugin/src/Ide/Plugin Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ data Log
2121 = LogProcessInvocationFailure Int
2222 | LogReadCreateProcessInfo String [String ]
2323 | LogInvalidInvocationInfo
24+ | LogCabalFmtNotFound
2425 deriving (Show )
2526
2627instance Pretty Log where
@@ -31,6 +32,7 @@ instance Pretty Log where
3132 [" Invocation of cabal-fmt with arguments" <+> pretty args]
3233 ++ [" failed with standard error:" <+> pretty stdErrorOut | not (null stdErrorOut)]
3334 LogInvalidInvocationInfo -> " Invocation of cabal-fmt with range was called but is not supported."
35+ LogCabalFmtNotFound -> " Couldn't find executable 'cabal-fmt'"
3436
3537descriptor :: Recorder (WithPriority Log ) -> PluginId -> PluginDescriptor IdeState
3638descriptor recorder plId =
@@ -66,6 +68,7 @@ provider recorder _ide FormatText contents nfp opts = liftIO $ do
6668 let fmtDiff = makeDiffTextEdit contents (T. pack out)
6769 pure $ Right fmtDiff
6870 Nothing -> do
71+ log Error LogCabalFmtNotFound
6972 pure $ Left (ResponseError InvalidRequest " No installation of cabal-fmt could be found. Please install it into your global environment." Nothing )
7073 where
7174 fp = fromNormalizedFilePath nfp
You can’t perform that action at this time.
0 commit comments