python-language-server icon indicating copy to clipboard operation
python-language-server copied to clipboard

No Intellisense for some packages

Open adamal opened this issue 5 years ago • 0 comments

Environment data

  • VS Code version: 1.46.0
  • Extension version (available under the Extensions sidebar): v2020.5.86806
  • OS and version: macOS 10.14.6
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): venv with Poetry
  • Relevant/affected Python packages and their versions: Python
  • Relevant/affected Python-related VS Code extensions and their versions: XXX
  • Jedi or Language Server? (i.e. what is "python.jediEnabled" set to; more info microsoft/vscode-python#3977): python.jediEnabled = false
  • Value of the python.languageServer setting: Microsoft

Expected behaviour

When importing stuff like from pydantic import BaseSettings I get the features of an IDE that understands the code i write e.g.

  • Able to Go to definition when cursor is on BaseSettings.
  • Typing from pydantic import allows autocomplete of all the things that can be imported from that package
  • Typing BaseSettings. (or 'dot'-ing on derived classes) brings up suggestions of what is in BaseSettings.

This is the behaviour i get out of the box when i open the same repo in PyCharm

Actual behaviour

For some libraries (such as Pydantic) I get none of these.

Steps to reproduce:

Set up a python project. Install (e.g. Pydantic)

Steps tried

Taking hints from different SO-questions, I tried several things without success: Installing mypy (in projects venv), setting it as the linter, and setting the mypy-path accordingly. Installing PyRight vscode extension.

Related thoughts

Some packages work perfectly (azure-servicebus, comes to mind).

If the current state simply is that some libraries are not automatically parseable, it would be very helpful to mention that here: https://code.visualstudio.com/docs/python/editing#_troubleshooting With the current wording, it sounds like simple misconfiguration is the only thing that can prevent intellisense from working. If some modules/packages/libraries are simply incompatible, that should at least be mentioned.

If it is possible to workaround those limitations with the user providing stubs (similar to what is possible with Typescript), it would be nice with some details on how to set that up.

adamal avatar Jun 12 '20 12:06 adamal