-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Interactive Window input box is not treated as a notebook cell #151994
Comments
@rebornix to provide some background: LSP syncs cells and the associated text documents to a server based on the document filter provided (which has support for defining a note book type). The problem seems to be that the filter only honors |
@jrieken FYI. |
The current interactive window in VS Code is a composite editor, which consists of a notebook editor input and text editor input. That means they are not on the same editor model. We construct their resource Uris as
The reason we use a different a schema is the input box is not part of a notebook. If it uses If we would want the input box to be part of the notebook document, we would need to change how things are hooked up together:
The later would be hard to enforce and we might need to introduce proper API for interactive window, instead of just treating them as composite editors of notebook model + text model. |
I'm wondering if Pylance could just handle this themselves? 'textDocument/didOpen' events are fired for the interactive input. And the notebook events for the interactive 'notebook' part should get there too. Theoretically this means Pylance should have enough information to figure out the interactive input is attached to a specific notebook (with a different scheme). |
Of course the notebook selector would have to be modified to include the 'vscodeInteractive' scheme. The input box would likely get there the same as a python file. |
Yes, I've experimented with this and I agree that it's probably doable. Is the Interactive Window intended to be a Python-specific component though? If not, other language servers using LSP notebooks would also be forced to stitch together the cells and input box in this way. |
To allow LSP to handle this correctly VS Code needs to expose API to either relate the two things or to handle them as one thing. LSP itself has the same problems as the Python extension itself to relate these things. All LSP code runs inside an extension and has no special treatment inside VS Code. Ideas could be:
|
@rebornix, what are your thoughts on this? Am I right that the Interactive Window is intended to be language-agnostic, not Python-specific? If so, would you agree that fixing this issue in VS Code would be better than trying to work around it in Pylance? If you can point me in the right direction, I'm willing to take a shot at fixing it. |
We met and discussed this topic (@rebornix @debonte and myself). The end result was:
|
Added an API request - #154983 |
Let's merge this into #154983 |
Issue Type: Bug
When using the new notebook document features in LSP 3.17, the Interactive Window's input box is not considered to be a notebook cell. I think this is primarily because its URI scheme is
vscode-interactive-input
instead ofvscode-notebook-cell
. See the check here.The current behavior creates a couple of problems for Pylance:
@rchiodo, @dbaeumer, and I have been discussing this in a Pylance issue. This comment would be a good spot to start reading.
VS Code version: Code - Insiders 1.68.0-insider (4af164e, 2022-06-08T11:37:22.322Z)
OS version: Windows_NT x64 10.0.22538
Restricted Mode: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Extensions (10)
A/B Experiments
The text was updated successfully, but these errors were encountered: