python-language-server
python-language-server copied to clipboard
Auto-completion (IntelliSense) not working for object instances in the editor tab
IntelliSense is not working for object instances in the Editor Tab.
Environment data
- VS Code version: 1.43.2
- Extension version (available under the Extensions sidebar): 2020.3.71659
- OS and version: Windows 10
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.6, Anaconda 3.7
Actual behaviour and Expected behaviour
I have the example on the figure below, where I created a figure and tried to access its properties via IntelliSense on the editor tab: the properties are not available, only variables.
What is curious is that: on the Python Interactive Tab, the IntelliSense (autocomplete) works fine, for the same object. This example is in the same figure below.
I've tried to disable the Jedi IntelliSense, but it didn't change anything.
Auto-completion works fine for imported modules. For instance: If I type np. it shows functions of numpy package

Steps to reproduce:
The code used in the image above is as follows
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0,10,1000)
y = np.cos(x)
fig,ax = plt.subplots()
ax.plot(x,y)
What is curious is that: on the Python Interactive Tab, the IntelliSense (autocomplete) works fine, for the same object. This example is in the same figure below.
The interactive window is a real running Python process. It can fetch any live data it needs. The language server is static, and can only discover things that are visible directly as written in the code. There's a big difference there, especially for libraries that are written dynamically.
@jakebailey is there any way of getting around it? are you aware of any issues that are of a similar nature?