-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add setting showPythonInlineValues #407
Add setting showPythonInlineValues #407
Conversation
1276df4
to
be2a2ff
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a request to disable/enable debug inline values on a per-language basis versus the base debug.inlineValues
? If so this is something we should probably have in VS Code itself rather than an extension-specific setting
We are using this setting as experimental, there are some variables in the python inline values that we need to review and investigate more for the next iteration. So we decided to add this setting to have this value set to |
It looks like |
Yes, it will disable all the inline values |
package.nls.json
Outdated
@@ -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." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"debugpy.showPythonInlineValues": "Enable this to see inline values in the editor while debugging." | |
"debugpy.showPythonInlineValues": "Whether to display inline values in the editor while debugging." |
Is that intended? That seems like a regression for folks who were using them up until this point |
@connor4312 This setting is similar to |
package.json
Outdated
}, | ||
"debugpy.showPythonInlineValues": { | ||
"default": false, | ||
"description": "%debugpy.showPythonInlineValues%", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "%debugpy.showPythonInlineValues%", | |
"description": "%debugpy.showPythonInlineValues.description%", |
package.nls.json
Outdated
@@ -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": "Whether to display inline values in the editor while debugging." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"debugpy.showPythonInlineValues": "Whether to display inline values in the editor while debugging." | |
"debugpy.showPythonInlineValues.description": "Whether to display inline values in the editor while debugging." |
@karthiknadig I have not tested the changes in this PR, but in VS Code if there is an inline value provider registered for a language then that will be used instead of the default handling that VS Code does, and is doing for Python stable. If I'm understanding it right, the implementation in this PR of just returning an empty array from the provider won't fall back to the old behavior, but will instead turn off inline values for everyone, including those who might have been using them previously. I think the better implementation is not registering an inline value provider at all if the setting is turned off so as not to regress functionality. |
Thanks @connor4312 for the explanation. I agree that this should skip registration, if the setting is set to disable. If the setting was changed when the extension is already activated, we can just use the on settings change event and dispose the provider. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
|
||
context.subscriptions.push( | ||
workspace.onDidChangeConfiguration((event: ConfigurationChangeEvent) => { | ||
if (event.affectsConfiguration('debugpy')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An aside but I have a ConfigValue helper that I've copied between multiple projects that makes this easier :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion Connor, I'll review it and add it as a dev week item.
Add setting for showing the inline values.
Closed: #410