@@ -71,20 +71,26 @@ prettyResponseError err = errorCode <> ":" <+> errorBody
71
71
errorBody = pretty $ err ^. LSP. message
72
72
73
73
pluginNotEnabled :: SMethod m -> [(PluginId , b , a )] -> Text
74
- pluginNotEnabled method availPlugins = " No plugin enabled for " <> T. pack (show method) <> " , available:\n " <> T. pack (unlines $ map (\ (plid,_,_) -> show plid) availPlugins)
74
+ pluginNotEnabled method availPlugins =
75
+ " No plugin enabled for " <> T. pack (show method) <> " , available: "
76
+ <> (T. intercalate " , " $ map (\ (PluginId plid, _, _) -> plid) availPlugins)
75
77
76
78
pluginDoesntExist :: PluginId -> Text
77
79
pluginDoesntExist (PluginId pid) = " Plugin " <> pid <> " doesn't exist"
78
80
79
81
commandDoesntExist :: CommandId -> PluginId -> [PluginCommand ideState ] -> Text
80
- commandDoesntExist (CommandId com) (PluginId pid) legalCmds = " Command " <> com <> " isn't defined for plugin " <> pid <> " . Legal commands are:\n " <> T. pack (unlines $ map (show . commandId) legalCmds)
82
+ commandDoesntExist (CommandId com) (PluginId pid) legalCmds =
83
+ " Command " <> com <> " isn't defined for plugin " <> pid <> " . Legal commands are: "
84
+ <> (T. intercalate " , " $ map (\ (PluginCommand {commandId = CommandId cid}) -> cid) legalCmds)
81
85
82
86
failedToParseArgs :: CommandId -- ^ command that failed to parse
83
87
-> PluginId -- ^ Plugin that created the command
84
88
-> String -- ^ The JSON Error message
85
89
-> J. Value -- ^ The Argument Values
86
90
-> Text
87
- failedToParseArgs (CommandId com) (PluginId pid) err arg = " Error while parsing args for " <> com <> " in plugin " <> pid <> " : " <> T. pack err <> " \n arg = " <> T. pack (show arg)
91
+ failedToParseArgs (CommandId com) (PluginId pid) err arg =
92
+ " Error while parsing args for " <> com <> " in plugin " <> pid <> " : "
93
+ <> T. pack err <> " , arg = " <> T. pack (show arg)
88
94
89
95
-- | Build a ResponseError and log it before returning to the caller
90
96
logAndReturnError :: Recorder (WithPriority Log ) -> PluginId -> ErrorCode -> Text -> LSP. LspT Config IO (Either ResponseError a )
0 commit comments