2

Resolved

No intellisense on inherited members or methods in wxPython

description

It appears that intellisense is not working for inherited methods in wxPython. In the "hello world" example below, intellisense works properly until you reach "c.SetSelectedString()." At this point, intellisense only provides the methods and members defined in wxChoice. It does not include all the methods and members from parent classes (e.g. wxWindow).
import wx
class MyFrame(wx.Frame):
    def __init__(self, parent, title, **kwargs):
        wx.Frame.__init__(self, parent, title=title, size=(200,100))
        self.control = wx.TextCtrl(self, style=wx.TE_MULTILINE)
        self.Show(True)
        c = wx.Choice(self, 3)
        c.SetSelectedString()
        
app = wx.App(False)
frame = MyFrame(None, 'Small Editor')
app.MainLoop()
I've attached my diagnostic information as well. I hope this can be resolved, because is by and far the better Python IDE out there.

file attachments

comments

delind wrote Feb 10 at 4:52 PM

I have the same issue with other third party packages. PySerial serial.Serial objects, for example, don't display any attributes of the base class serial.SerialBase.

Elegant IDE but the Intellisense is unfortunately kinda limited to built-ins.

Both Komodo Edit and PyScripter handle this without any issue.

Zooba wrote Feb 11 at 1:05 AM

This should be happening all types in the standard library and site-packages because when we analyse these we don't save information about base classes for any of them. I'll get this fixed for our next version.

As a workaround, you can try adding the path to wxPython (inside site-packages, the folder that contains the 'wx' folder) as a search path (right-click the Search Paths folder in Solution Explorer), which will then analyse it as part of your project instead of part of your library. This will significantly increase the CPU and memory usage of VS (wxPython is not exactly a small project) and it may take a few minutes before any completions will show up, but it should do the base class lookups correctly. (Incidentally, wx.Choice does not have a SetSelectedString() method, but SetSelection() is there.)

This should also work with PySerial, though the Serial class also benefits from disabling "Member completion displays intersection of members" (under Tools->Options->Text Editor->Python->Advanced) because we detect eight different possible implementations of Serial. (We're also looking at changing this setting for our next version to avoid these sort of issues.)

Zooba wrote Feb 27 at 4:12 PM

Fixed in 2.0 feature branch.

delind wrote Mar 9 at 4:53 PM

Just upgraded to PTVS 2.0 and the Intellisense is working great. Thanks for the good work!

Zooba wrote Mar 9 at 9:13 PM

Glad to hear it!

mcdevitts wrote Mar 12 at 4:33 AM

Totally agree with the previous comment. The fixes to intellisense are excellent.