Skip to content

Commit

Permalink
Add handler to vscode
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Dec 20, 2024
1 parent 6d00546 commit 887418d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/extension/vscode/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ function registerClient(
function getMutationsForClient() {
return getMutations(getClient()?.queryManager.mutationStore ?? {});
}
function getMemoryInternalsForClient() {
return getClient()?.getMemoryInternals?.();
}
wsRpcHandler("getQueries", getQueriesForClient, { signal });
wsRpcHandler("getMutations", getMutationsForClient, { signal });
wsRpcHandler("getMemoryInternals", getMemoryInternalsForClient, { signal });
wsRpcHandler("getCache", () => getClient()?.cache.extract(true) ?? {}, {
signal,
});
Expand Down
4 changes: 4 additions & 0 deletions src/extension/vscode/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ export function runServer(
clients.get(id)!.rpcClient.request("getCache", id)
);

handleRpc("getMemoryInternals", (id) =>
clients.get(id)!.rpcClient.request("getMemoryInternals", id)
);

server.on("connection", function connection(ws) {
let id: string | undefined;
const wsAdapter = createSocketMessageAdapter(ws);
Expand Down

0 comments on commit 887418d

Please sign in to comment.