Skip to content
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

complete_reply: missing metadata #12

Open
yanite opened this issue Apr 28, 2023 · 1 comment
Open

complete_reply: missing metadata #12

yanite opened this issue Apr 28, 2023 · 1 comment
Labels

Comments

@yanite
Copy link

yanite commented Apr 28, 2023

handles.js
function complete_request
add metadata

    function onSuccess(result) {
        var content = {
            matches: result.completion.list,
            cursor_start: result.completion.cursorStart,
            cursor_end: result.completion.cursorEnd,
            status: "ok",
                        metadata: {
                _jupyter_types_experimental: [
                    { start: result.completion.cursorStart
                    , end: result.completion.cursorEnd
                    , text: result.completion.list
                    , type: 'keyword'
                    , signature: ''}
                ]
            }
        };
        request.respond(this.shellSocket, "complete_reply", content);
    }

fix
`Jupyter console 6.6.3

IJavascript v5.2.1
https://github.com/n-riesco/ijavascript

Unhandled exception in event loop:
File "D:\Python\lib\site-packages\prompt_toolkit\buffer.py", line 1933, in new_coroutine
await coroutine(*a, **kw)
File "D:\Python\lib\site-packages\prompt_toolkit\buffer.py", line 1757, in async_completer
async for completion in async_generator:
File "D:\Python\lib\site-packages\prompt_toolkit\completion\base.py", line 323, in get_completions_async
async for completion in completer.get_completions_async(
File "D:\Python\lib\site-packages\prompt_toolkit\completion\base.py", line 199, in get_completions_async
for item in self.get_completions(document, complete_event):
File "D:\Python\lib\site-packages\jupyter_console\ptshell.py", line 154, in get_completions
meta = content["metadata"]

Exception 'metadata'
Press ENTER to continue...
`

@n-riesco n-riesco added the bug label May 3, 2023
@Konubinix
Copy link

I also stumbled into this issue.
Indeed ptshell expects the metadata field, as described by the documentation of the protocol.

@n-riesco n-riesco changed the title Plase fix bug complete_reply: missing metadata Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants