提交 d8743b53 编写于 作者: I isidor

debug: always use the first configuration even if none is chosen

fixes #14403
上级 49b8f747
......@@ -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<IConfig>;
/**
* Opens the launch.json file
*/
openConfigFile(sideBySide: boolean): TPromise<boolean>;
// TODO@Isidor remove this from the interface
loadLaunchConfig(): TPromise<IGlobalConfig>;
/**
* Returns true if breakpoints can be set for a given editor model. Depends on mode.
*/
canSetBreakpointsIn(model: editor.IModel): boolean;
}
......
......@@ -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);
}
......
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册