Reputation: 736
I'm new to Python and I'm trying to use VS Code as IDE, and it's IntelliSense (auto-completion) to improve the development.
But I find that the IntelliSense is not working for object instances in the Editor Tab.
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.
The code used in the image 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)
Upvotes: 3
Views: 6439
Reputation: 15990
The reason it works in the interactive window is it is working against live data, and so Python itself can say what things should be. But in the editor windows it's all inferred via IntelliSense which is much harder to get right. If you tried both Jedi and MPLS as IntelliSense engines and neither work then I'm afraid there isn't much to do until one of them improves enough to work in that specific situation.
Upvotes: 3