9191 method? : Option MessageMethod :=
9292 messageMethod? msg <|> (do pending.get? (← messageId? msg))
9393
94- public inductive MessageDirection where
95- | clientToServer
96- | serverToClient
97- deriving Inhabited, FromJson, ToJson
98-
99- inductive MessageKind where
100- | request
101- | notification
102- | response
103- | responseError
104- deriving FromJson, ToJson
105-
106- def MessageKind.ofMessage : JsonRpc.Message → MessageKind
107- | .request .. => .request
108- | .notification .. => .notification
109- | .response .. => .response
110- | .responseError .. => .responseError
111-
11294local instance : ToJson Std.Time.ZonedDateTime where
11395 toJson dt := dt.toISO8601String
11496
@@ -119,13 +101,13 @@ local instance : FromJson Std.Time.ZonedDateTime where
119101
120102structure LogEntry where
121103 time : Std.Time.ZonedDateTime
122- direction : MessageDirection
123- kind : MessageKind
104+ direction : JsonRpc. MessageDirection
105+ kind : JsonRpc. MessageKind
124106 msg : JsonRpc.Message
125107 deriving FromJson, ToJson
126108
127109public def writeLogEntry (cfg : LogConfig) (pending : Std.HashMap JsonRpc.RequestID MessageMethod)
128- (log : IO.FS.Handle) (direction : MessageDirection) (msg : JsonRpc.Message) : IO Unit := do
110+ (log : IO.FS.Handle) (direction : JsonRpc. MessageDirection) (msg : JsonRpc.Message) : IO Unit := do
129111 if ! isMsgAllowed cfg pending msg then
130112 return
131113 let entry : LogEntry := {
0 commit comments