Skip to content

Commit 56ecebc

Browse files
mmahroussfda-odoo
authored andcommitted
[IMP] vscode: avoid sending empty config file
1 parent 6ba861d commit 56ecebc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

vscode/client/extension.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,13 @@ async function initLanguageServerClient(context: ExtensionContext, outputChannel
327327
// Production - Client is going to run the server (for use within `.vsix` package)
328328
const cwd = path.join(__dirname, "..", "..");
329329
let log_level = String(workspace.getConfiguration().get("Odoo.serverLogLevel"));
330-
let config_path = String(workspace.getConfiguration().get("Odoo.serverConfigPath"));
331-
client = startLangServer(serverPath, ["--log-level", log_level, "--config-path", config_path], cwd, outputChannel);
330+
let config_path_result = workspace.getConfiguration().get("Odoo.serverConfigPath");
331+
let config_path: string = config_path_result === undefined ? "" : config_path_result as string;
332+
let args = ["--log-level", log_level];
333+
if (config_path.trim() !== "") {
334+
args.push("--config-path", config_path);
335+
}
336+
client = startLangServer(serverPath, args, cwd, outputChannel);
332337
}
333338

334339
context.subscriptions.push(
@@ -711,6 +716,7 @@ async function waitForClientStop() {
711716
async function stopClient() {
712717
if (global.LSCLIENT && !global.CLIENT_IS_STOPPING) {
713718
global.LSCLIENT.info("Stopping LS Client.");
719+
global.IS_LOADING = false;
714720
global.CLIENT_IS_STOPPING = true;
715721
await global.LSCLIENT.stop(15000);
716722
global.CLIENT_IS_STOPPING = false;

0 commit comments

Comments
 (0)