File tree Expand file tree Collapse file tree 5 files changed +9
-16
lines changed
ghcide/src/Development/IDE/Plugin
hls-plugin-api/src/Ide/Plugin
hls-cabal-plugin/src/Ide/Plugin
hls-explicit-imports-plugin/src/Ide/Plugin Expand file tree Collapse file tree 5 files changed +9
-16
lines changed Original file line number Diff line number Diff line change @@ -65,22 +65,15 @@ instance Pretty Log where
65
65
LogPluginError (PluginId pId) err ->
66
66
pretty pId <> " :" <+> pretty err
67
67
LogResponseError (PluginId pId) err ->
68
- pretty pId <> " :" <+> prettyResponseError err
68
+ pretty pId <> " :" <+> pretty err
69
69
LogNoPluginForMethod (Some method) ->
70
- " No plugin enabled for " <> pretty ( show method)
70
+ " No plugin enabled for " <> pretty method
71
71
LogInvalidCommandIdentifier -> " Invalid command identifier"
72
72
ExceptionInPlugin plId (Some method) exception ->
73
73
" Exception in plugin " <> viaShow plId <> " while processing "
74
- <> viaShow method <> " : " <> viaShow exception
74
+ <> pretty method <> " : " <> viaShow exception
75
75
instance Show Log where show = renderString . layoutCompact . pretty
76
76
77
- -- various error message specific builders
78
- prettyResponseError :: ResponseError -> Doc a
79
- prettyResponseError err = errorCode <> " :" <+> errorBody
80
- where
81
- errorCode = pretty $ show $ err ^. L. code
82
- errorBody = pretty $ err ^. L. message
83
-
84
77
noPluginEnabled :: Recorder (WithPriority Log ) -> SMethod m -> [PluginId ] -> IO (Either ResponseError c )
85
78
noPluginEnabled recorder m fs' = do
86
79
logWith recorder Warning (LogNoPluginForMethod $ Some m)
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ instance Pretty Log where
41
41
DoesNotSupportResolve fallback->
42
42
" Client does not support resolve," <+> pretty fallback
43
43
ApplyWorkspaceEditFailed err ->
44
- " ApplyWorkspaceEditFailed:" <+> viaShow err
44
+ " ApplyWorkspaceEditFailed:" <+> pretty err
45
45
46
46
-- | When provided with both a codeAction provider and an affiliated codeAction
47
47
-- resolve provider, this function creates a handler that automatically uses
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ instance Pretty Log where
75
75
" Determined completion context:"
76
76
<+> viaShow context
77
77
<+> " for cursor position:"
78
- <+> viaShow position
78
+ <+> pretty position
79
79
LogCompletions logs -> pretty logs
80
80
81
81
descriptor :: Recorder (WithPriority Log ) -> PluginId -> PluginDescriptor IdeState
Original file line number Diff line number Diff line change @@ -27,15 +27,15 @@ data Log
27
27
28
28
instance Pretty Log where
29
29
pretty = \ case
30
- LogFileSplitError pos -> " An error occured when trying to separate the lines of the cabal file at position:" <+> viaShow pos
30
+ LogFileSplitError pos -> " An error occured when trying to separate the lines of the cabal file at position:" <+> pretty pos
31
31
LogUnknownKeyWordInContextError kw ->
32
32
" Lookup of key word failed for:" <+> viaShow kw
33
33
LogUnknownStanzaNameInContextError sn ->
34
34
" Lookup of stanza name failed for:" <+> viaShow sn
35
35
LogFilePathCompleterIOError fp ioErr ->
36
- " When trying to complete the file path:" <+> viaShow fp <+> " the following unexpected IO error occured" <+> viaShow ioErr
36
+ " When trying to complete the file path:" <+> pretty fp <+> " the following unexpected IO error occured" <+> viaShow ioErr
37
37
LogUseWithStaleFastNoResult -> " Package description couldn't be read"
38
- LogMapLookUpOfKnownKeyFailed key -> " Lookup of key in map failed even though it should exist" <+> viaShow key
38
+ LogMapLookUpOfKnownKeyFailed key -> " Lookup of key in map failed even though it should exist" <+> pretty key
39
39
40
40
type instance RuleResult ParseCabal = Parse. GenericPackageDescription
41
41
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ data Log
73
73
instance Pretty Log where
74
74
pretty = \ case
75
75
LogShake logMsg -> pretty logMsg
76
- LogWAEResponseError rspErr -> " RequestWorkspaceApplyEdit Failed with " <+> viaShow rspErr
76
+ LogWAEResponseError rspErr -> " RequestWorkspaceApplyEdit Failed with " <+> pretty rspErr
77
77
LogResolve msg -> pretty msg
78
78
79
79
-- | The "main" function of a plugin
You can’t perform that action at this time.
0 commit comments