Make data viewer openable from the variables window while debugging#14406
Make data viewer openable from the variables window while debugging#14406
Conversation
(TODO find a better place to add the __vscodeVariableMenuContext property to the DebugProtocol.Variable)
| await this.evaluate(DataFrameLoading.VariableInfoImport); | ||
| this.importedIntoKernel.add(key); | ||
| } | ||
| await this.evaluate(DataFrameLoading.DataFrameSysImport); |
There was a problem hiding this comment.
Probably don't want to do this more than once per debug session. It's rather slow.
There was a problem hiding this comment.
@rchiodo would it suffice to use the activeDebugSession's ID instead of the stringified notebook identity like so:
if (this.debugService.activeDebugSession && !this.importedIntoKernel.has(this.debugService.activeDebugSession.id)) {There was a problem hiding this comment.
Not sure debug session ids are unique (might get reused), but if you cleared the cache for that id on shutdown, that should work.
There was a problem hiding this comment.
VSC docstring says it's unique:
/**
* A debug session.
*/
export interface DebugSession {
/**
* The unique ID of this debug session.
*/
readonly id: string;
Do we have a reason to think the IDs might not be unique?
There was a problem hiding this comment.
Unique for the list of active sessions running at the same time. May not be unique if you stop and start debugging.
There was a problem hiding this comment.
I guess I'd want to look to see how it's generated. If it's a guid, then it's probably unique for all time. If it's a counter, then it's unique enough to not matter.
or we can just remove the flag of 'set' in debugger when a session stops.
| await this.dataViewerFactory.create(jupyterVariableDataProvider, title); | ||
| } | ||
| } catch (e) { | ||
| this.appShell.showErrorMessage(e.toString()); |
There was a problem hiding this comment.
I'd stick a traceError here as well so that it's in the log.
Codecov Report
@@ Coverage Diff @@
## main #14406 +/- ##
==========================================
- Coverage 59.40% 59.17% -0.24%
==========================================
Files 716 720 +4
Lines 40000 40211 +211
Branches 5793 5829 +36
==========================================
+ Hits 23763 23794 +31
- Misses 14975 15152 +177
- Partials 1262 1265 +3
Continue to review full report at Codecov.
|
| ) { | ||
| // This should be the top frame. We need to use this to compute the value of a variable | ||
| this.updateStackFrame(message as DebugProtocol.StackTraceResponse); | ||
| } else if (message.type === 'event' && message.event === 'terminated') { |
There was a problem hiding this comment.
Right here is where you'd clean out the appropriate spot in the importedIntoKernel map
|
Kudos, SonarCloud Quality Gate passed!
|
Provide users with a way to open the data viewer for data-viewable types, i.e.:
In an interactive window debug session:

In a regular Python debugging session:

package-lock.jsonhas been regenerated by runningnpm install(if dependencies have changed).