Skip to content

Commit cadd465

Browse files
committed
Add requests description
1 parent 2cc1736 commit cadd465

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

debugger-info-copy-to-globals/debugger-info-copy-to-globals.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,47 @@ UI if this is supported by the kernel before displaying the corresponding menu e
2323

2424
We propose to add a new `copyToGlobals` boolean field to the `debugger_info`
2525
response which will inform the UI that this request is supported.
26+
27+
## Reference-level explanation
28+
29+
This boolean flag should be included in the `debugger_info` response from the kernel
30+
which supports the feature. It is optional, assuming that its absence is understood
31+
as `false` from the client perspective.
32+
33+
If the feature is supported, the kernel must provide a function for copying a variable
34+
from a local scope to the global scope.
35+
The communication between the UI and the kernel (request - response) will have the
36+
structures described at
37+
https://jupyter-client.readthedocs.io/en/latest/messaging.html#copytoglobals.
38+
39+
- Request (from UI to kernel)
40+
41+
```json
42+
{
43+
'type': 'request',
44+
'command': 'copyToGlobals',
45+
'arguments': {
46+
# the variable to copy from the frame corresponding to `srcFrameId`
47+
'srcVariableName': str,
48+
'srcFrameId': int,
49+
# the copied variable name in the global scope
50+
'dstVariableName': str
51+
}
52+
}
53+
```
54+
55+
- Response (from kernel to UI)
56+
57+
```json
58+
{
59+
'type': 'response',
60+
'success': bool,
61+
'command': 'setExpression',
62+
'body': {
63+
# string representation of the copied variable
64+
'value': str,
65+
# type of the copied variable
66+
'type': str,
67+
'variablesReference': int
68+
}
69+
}

0 commit comments

Comments
 (0)