Skip to content

Commit 1276df4

Browse files
Add setting showPythonInlineValues
1 parent 83c5cb5 commit 1276df4

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,14 @@
131131
"description": "%debugpy.debugJustMyCode%",
132132
"scope": "resource",
133133
"type": "boolean"
134+
},
135+
"debugpy.showPythonInlineValues": {
136+
"default": false,
137+
"description": "%debugpy.showPythonInlineValues%",
138+
"scope": "resource",
139+
"type": "boolean"
134140
}
141+
135142
},
136143
"title": "Python Debugger",
137144
"type": "object"

package.nls.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"debugpy.command.debugUsingLaunchConfig.title": "Python Debugger: Debug using launch.json",
55
"debugpy.command.reportIssue.title": "Report Issue...",
66
"debugpy.command.viewOutput.title": "Show Output",
7-
"debugpy.debugJustMyCode": "When debugging only step through user-written code. Disable this to allow stepping into library code."
7+
"debugpy.debugJustMyCode": "When debugging only step through user-written code. Disable this to allow stepping into library code.",
8+
"debugpy.showPythonInlineValues": "Enable this to see inline values in the editor while debugging."
89
}

src/extension/debugger/inlineValue/pythonInlineValueProvider.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
InlineValueVariableLookup,
1111
InlineValueEvaluatableExpression,
1212
} from 'vscode';
13-
import { customRequest } from '../../common/vscodeapi';
13+
import { customRequest, getConfiguration } from '../../common/vscodeapi';
1414
import { sendTelemetryEvent } from '../../telemetry';
1515
import { EventName } from '../../telemetry/constants';
1616

@@ -20,6 +20,13 @@ export class PythonInlineValueProvider implements InlineValuesProvider {
2020
viewPort: Range,
2121
context: InlineValueContext,
2222
): Promise<InlineValue[]> {
23+
const showInlineValues = getConfiguration('debugpy').get<boolean>(
24+
'showPythonInlineValues',
25+
false,
26+
);
27+
if (!showInlineValues) {
28+
return [];
29+
}
2330
let scopesRequest = await customRequest('scopes', { frameId: context.frameId });
2431
let variablesRequest = await customRequest('variables', {
2532
variablesReference: scopesRequest.scopes[0].variablesReference,

0 commit comments

Comments
 (0)