intellisense vscode not showing parameters nor documentation when hovering above with mouse
Asked Answered
E

1

6

I'm trying to migrate my entire workflow from eclipse and jupyter notebook all over to VS Code. I installed the python extension, which should come with Intellisense, but it only works partly. I get suggestions after typing a period (.), but don't get any information on parameters nor documentation when hovering over with my mouse. Thank you so much for your help and have a wonderful new year!

P.S If anyone has any experience with using anaconda environments with VS Code, that would be greatly appreciated as well as I running into some problems with it recognizing the libraries.

Image of completion suggestions

Image of no parameters nor documentation

Also you can see here that when I manually activate IntelliSense, it doesn't recognize that it's in a method.

enter image description here

Sorry for the long string of edits, but I discovered that when typing print in a regular Python file, it works, but not in a Jupyter Notebook file. Also, it still doesn't work for numpy. Thanks for the help everyone.

enter image description here

Energetics answered 1/1, 2021 at 0:22 Comment(0)
M
5

You could use the shortcut key "Ctrl+Space" to open the suggested options:

enter image description here

In addition, it is recommended that you use the extension "Pylance", which works better with the extension "Python".

enter image description here

Update:

Currently in VSCode, the "IntelliSense" document content is provided by the Python language service, which is mainly for Python files (".py" files call this function), while in Jupyter, the "IntelliSense" used by the ".ipynb" file comes from the extension "Jupyter". You could refer to the content of this link to use VS code insiders, and its notebook editor has better intellisense.

In VS code insiders:

enter image description here

enter image description here

Merrile answered 1/1, 2021 at 2:59 Comment(8)
Thank you for the response. I'll definitely look into that. Just wondering, shouldn't parameters and documentation show up in the stock form of IntelliSense that comes with the python extension. Thanks!Energetics
@albert chen -I tested the code "import numpy as np np.array()", and the results showed that the effect of "IntelliSense" in the ".py" file and ".ipynb" file is the same. (These options are displayed at "np.array", and shortcut keys are needed at "np.array()".)Merrile
Thanks, do you know where I can find these shortcut keys. I was under the impression that all you had to do was hover your mouse over to get the documentation as shown in the demos online. Thanks.Energetics
@albert chen -You could click "F1" and enter "Preferences: Open Default Keyboard Shortcuts (JSON)", or refer to this document: Key Bindings for Visual Studio Code.Merrile
Thanks for the help. Have a great rest of your day!Energetics
I was hoping to get documentation in the jupyter notebook cells like the ones I am able to get with the regular python file. Is this possible? If not, thank you so much for your help.Energetics
@albert chen -I updated my answer and you could refer to it.Merrile
Thank you so much. This is just what I've been looking for!Energetics

© 2022 - 2024 — McMap. All rights reserved.