diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 5f6b557f15a98b05e3d4410a993e5264bf4c0e5b..5d3a43932daacacf20fdca3494f8d04102723ee5 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -338,9 +338,24 @@ export interface IRawBreakpointContribution { } export interface IConfigurationManager { + + /** + * Returns a resolved debug configuration. + * If nameOrConfig is null resolves the first configuration and returns it. + */ getConfiguration(nameOrConfig: string | IConfig): TPromise; + + /** + * Opens the launch.json file + */ openConfigFile(sideBySide: boolean): TPromise; + + // TODO@Isidor remove this from the interface loadLaunchConfig(): TPromise; + + /** + * Returns true if breakpoints can be set for a given editor model. Depends on mode. + */ canSetBreakpointsIn(model: editor.IModel): boolean; } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 57ebf85efcd563b6a35556829ee808a2b2268a68..0bc8171f468504855defc95ccb74df6b490923e9 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -111,7 +111,7 @@ export class DebugService implements debug.IDebugService { this.model = new model.Model(this.loadBreakpoints(), this.storageService.getBoolean(DEBUG_BREAKPOINTS_ACTIVATED_KEY, StorageScope.WORKSPACE, true), this.loadFunctionBreakpoints(), this.loadExceptionBreakpoints(), this.loadWatchExpressions()); this.toDispose.push(this.model); - this.viewModel = new viewmodel.ViewModel(this.storageService.get(DEBUG_SELECTED_CONFIG_NAME_KEY, StorageScope.WORKSPACE, 'null')); + this.viewModel = new viewmodel.ViewModel(this.storageService.get(DEBUG_SELECTED_CONFIG_NAME_KEY, StorageScope.WORKSPACE, null)); this.registerListeners(eventService, lifecycleService); } diff --git a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts index 527ff5e75b695984e0a6ca09ebbc6a4f73239bfd..e4d0b451d4f32d8f80c278f31c2024d32863c4a8 100644 --- a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts @@ -261,9 +261,10 @@ export class ConfigurationManager implements debug.IConfigurationManager { return result; } // if the configuration name is not set yet, take the first launch config (can happen if debug viewlet has not been opened yet). - const filtered = nameOrConfig ? config.configurations.filter(cfg => cfg.name === nameOrConfig) : [config.configurations[0]]; + const filtered = config.configurations.filter(cfg => cfg.name === nameOrConfig); - result = filtered.length === 1 ? objects.deepClone(filtered[0]) : null; + result = filtered.length === 1 ? filtered[0] : config.configurations[0]; + result = objects.deepClone(result); if (config && result) { result.debugServer = config.debugServer; }