Skip to content

Commit

Permalink
Add requests description
Browse files Browse the repository at this point in the history
  • Loading branch information
brichet committed Nov 21, 2023
1 parent 2cc1736 commit cadd465
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions debugger-info-copy-to-globals/debugger-info-copy-to-globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,47 @@ UI if this is supported by the kernel before displaying the corresponding menu e

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)

```json
{
'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)

```json
{
'type': 'response',
'success': bool,
'command': 'setExpression',
'body': {
# string representation of the copied variable
'value': str,
# type of the copied variable
'type': str,
'variablesReference': int
}
}

0 comments on commit cadd465

Please sign in to comment.