diff --git a/src/vs/workbench/contrib/debug/browser/debug.contribution.ts b/src/vs/workbench/contrib/debug/browser/debug.contribution.ts index c8a96516546..f09c14a0b1d 100644 --- a/src/vs/workbench/contrib/debug/browser/debug.contribution.ts +++ b/src/vs/workbench/contrib/debug/browser/debug.contribution.ts @@ -379,9 +379,15 @@ configurationRegistry.registerConfiguration({ default: false }, 'debug.inlineValues': { - type: 'boolean', + type: ['boolean', 'string'], + 'enum': [true, false, 'auto'], description: nls.localize({ comment: ['This is the description for a setting'], key: 'inlineValues' }, "Show variable values inline in editor while debugging."), - default: false + 'enumDescriptions': [ + nls.localize('inlineValues.on', 'Always show variable values inline in editor while debugging.'), + nls.localize('inlineValues.off', 'Never show variable values inline in editor while debugging.'), + nls.localize('inlineValues.focusNoScroll', 'Show variable values inline in editor while debugging when the language supports inline value locations.'), + ], + default: 'auto' }, 'debug.toolBarLocation': { enum: ['floating', 'docked', 'hidden'], diff --git a/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts b/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts index bc9549f91e7..652eddf3b50 100644 --- a/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts +++ b/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts @@ -576,8 +576,9 @@ export class DebugEditorContribution implements IDebugEditorContribution { const separator = ', '; const model = this.editor.getModel(); - if (!this.configurationService.getValue('debug').inlineValues || - !model || !stackFrame || model.uri.toString() !== stackFrame.source.uri.toString()) { + const inlineValuesSetting = this.configurationService.getValue('debug').inlineValues; + const inlineValuesTurnedOn = inlineValuesSetting === true || (inlineValuesSetting === 'auto' && model && InlineValuesProviderRegistry.has(model)); + if (!inlineValuesTurnedOn || !model || !stackFrame || model.uri.toString() !== stackFrame.source.uri.toString()) { if (!this.removeInlineValuesScheduler.isScheduled()) { this.removeInlineValuesScheduler.schedule(); } diff --git a/src/vs/workbench/contrib/debug/common/debug.ts b/src/vs/workbench/contrib/debug/common/debug.ts index da4772034b0..65b431030b0 100644 --- a/src/vs/workbench/contrib/debug/common/debug.ts +++ b/src/vs/workbench/contrib/debug/common/debug.ts @@ -501,7 +501,7 @@ export interface IDebugConfiguration { allowBreakpointsEverywhere: boolean; openDebug: 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart' | 'openOnDebugBreak'; openExplorerOnEnd: boolean; - inlineValues: boolean; + inlineValues: boolean | 'auto'; toolBarLocation: 'floating' | 'docked' | 'hidden'; showInStatusBar: 'never' | 'always' | 'onFirstSessionStart'; internalConsoleOptions: 'neverOpen' | 'openOnSessionStart' | 'openOnFirstSessionStart';