@@ -327,8 +327,13 @@ async function initLanguageServerClient(context: ExtensionContext, outputChannel
327
327
// Production - Client is going to run the server (for use within `.vsix` package)
328
328
const cwd = path . join ( __dirname , ".." , ".." ) ;
329
329
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 ) ;
332
337
}
333
338
334
339
context . subscriptions . push (
@@ -711,6 +716,7 @@ async function waitForClientStop() {
711
716
async function stopClient ( ) {
712
717
if ( global . LSCLIENT && ! global . CLIENT_IS_STOPPING ) {
713
718
global . LSCLIENT . info ( "Stopping LS Client." ) ;
719
+ global . IS_LOADING = false ;
714
720
global . CLIENT_IS_STOPPING = true ;
715
721
await global . LSCLIENT . stop ( 15000 ) ;
716
722
global . CLIENT_IS_STOPPING = false ;
0 commit comments