Implement stop and start server commands

This commit is contained in:
Lukas Wirth 2022-10-17 15:43:15 +02:00
parent d68616a140
commit 0421756b42
4 changed files with 26 additions and 2 deletions

View file

@ -126,6 +126,13 @@ async function initCommonContext(ctx: Ctx) {
await ctx.activate();
});
ctx.registerCommand("startServer", (_) => async () => {
await ctx.activate();
});
ctx.registerCommand("stopServer", (_) => async () => {
// FIXME: We should re-use the client, that is ctx.deactivate() if none of the configs have changed
await ctx.disposeClient();
});
ctx.registerCommand("analyzerStatus", commands.analyzerStatus);
ctx.registerCommand("memoryUsage", commands.memoryUsage);
ctx.registerCommand("shuffleCrateGraph", commands.shuffleCrateGraph);