Skip to content

Commit 688c7b6

Browse files
committed
improve pretty printing
1 parent 43215e2 commit 688c7b6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ghcide/src/Development/IDE/Plugin/HLS.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ data Log
5656
| LogInvalidCommandIdentifier
5757
instance Pretty Log where
5858
pretty = \case
59-
LogPluginError pId err -> pretty (show pId) <> ":" <+> prettyResponseError err
59+
LogPluginError (PluginId pId) err -> pretty pId <> ":" <+> prettyResponseError err
6060
LogNoPluginForMethod (Some method) ->
6161
"No plugin enabled for " <> pretty (show method)
6262
LogInvalidCommandIdentifier-> "Invalid command identifier"

src/HlsPlugins.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ module HlsPlugins where
66
import Development.IDE.Types.Logger (Pretty (pretty), Recorder,
77
WithPriority, cmapWithPrio)
88
import Ide.PluginUtils (pluginDescToIdePlugins)
9-
import Ide.Types (IdePlugins, PluginId)
9+
import Ide.Types (IdePlugins,
10+
PluginId (PluginId))
1011

1112
-- fixed plugins
1213
import Development.IDE (IdeState)
1314
import qualified Development.IDE.Plugin.HLS.GhcIde as GhcIde
14-
import GHC.Exts (fromString)
1515

1616
-- haskell-language-server optional plugins
1717
#if hls_qualifyImportedNames
@@ -123,7 +123,7 @@ import qualified Development.IDE.Plugin.CodeAction as Refactor
123123
data Log = forall a. (Pretty a) => Log PluginId a
124124

125125
instance Pretty Log where
126-
pretty (Log pId a) = fromString (show pId) <> ": " <> pretty a
126+
pretty (Log (PluginId pId) a) = pretty pId <> ": " <> pretty a
127127

128128
-- ---------------------------------------------------------------------
129129

0 commit comments

Comments
 (0)