IPython does already have a timeout for completion; --Completer.jedi_compute_type_timeout , Though there is an initial step that cannot be interrupted, and this typically make the first few completion with jedi slower.
Interrupting may or may not work as expected depending on whether you have cell execution queued. Note that vscode should know whether the kernel is busy and then could decide to (not) send completion request to the kernel. That is at least what classic notebook does; if the kernel is busy it will rely on CodeMirror completion which is completely independent of kernel, but less complete. I'm not familiar with VS Code internal but I don't see any reason the same approach can't be taken. -- M On Fri, 11 Sep 2020 at 19:38, Rich Chiodo <[email protected]> wrote: > > Oh I'm an idiot. Kernel interrupt is already the cancel mechanism. This will > likely work to cancel the completion request. And if it crashes IPython I can > always submit a PR there to catch the keyboard interrupt and return empty > completion results. > > Sorry for the dumb idea. > > On Friday, September 11, 2020 at 5:52:09 PM UTC-7, Rich Chiodo wrote: >> >> Hi, >> >> I was hoping to discuss making it possible to 'cancel' a kernel request. Or >> at least ask if anybody else has thought of this and why or why not it's >> possible. >> >> I didn't want to make a JEP just yet as thought there might already be a >> discussion around this. >> >> This is in reference to problems my team is having with auto complete and >> IPython: >> https://github.com/microsoft/vscode-python/issues/9596 >> >> I ran some profiling when the problem occurs and it looks like we're in the >> middle of waiting for the completion request to return before we can execute >> a cell. >> >> This might be solved a number of ways: >> - Modify Jedi/IPython to support a timeout for completion >> - Skip doing autocompletion in VS code from Jupyter >> - Provide a way to cancel a kernel request >> >> The cancel idea sounds the most interesting to me. >> >> Any feedback would be great. >> >> Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "Project Jupyter" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jupyter/98f78a21-e439-4538-a05c-cc34f7614319o%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CANJQusU46kDi%2BSV2wNYwkBmDCPkgM%2B0OuXqckZ5gWQpGMzLeVA%40mail.gmail.com.
