From 3cd10f2bbfe742c1ab0703443325fd75ea8a586a Mon Sep 17 00:00:00 2001 From: M Mahrous Date: Wed, 8 Jan 2025 15:16:49 +0100 Subject: [PATCH] [IMP] client: add command to restart server --- vscode/client/extension.ts | 8 +++++++- vscode/package.json | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/vscode/client/extension.ts b/vscode/client/extension.ts index e77d0156..c66193c1 100644 --- a/vscode/client/extension.ts +++ b/vscode/client/extension.ts @@ -711,7 +711,13 @@ async function initializeSubscriptions(context: ExtensionContext): Promise }), commands.registerCommand( "odoo.disablePythonLanguageServerCommand", setPythonLSNone - ) + ), + commands.registerCommand( + "odoo.restartServer", async () => { + if (global.LSCLIENT) { + global.LSCLIENT.restart(); + } + }) ); if (context.extensionMode === ExtensionMode.Development) { diff --git a/vscode/package.json b/vscode/package.json index 68549f50..1dafd831 100644 --- a/vscode/package.json +++ b/vscode/package.json @@ -62,6 +62,11 @@ "command": "odoo.disablePythonLanguageServerCommand", "title": "Set Python extension LanugageServer to None (Does nothing if python extension is not active)", "category": "Odoo" + }, + { + "command": "odoo.restartServer", + "title": "Restart Language Server", + "category": "Odoo" } ], "views": {},