| 14 | |
| 15 | @injectable() |
| 16 | export class SourceSteppingUI implements IExtensionContribution { |
| 17 | constructor( |
| 18 | @inject(ExtensionContext) private readonly context: vscode.ExtensionContext, |
| 19 | @inject(DebugSessionTracker) private readonly tracker: DebugSessionTracker, |
| 20 | ) {} |
| 21 | |
| 22 | /** @inheritdoc */ |
| 23 | public register(context: vscode.ExtensionContext) { |
| 24 | const isDisabled = new ManagedContextKey(ContextKey.IsMapSteppingDisabled); |
| 25 | |
| 26 | if (sourceMapSteppingEnabled.read(this.context.workspaceState) === false) { |
| 27 | isDisabled.value = true; |
| 28 | } |
| 29 | |
| 30 | const setEnabled = (enabled: boolean) => { |
| 31 | isDisabled.value = !enabled; |
| 32 | sourceMapSteppingEnabled.write(this.context.workspaceState, enabled); |
| 33 | for (const session of this.tracker.getConcreteSessions()) { |
| 34 | session.customRequest('setSourceMapStepping', { enabled }); |
| 35 | } |
| 36 | }; |
| 37 | |
| 38 | context.subscriptions.push( |
| 39 | registerCommand(vscode.commands, Commands.EnableSourceMapStepping, () => { |
| 40 | setEnabled(true); |
| 41 | }), |
| 42 | registerCommand(vscode.commands, Commands.DisableSourceMapStepping, () => { |
| 43 | setEnabled(false); |
| 44 | }), |
| 45 | ); |
| 46 | } |
| 47 | } |
nothing calls this directly
no outgoing calls
no test coverage detected