-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d629c2
commit 8f927b8
Showing
6 changed files
with
614 additions
and
1 deletion.
There are no files selected for viewing
Binary file added
BIN
+10.1 KB
.doctrees/debugger-info-copy-to-globals/debugger-info-copy-to-globals.doctree
Binary file not shown.
Binary file not shown.
69 changes: 69 additions & 0 deletions
69
_sources/debugger-info-copy-to-globals/debugger-info-copy-to-globals.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
title: Debugger support to copyToGlobals | ||
authors: Nicolas Brichet (@brichet) | ||
issue-number: xxx | ||
pr-number: xxx | ||
date-started: 2023-02-20 | ||
--- | ||
|
||
# Summary | ||
|
||
This JEP introduces a new field to the kernel debugger_info response. This new | ||
field will inform the UI that the debugger supports the `copyToGlobals` request. | ||
|
||
# Motivation | ||
|
||
The `copyToGlobals` request has been introduced in | ||
[ipykernel](https://github.com/ipython/ipykernel/pull/1055) and in | ||
[xeus-python](https://github.com/jupyter-xeus/xeus-python/pull/562) to copy a local | ||
variable to the global scope during a breakpoint. It would be useful to inform the | ||
UI if this is supported by the kernel before displaying the corresponding menu entry. | ||
|
||
# Proposed Enhancement | ||
|
||
We propose to add a new `copyToGlobals` boolean field to the `debugger_info` | ||
response which will inform the UI that this request is supported. | ||
|
||
## Reference-level explanation | ||
|
||
This boolean flag should be included in the `debugger_info` response from the kernel | ||
which supports the feature. It is optional, assuming that its absence is understood | ||
as `false` from the client perspective. | ||
|
||
If the feature is supported, the kernel must provide a function for copying a variable | ||
from a local scope to the global scope. | ||
The communication between the UI and the kernel (request - response) will have the | ||
structures described at | ||
https://jupyter-client.readthedocs.io/en/latest/messaging.html#copytoglobals. | ||
|
||
- Request (from UI to kernel) | ||
|
||
```python | ||
{ | ||
'type': 'request', | ||
'command': 'copyToGlobals', | ||
'arguments': { | ||
# the variable to copy from the frame corresponding to `srcFrameId` | ||
'srcVariableName': str, | ||
'srcFrameId': int, | ||
# the copied variable name in the global scope | ||
'dstVariableName': str | ||
} | ||
} | ||
``` | ||
|
||
- Response (from kernel to UI) | ||
|
||
```python | ||
{ | ||
'type': 'response', | ||
'success': bool, | ||
'command': 'setExpression', | ||
'body': { | ||
# string representation of the copied variable | ||
'value': str, | ||
# type of the copied variable | ||
'type': str, | ||
'variablesReference': int | ||
} | ||
} |
Oops, something went wrong.