diff --git a/src/DebugConfigurationProvider.ts b/src/DebugConfigurationProvider.ts index 4217e37e..5d14d466 100644 --- a/src/DebugConfigurationProvider.ts +++ b/src/DebugConfigurationProvider.ts @@ -56,7 +56,7 @@ export class BrightScriptDebugConfigurationProvider implements DebugConfiguratio retainStagingFolder: false, enableVariablesPanel: true, autoResolveVirtualVariables: false, - enhanceREPLCompletions: true, + enhanceREPLCompletions: false, showHiddenVariables: false, enableDebuggerAutoRecovery: false, stopDebuggerOnAppExit: false, @@ -70,6 +70,7 @@ export class BrightScriptDebugConfigurationProvider implements DebugConfiguratio rendezvousTracking: true, deleteDevChannelBeforeInstall: false, sceneGraphDebugCommandsPort: 8080, + componentLibrariesPort: 8080, remoteControlMode: { activateOnSessionStart: false, deactivateOnSessionEnd: false @@ -206,6 +207,8 @@ export class BrightScriptDebugConfigurationProvider implements DebugConfiguratio config = { ...bsconfig, ...config }; } + config.cwd = folderUri.fsPath; + config.rootDir = this.util.ensureTrailingSlash(config.rootDir ? config.rootDir : '${workspaceFolder}'); //Check for depreciated Items @@ -237,44 +240,18 @@ export class BrightScriptDebugConfigurationProvider implements DebugConfiguratio //create an empty array so it's easier to reason with downstream config.componentLibraries = []; } - config.componentLibrariesPort = config.componentLibrariesPort ? config.componentLibrariesPort : 8080; + + // Apply any defaults to missing values + for (const key in this.configDefaults) { + config[key] ??= this.configDefaults[key]; + } + + // Run any required post processing after applying defaults + config.outDir = this.util.ensureTrailingSlash(config.outDir); // Pass along files needed by RDB to roku-debug config.rdbFilesBasePath = rta.utils.getDeviceFilesPath(); - // Apply any defaults to missing values - config.type = config.type ? config.type : this.configDefaults.type; - config.name = config.name ? config.name : this.configDefaults.name; - config.host = config.host ? config.host : this.configDefaults.host; - config.password = config.password ? config.password : this.configDefaults.password; - config.consoleOutput = config.consoleOutput ? config.consoleOutput : this.configDefaults.consoleOutput; - config.autoRunSgDebugCommands = config.autoRunSgDebugCommands ? config.autoRunSgDebugCommands : this.configDefaults.autoRunSgDebugCommands; - config.request = config.request ? config.request : this.configDefaults.request; - config.stopOnEntry ??= this.configDefaults.stopOnEntry; - config.outDir = this.util.ensureTrailingSlash(config.outDir ? config.outDir : this.configDefaults.outDir); - config.retainDeploymentArchive = config.retainDeploymentArchive === false ? false : this.configDefaults.retainDeploymentArchive; - config.injectRaleTrackerTask = config.injectRaleTrackerTask === true ? true : this.configDefaults.injectRaleTrackerTask; - config.injectRdbOnDeviceComponent = config.injectRdbOnDeviceComponent === true ? true : this.configDefaults.injectRdbOnDeviceComponent; - config.disableScreenSaver = config.disableScreenSaver === false ? false : this.configDefaults.disableScreenSaver; - config.retainStagingFolder ??= this.configDefaults.retainStagingFolder; - config.enableVariablesPanel = 'enableVariablesPanel' in config ? config.enableVariablesPanel : this.configDefaults.enableVariablesPanel; - config.autoResolveVirtualVariables = config.autoResolveVirtualVariables === true ? true : this.configDefaults.autoResolveVirtualVariables; - config.enhanceREPLCompletions = config.enhanceREPLCompletions === true ? true : this.configDefaults.enhanceREPLCompletions; - config.showHiddenVariables = config.showHiddenVariables === true ? true : this.configDefaults.showHiddenVariables; - config.enableDebuggerAutoRecovery = config.enableDebuggerAutoRecovery === true ? true : this.configDefaults.enableDebuggerAutoRecovery; - config.stopDebuggerOnAppExit = config.stopDebuggerOnAppExit === true ? true : this.configDefaults.stopDebuggerOnAppExit; - config.files = config.files ? config.files : this.configDefaults.files; - config.enableSourceMaps = config.enableSourceMaps === false ? false : this.configDefaults.enableSourceMaps; - config.rewriteDevicePathsInLogs = config.rewriteDevicePathsInLogs === false ? false : this.configDefaults.rewriteDevicePathsInLogs; - config.packagePort = config.packagePort ? config.packagePort : this.configDefaults.packagePort; - config.remotePort = config.remotePort ? config.remotePort : this.configDefaults.remotePort; - config.logfilePath ??= null; - config.cwd = folderUri.fsPath; - config.rendezvousTracking = config.rendezvousTracking === false ? false : true; - config.deleteDevChannelBeforeInstall = config.deleteDevChannelBeforeInstall === true; - config.sceneGraphDebugCommandsPort = config.sceneGraphDebugCommandsPort ? config.sceneGraphDebugCommandsPort : this.configDefaults.sceneGraphDebugCommandsPort; - config.enableDebugProtocol ??= this.configDefaults.enableDebugProtocol; - //if packageTask is defined, make sure there's actually a task with that name defined if (config.packageTask) { const targetTask = (await vscode.tasks.fetchTasks()).find(x => x.name === config.packageTask);