Automatically show inline values if an inline values provider is registered

fixes #119560
This commit is contained in:
isidor 2021-03-29 14:37:21 +02:00
parent 3a2a24e452
commit e09a24028e
No known key found for this signature in database
GPG key ID: F9280366A8370105
3 changed files with 12 additions and 5 deletions

View file

@ -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'],

View file

@ -576,8 +576,9 @@ export class DebugEditorContribution implements IDebugEditorContribution {
const separator = ', ';
const model = this.editor.getModel();
if (!this.configurationService.getValue<IDebugConfiguration>('debug').inlineValues ||
!model || !stackFrame || model.uri.toString() !== stackFrame.source.uri.toString()) {
const inlineValuesSetting = this.configurationService.getValue<IDebugConfiguration>('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();
}

View file

@ -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';