chore: fix servertest_init_exit

This commit is contained in:
Sebastian Ullrich 2022-01-06 19:21:40 +01:00
parent d503fe6d13
commit 37f5be1b26
2 changed files with 4 additions and 0 deletions

View file

@ -42,6 +42,9 @@ def writeNotification (n : Notification α) : IpcM Unit := do
def readMessage : IpcM JsonRpc.Message := do
(←stdout).readLspMessage
def readRequestAs (expectedMethod : String) (α) [FromJson α] : IpcM (Request α) := do
(←stdout).readLspRequestAs expectedMethod α
def readResponseAs (expectedID : RequestID) (α) [FromJson α] : IpcM (Response α) := do
(←stdout).readLspResponseAs expectedID α

View file

@ -7,6 +7,7 @@ def main : IO Unit := do
hIn.write (←FS.readBinFile "init_vscode_1_47_2.log")
hIn.flush
let initResp ← Ipc.readResponseAs 0 InitializeResult
let regWatchReq ← Ipc.readRequestAs "client/registerCapability" Json
Ipc.writeNotification ⟨"initialized", InitializedParams.mk⟩
Ipc.writeRequest ⟨1, "shutdown", Json.null⟩