code-server icon indicating copy to clipboard operation
code-server copied to clipboard

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

Open cgebbe opened this issue 2 years ago • 5 comments
trafficstars

Is there an existing issue for this?

  • [X] 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?

  • [X] I cannot reproduce this in VS Code.
  • [X] I cannot reproduce this in GitHub Codespaces.

Are you accessing code-server over HTTPS?

  • [X] 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 avatar Jul 12 '23 09:07 cgebbe

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 avatar Jul 12 '23 16:07 benz0li

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

Cross reference: https://github.com/microsoft/pylance-release/issues/746

benz0li avatar Jul 12 '23 16:07 benz0li

Cross reference: https://github.com/coder/code-server/issues/1938

benz0li avatar Jul 12 '23 16:07 benz0li

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

Please close this issue.

benz0li avatar Aug 09 '23 05:08 benz0li

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

https://github.com/coder/code-server/assets/69881238/3dd1e13d-cad1-4d47-9bee-9a6a98379a28

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: https://github.com/microsoft/vscode-jupyter/issues/12494

skevetter avatar Nov 11 '23 20:11 skevetter

@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?

rohit901 avatar Jan 04 '24 12:01 rohit901

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

code-asher avatar Apr 09 '24 17:04 code-asher