-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Make data viewer openable from the variables window while debugging #14269
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
Changes from 1 commit
d21c822
ca3c6c3
5c00335
e6b5ccf
15cfbe6
ce5191b
1e84606
815bbba
1679b3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -274,24 +274,31 @@ export class DebuggerVariables implements IConditionalJupyterVariables, DebugAda | |
| ? this.configService.getSettings().datascience.variableExplorerExclude?.split(';') | ||
| : []; | ||
|
|
||
| const allowedVariables = variablesResponse.body.variables.filter((v) => { | ||
| if (!v.name || !v.type || !v.value) { | ||
| return false; | ||
| } | ||
| if (exclusionList && exclusionList.includes(v.type)) { | ||
| return false; | ||
| } | ||
| if (v.name.startsWith('_')) { | ||
| return false; | ||
| } | ||
| if (KnownExcludedVariables.has(v.name)) { | ||
| return false; | ||
| } | ||
| if (v.type === 'NoneType') { | ||
| return false; | ||
| } | ||
| return true; | ||
| }); | ||
| const allowedVariables = variablesResponse.body.variables | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might want to get in touch with Debugger team about this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be hard to make it quite as flexible as client-side filtering. If we hardcode the filters, debugpy would have to be touched every time this logic needs revising. And if we don't hardcode them, then the protocol would need to be expressive enough to express all those conditions, which would also make the implementation expensive. I think client-side filtering is the better option here, unless there are important perf reasons to exclude some variables.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just in the interest of clarity (even though I think the conclusion is the same), we're not asking for filtering logic in debugpy. What we're after is debugpy setting the As background for anyone unfamiliar with why we need this, the reason we need this property is so that we can make use of the new contribution point for the variable context menu introduced in the August release. VS Code uses the hidden |
||
| .filter((v) => { | ||
| if (!v.name || !v.type || !v.value) { | ||
| return false; | ||
| } | ||
| if (exclusionList && exclusionList.includes(v.type)) { | ||
| return false; | ||
| } | ||
| if (v.name.startsWith('_')) { | ||
| return false; | ||
| } | ||
| if (KnownExcludedVariables.has(v.name)) { | ||
| return false; | ||
| } | ||
| if (v.type === 'NoneType') { | ||
| return false; | ||
| } | ||
| return true; | ||
| }) | ||
| .map((v) => { | ||
| return v.type === 'Tensor' | ||
| ? // tslint:disable-next-line: no-object-literal-type-assertion | ||
| ({ ...v, __vscodeVariableMenuContext: 'Tensor' } as DebugProtocol.Variable) | ||
| : v; | ||
| }); | ||
|
|
||
| this.lastKnownVariables = allowedVariables.map((v) => { | ||
| return { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.