hoangKnLai / vscode-ipython

VSCode Extension integrating Editor with IPython console.
MIT License
18 stars 5 forks source link

Integration via official VSCode Python API #29

Open hoangKnLai opened 1 year ago

hoangKnLai commented 1 year ago

See python-extension-template for

hoangKnLai commented 1 year ago

[Notebook API]() may provide a path to:

AmerM137 commented 1 year ago

@hoangKnLai a few questions about the Notebook API:

hoangKnLai commented 1 year ago

Ideally, you would want something that replicates the Spyder editor->REPL workflow exactly.

Yes. The REPL behavior is what we wanted. I think IPython does this in two ways:

Spyder uses a qtconsole for the integrated terminal instead of the ipython terminal, which provides in-line plotting and other features. Is it possible to implement anything like that in VSCode? or is the fact that qtconsole is a GUI app prevent us from doing that?

About a year back, I looked briefly into the qtconsole:

Is there any way for VSCode to communicate with an external terminal?

There might be one. Similar to a language server, the @vscode/python-extension provides a tunnel between vscode and python. Hence this issue to find the way. An approach might be:

So the main idea stems from the fact that vscode notebook can already render the ipython kernel inputs and outputs including the inline plots that the current text terminal can't. All we do is likely managing the various kernel, the number of notebook cells, and what is being render.