3

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.

enter image description here

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)
0

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

3 Comments

We're currently doing a lot of work on the Microsoft Python Language Server that will hopefully improve things in the near future.
Wonder if any progress has been made on this issue? Seems like this is still a problem with Pylance too @BrettCannon
@hsl no progress and I wouldn't expect any in the short-term as this isn't something that's easy to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.