Skip to content

[Bug]: Hover feature does not work in Jupyter notebooks #6323

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

Closed
4 tasks done
cgebbe opened this issue Jul 12, 2023 · 7 comments
Closed
4 tasks done

[Bug]: Hover feature does not work in Jupyter notebooks #6323

cgebbe opened this issue Jul 12, 2023 · 7 comments
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer

Comments

@cgebbe
Copy link

cgebbe commented Jul 12, 2023

Is there an existing issue for this?

  • I have searched the existing issues

OS/Web Information

  • Web Browser:
  • Local OS:
  • Remote OS:
  • Remote Architecture:
  • code-server --version:

Steps to Reproduce

  1. open code-server
  2. create a new jupyter notebook
  3. install python and jupyter extensions

Expected

  • Given a jupyter notebook
  • When writing e.g. import numpy and np.ones(
  • Then a nice hover window pops up

Actual

  • No hover window pops up

Logs

No response

Screenshot/Video

No response

Does this issue happen in VS Code or GitHub Codespaces?

  • I cannot reproduce this in VS Code.
  • I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • I am using HTTPS.

Notes

  • This works in VS Code
  • This works in Github Codespaces (even with JEDI language server)
  • Given a plain python file in code-server, the same steps DO lead to a hover window.
  • //EDIT: Also just realized that functions such as peek definition also do not work in a jupyter notebook in code-server?
@cgebbe cgebbe added bug Something isn't working triage This issue needs to be triaged by a maintainer labels Jul 12, 2023
@benz0li
Copy link
Contributor

benz0li commented Jul 12, 2023

I can confirm that this works with the current versions of

  • VS Code/Codespaces: 1.80.0
  • Python extension: 2023.12.0
  • Jupyter extension: 2023.6.1101941928

Please be aware that code-sever (current version: 4.14.1, aka Code 1.79.2) relies on the Open VSX Registry, which currently provides

  • Python extension: 2023.10.1
  • Jupyter extension: 2023.3.100

for code-server v4.14.1.


Let us re-evaluate after @code-asher has updated code-server so it is based on Code 1.80.

@benz0li
Copy link
Contributor

benz0li commented Jul 12, 2023

Most probably due to Pylance only being published to the VS Code marketplace.
ℹ️ Pylance only runs with the official VS Code build.

Cross reference: microsoft/pylance-release#746

@benz0li
Copy link
Contributor

benz0li commented Jul 12, 2023

Cross reference: #1938

@benz0li
Copy link
Contributor

benz0li commented Aug 9, 2023

@cgebbe The situation regarding Pylance is not going to change.

Please close this issue.

@skevetter
Copy link

skevetter commented Nov 11, 2023

As @benz0li mentioned, Pylance is only published to the VS Code marketplace; however, Jedi can be used instead of Pylance.

jupyter-notebook-lsp.mp4

Configure settings.json

{
    "python.languageServer": "Jedi",
}
Code-Server

code-server: v4.18.0
Code: 1.83.1
Commit: d7a2b4936af1bfd80cb96f2567af68badc2325e3
Date: 2023-10-19T00:53:43.414Z
Browser: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36

Extensions

Name: Python
Id: ms-python.python
Description: IntelliSense (Pylance), Linting, Debugging (multi-threaded, remote), code formatting, refactoring, unit tests, and more.
Version: 2023.21.13141007
Publisher: ms-python
VS Marketplace Link: https://open-vsx.org/vscode/item?itemName=ms-python.python
Name: Jupyter
Id: ms-toolsai.jupyter
Description: Jupyter notebook support, interactive programming and computing that supports Intellisense, debugging and more.
Version: 2023.9.100
Publisher: ms-toolsai
VS Marketplace Link: https://open-vsx.org/vscode/item?itemName=ms-toolsai.jupyter

Related: microsoft/vscode-jupyter#12494

@rohit901
Copy link

rohit901 commented Jan 4, 2024

@OceanTrader1 thanks for this, I wanted to ask what is the difference between using Pylance vs Jedi? is there any tradeoff for making this change?

EDIT: Also, Im able to get hover/definition feature working in notebooks but when I click on some library functions/classes it is not working and I'm not able to go to the definition, how can I fix it?

@code-asher
Copy link
Member

code-asher commented Apr 9, 2024

Closing since it looks like there is nothing we can do, but feel free to continue the discussion.

@code-asher code-asher closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage This issue needs to be triaged by a maintainer
Projects
None yet
Development

No branches or pull requests

5 participants