Skip to content

Commit

Permalink
Add setting showPythonInlineValues
Browse files Browse the repository at this point in the history
  • Loading branch information
paulacamargo25 committed Jul 24, 2024
1 parent 83c5cb5 commit 1276df4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@
"description": "%debugpy.debugJustMyCode%",
"scope": "resource",
"type": "boolean"
},
"debugpy.showPythonInlineValues": {
"default": false,
"description": "%debugpy.showPythonInlineValues%",
"scope": "resource",
"type": "boolean"
}

},
"title": "Python Debugger",
"type": "object"
Expand Down
3 changes: 2 additions & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"debugpy.command.debugUsingLaunchConfig.title": "Python Debugger: Debug using launch.json",
"debugpy.command.reportIssue.title": "Report Issue...",
"debugpy.command.viewOutput.title": "Show Output",
"debugpy.debugJustMyCode": "When debugging only step through user-written code. Disable this to allow stepping into library code."
"debugpy.debugJustMyCode": "When debugging only step through user-written code. Disable this to allow stepping into library code.",
"debugpy.showPythonInlineValues": "Enable this to see inline values in the editor while debugging."
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
InlineValueVariableLookup,
InlineValueEvaluatableExpression,
} from 'vscode';
import { customRequest } from '../../common/vscodeapi';
import { customRequest, getConfiguration } from '../../common/vscodeapi';
import { sendTelemetryEvent } from '../../telemetry';
import { EventName } from '../../telemetry/constants';

Expand All @@ -20,6 +20,13 @@ export class PythonInlineValueProvider implements InlineValuesProvider {
viewPort: Range,
context: InlineValueContext,
): Promise<InlineValue[]> {
const showInlineValues = getConfiguration('debugpy').get<boolean>(
'showPythonInlineValues',
false,
);
if (!showInlineValues) {
return [];
}
let scopesRequest = await customRequest('scopes', { frameId: context.frameId });
let variablesRequest = await customRequest('variables', {
variablesReference: scopesRequest.scopes[0].variablesReference,
Expand Down

0 comments on commit 1276df4

Please sign in to comment.