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

Docstring do not appear when editing cell #5415

Closed
Syndorik opened this issue Apr 6, 2021 · 11 comments
Closed

Docstring do not appear when editing cell #5415

Syndorik opened this issue Apr 6, 2021 · 11 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster

Comments

@Syndorik
Copy link

Syndorik commented Apr 6, 2021

Environment data

  • VS Code Insiders: 1.56.0-insider 550035808407c15252e581e8abe1b820b9d311ee x64
  • Jupyter Extension version (available under the Extensions sidebar): 2021.6.718745073
  • Python Extension version (available under the Extensions sidebar): 2021.3.680753044
  • OS (Windows | Mac | Linux distro) and version: Windows10
  • Python and/or Anaconda version: 3.9.2
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: Remote

Actual behaviour

Docstring do not appear when editing a cell. However inside the import cell, docstring appears.

For instance if I have two cells like:

import networkx as nx

and

nx.Graph()

Docstring won't appear

However if I have:

import networkx as nx
nx.Graph()

Then it appears

@Syndorik Syndorik added the bug Issue identified by VS Code Team member as probable bug label Apr 6, 2021
@IanMatthewHuff
Copy link
Member

@Syndorik Sorry can I ask for a bit of a clarification here. By DocString do you mean the function hover like so?
image
If so I'm not currently reproing this issue.

However language features (like DocStrings) do rely not just on the Jupyter extension, but on the Python extension and the currently selected language server. Your Python extension does look like it's possibly a bit out of date could you try updating that and reproing? Also, what language server do you have selected in the Python extension?

@IanMatthewHuff IanMatthewHuff added the info-needed Issue requires more information from poster label Apr 6, 2021
@Syndorik
Copy link
Author

Syndorik commented Apr 6, 2021

@IanMatthewHuff Of course. I'm indeed speaking of the function hover, getting everything from the documentation. When the function that I'm calling is inside the same import, I can access the documentation as expected
image

However when it's not inside the same cell:
image

I actually tried this setup in two different computers with two installs. I also tried with a remote jupyter server and a local one. Whatever I do I keep having this issue.

I'm currently using the 2021.3.680753044 extension for python, that's the last release I can download. And I'm using Jedi as language server. I tried Pylance, but it did not work either

@IanMatthewHuff IanMatthewHuff self-assigned this Apr 7, 2021
@canersnli
Copy link

I got same even worse issue.

Pylance autocomplete doesn't work. It works like jupyter autocomplete.
2021-04-08_01h02_07

Even if I import library and run in the the same cell , still nor at the end of typing pop-up documentation neither hover pop-up documentation works.
2021-04-08_01h02_31
2021-04-08_01h03_01

  • VS Code Insiders: 1.56.0-insider (user setup) Commit: bb90ba3d5a5f8d114045b045f3bbe1ebc404f54a
  • Jupyter Extension version : v2021.6.723987413
  • Python Extension version : v2021.4.690665134-dev
  • OS (Windows | Mac | Linux distro) and version: Windows10
  • Python and/or Anaconda version: 3.7.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
  • Jupyter server running: local
  • Microsoft Language Server: Pylance v2021.3.4

I had opened #4218 topic 4 months ago, unfortunately it still has not been solved. Now I got stuck in older VSCode version 1.51 which has some strange bugs either.

@IanMatthewHuff
Copy link
Member

@Syndorik and @canersnli I see that you are both on insiders. Did this issue just hit? VS Code insiders just had a breaking change (yesterday I believe) that change requires an update to the insiders version of the python extension which is currently in progress here: microsoft/vscode-python#15884 (review)

I'm guessing that this is not @Syndorik 's issue as they are seeing some hover documentation, just not when the import is in a different cell.

@rchiodo
Copy link
Contributor

rchiodo commented Apr 8, 2021

@Syndorik can you switch to the insiders version for python?

image

It's a setting you have to change. Once it downloads and you reload VS code this issue should go away.

@canersnli
Copy link

Woow, everything works like a charm now, thx @rchiodo I am switching from VS Code to insiders now, hope future updates don't create same issue again.

@Syndorik
Copy link
Author

Syndorik commented Apr 8, 2021

Updating my version of code-insiders did it for me too! That's awesome, thanks!

@rchiodo
Copy link
Contributor

rchiodo commented Apr 8, 2021

Thanks for checking :)

@rchiodo rchiodo closed this as completed Apr 8, 2021
@floriandonhauser
Copy link

floriandonhauser commented Apr 22, 2021

Unfortunately it seems like I am having the same issue.
I am running Python 3.8.8 with anaconda.

Only ctrl+shift+space shows the documentation in .ipynb files and not hover. In normal .py files documentation on hover works.
Version: 1.56.0-insider (user setup)
Commit: 7ce1499d9541ba2acf66cd30a9054bd7818a8f80
Date: 2021-04-22T05:13:14.711Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
OS: Windows_NT x64 10.0.19042
Python v2021.4.765268190
Jupyter v2021.6.770905982
Python insider channel set to daily (Is there a way to see if it actually downloaded it?)

For normal VS Code the problem is even bigger, not even ctrl+shift+space works for .ipynb. Documentation works normally for .py as well.
Version: 1.55.2 (user setup)
Commit: 3c4e3df9e89829dce27b7b5c24508306b151f30d
Date: 2021-04-13T09:35:57.887Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19042
Python v2021.4.765268190
Jupyter v2021.5.745244803

@rchiodo Any ideas?

@rchiodo
Copy link
Contributor

rchiodo commented Apr 22, 2021

@floriandonhauser does autocomplete work? Do you see any red squiggles anywhere? There are some problems with inserting new cells messing up intellisense.

Additionally the interpreter set for the workspace (and not the kernel) is used to determine the set of packages that the language server understands. This might be the cause of the problem too.

On top of that, Pylance seems to work better than Jedi. Are you using Jedi or Pylance?

@floriandonhauser
Copy link

@rchiodo

On top of that, Pylance seems to work better than Jedi. Are you using Jedi or Pylance?

Installing Pylance fixed it for me, thank you a lot!
Before with Jedi, I think autocomplete was behaving like normal jupyter notebook (pretty bad recommendations imo).
The workspace was not the problem.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 5, 2021
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
Projects
None yet
Development

No branches or pull requests

5 participants