diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 6e5e55159585bd1021045f30188d0b1d00720a5a..4cb0500ba8265c291d523885d37c2876abf2cfeb 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -197,6 +197,12 @@ export enum State { RunningNoDebug } +// Service config + +export interface IDebugConfiguration { + allowBreakpointsEverywhere: boolean; +} + // service interfaces export interface IGlobalConfig { diff --git a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts index 8f196937718a0dc0e9a75934c4a4800298fcb3f7..03a9174d77f7e04645177a8ab6baa4da9d6dd0da 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debug.contribution.ts @@ -15,6 +15,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe import { IKeybindings } from 'vs/platform/keybinding/common/keybinding'; import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors'; +import * as confregistry from 'vs/platform/configuration/common/configurationRegistry'; import wbaregistry = require('vs/workbench/common/actionRegistry'); import viewlet = require('vs/workbench/browser/viewlet'); import panel = require('vs/workbench/browser/panel'); @@ -164,3 +165,19 @@ registerSingleton(IDebugService, service.DebugService); 'DebugErrorEditor'), [new SyncDescriptor(DebugErrorEditorInput)] ); + +// Register configuration +const configurationRegistry = platform.Registry.as(confregistry.Extensions.Configuration); +configurationRegistry.registerConfiguration({ + id: 'debug', + order: 20, + title: nls.localize('debugConfigurationTitle', "Debug"), + type: 'object', + properties: { + 'debug.allowBreakpointsEverywhere': { + type: 'boolean', + description: nls.localize('allowBreakpointsEverywhere', "Allows setting breakpoints for all files, no matter the extension."), + default: false + } + } +}); diff --git a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts b/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts index 4c23f352f0a15356f9782bc94a8bf6b234a4b6b8..7940b8e47313643c05cd127fd5a3be47be5f9891 100644 --- a/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts +++ b/src/vs/workbench/parts/debug/node/debugConfigurationManager.ts @@ -23,7 +23,7 @@ import { IFileService } from 'vs/platform/files/common/files'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; -import debug = require('vs/workbench/parts/debug/common/debug'); +import * as debug from 'vs/workbench/parts/debug/common/debug'; import { Adapter } from 'vs/workbench/parts/debug/node/debugAdapter'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IQuickOpenService } from 'vs/workbench/services/quickopen/common/quickOpenService'; @@ -343,6 +343,9 @@ export class ConfigurationManager implements debug.IConfigurationManager { if (model.uri.scheme === Schemas.inMemory) { return false; } + if (this.configurationService.getConfiguration('debug').allowBreakpointsEverywhere) { + return true; + } const mode = model ? model.getMode() : null; const modeId = mode ? mode.getId() : null;