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

Intellisense not working with jupyter extension #15702

Closed
2 tasks done
tmchartrand opened this issue May 21, 2024 · 9 comments
Closed
2 tasks done

Intellisense not working with jupyter extension #15702

tmchartrand opened this issue May 21, 2024 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Issue needs to be triaged

Comments

@tmchartrand
Copy link

tmchartrand commented May 21, 2024

Applies To

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

What happened?

With a new python environment, created a new notebook and interactive window with a single import statement (import os). Intellisense does not work on this import (either hover hint or go to def). This is true for both Jedi and Pylance language server. Pylance does give an error in the log:

2024-05-21 10:07:22.134 [info] a [Error]: Request workspace/configuration failed with message: Cannot read properties of undefined (reading 'metadata')
    at /Users/tom.chartrand/.vscode/extensions/ms-python.vscode-pylance-2024.3.2/dist/vendor.bundle.js:2:1268722
    at oe (/Users/tom.chartrand/.vscode/extensions/ms-python.vscode-pylance-2024.3.2/dist/vendor.bundle.js:2:1269016)
    at /Users/tom.chartrand/.vscode/extensions/ms-python.vscode-pylance-2024.3.2/dist/vendor.bundle.js:2:1263775
    at Immediate.<anonymous> (/Users/tom.chartrand/.vscode/extensions/ms-python.vscode-pylance-2024.3.2/dist/vendor.bundle.js:2:1263795)
    at processImmediate (node:internal/timers:476:21) {
  code: -32603,
  data: undefined
}

Intellisense comes back in these windows if the jupyter extension is disabled. In some cases Pylance does work inconsistently, seemingly dependent on what is open when the window is reloaded (if only preferences are focused, I get no error and intellisense works, but not sure how consistent this is), but Jedi seems consistently blocked.

VS Code Version

1.89.1

Jupyter Extension Version

v2024.4.2024042601 (pre-release)

Jupyter logs

Visual Studio Code (1.89.1, undefined, desktop)
Jupyter Extension Version: 2024.4.2024042601.
Python Extension Version: 2024.6.0.
Pylance Extension Version: 2024.3.2.
Platform: darwin (arm64).
No workspace folder opened.
10:07:22.142 [info] Process Execution: ~/micromamba/bin/python -m pip list

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

@tmchartrand tmchartrand added the bug Issue identified by VS Code Team member as probable bug label May 21, 2024
@VSCodeTriageBot VSCodeTriageBot added the triage-needed Issue needs to be triaged label May 21, 2024
@amunger
Copy link
Contributor

amunger commented May 21, 2024

Jedi doesn't currently support notebook models, so that's not expected to provide intellisense since IW is backed by a notebook.

Are you executing the import statement in the interactive window? Pylance doesn't provide intellisense until the first cell is executed (known issue)

@amunger amunger added the info-needed Issue requires more information from poster label May 21, 2024
@tmchartrand
Copy link
Author

@amunger yes the behavior is no different for me before or after execution of a cell (in either notebook or interactive window). When checking this though, I did realize that the effect of the jupyter extension enabled vs not is also inconsistent, modified the original post to reflect this. The presence of the error log noted does seem to be consistently linked to the bug as far as I can tell, although only on the pylance side not jedi.

I'm confused by your comment on Jedi though, since it is working just fine for me in an older version (code 1.85.2, python 2024.2.1, jupyter 2023.9.100. Are you referring to features that use the active kernel vs just static analysis (eg jupyter.enableExtendedKernelCompletions)?

As a side note, it would be great if the respective notebook support for pylance and jedi was better documented in general!

@amunger amunger removed the info-needed Issue requires more information from poster label May 21, 2024
@amunger
Copy link
Contributor

amunger commented May 21, 2024

@DonJayamanne Cannot read properties of undefined (reading 'metadata') sounds like it may be trying to access metadata through the custom field, is there a setting/experiment to toggle to verify that?

@DonJayamanne
Copy link
Contributor

@bschnurr @heejaechang Please can you have a look at this.
Last iteration we changed the way metadata is stored in the notebook, its no longer nested under metadata.metadata.

@tmchartrand
Copy link
Author

tmchartrand commented May 23, 2024 via email

@DonJayamanne
Copy link
Contributor

@tmchartrand Are you still running into this issue.

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Jul 22, 2024
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vs-code-engineering vs-code-engineering bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 29, 2024
@tmchartrand
Copy link
Author

This is still an issue with extension versions jupyter v2024.6.0, python v2024.10.0. Please re-open!

@tmchartrand
Copy link
Author

I've confirmed that the pylance side actually seems fine in the recent extension versions, but the issues with non-Pylance intellisense continue. Opened new issue to reflect that.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants