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

Clear All in Python Interactive Stops Intellisense #13782

Open
1 of 2 tasks
Chris888-CMD opened this issue Jun 27, 2023 · 3 comments
Open
1 of 2 tasks

Clear All in Python Interactive Stops Intellisense #13782

Chris888-CMD opened this issue Jun 27, 2023 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@Chris888-CMD
Copy link

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

If one uses the clear all button in the Python Interactive window, Intellisense stops working.

To be more specific if one starts a Python Interactive window, IntelliSense works in the interactive window, however if one uses the Clear All button on the top of the window, IntelliSense stops working in the window. Restarting the interactive window solves the issue.

I am not sure if this is expected behavior and I don't recall it being like this previously.

VS Code Version

Version: 1.79.2 (user setup) Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06 Date: 2023-06-14T08:57:04.379Z Electron: 22.5.7 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.19045

Jupyter Extension Version

v2023.5.1101742258

Jupyter logs

No response

Coding Language and Runtime Version

No response

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

@Chris888-CMD Chris888-CMD added the bug Issue identified by VS Code Team member as probable bug label Jun 27, 2023
@roblourens roblourens assigned amunger and unassigned roblourens Jun 29, 2023
@amunger
Copy link
Contributor

amunger commented Jun 29, 2023

that's pretty interesting.
@debonte - do you know if there might be a requirement somewhere for at least one code cell in a notebook for intellisense to be provided for the IW input box?
Recording 2023-06-29 at 09 50 07

@Chris888-CMD
Copy link
Author

Hey, thanks for replying. I'm new to coding/self taught and have never submitted a bug. Thought maybe it was supposed to be like that, but it seemed strange.

I noticed it because if you are new like me and trying different things in the interactive window, after a while the output will be full of all the errors that your code has caused and then when you eventually get it right and want to clear all the errors, the Intellisense is gone.

@debonte
Copy link
Contributor

debonte commented Jun 29, 2023

This is happening because deleting the last cell in the IW notebook causes a notebookDocument/didClose message to be sent. From LSP's perspective, the interactive window's input box is not related to the interactive window's notebook. Python/Pylance have middleware (InteractiveWindowAddon) that causes the input box to look like the last cell in the notebook, but once the notebook is closed, that relationship is severed.

Note that the experience you're showing in the video above where there are no completion suggestions for print is the same experience you have when an IW is first opened, and for the same reason -- there's no associated notebook yet.

At some point I'm hopeful that microsoft/vscode#154983 will get fixed, and then both of these issues will go away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

4 participants