Intellisense missing some types

Jan 17, 2015 at 2:00 PM
Edited Jan 17, 2015 at 2:01 PM
str1 = "aaa"
str2 = str("aaa")
str3 = u"aaa"
str4 = unicode("aaa")
With the above, PTVS intellisense recognizes str1 and str3 as str and unicode, but str2 and str4 are <unknown type>. I've noticed the same for some other types:
s1 = set("")  #<unknown type>
s2 = {1,} # set of int
Coordinator
Jan 17, 2015 at 3:31 PM
Strange... is your completion database up to date (see documentation)?
Jan 17, 2015 at 4:51 PM
At first I thought it was normal, but based on your comment, I dug a little deeper. I now realize the above can work. The easiest test is to hover on "str" or "unicode" and a tooltip will show relevant info if it's working.

It seems to be file or module related, because it works for me in some files but not others. I did refresh the database, and close and reopen VS. I was able to get "str", "unicode", and "set" to be recognized in one case by renaming the file. But then that same technique did not work for another file.

Adding a new file to the project, and pasting in the above seems to work. So I'm not sure yet how to reproduce or a consistent workaround.
Jan 17, 2015 at 5:22 PM
It seems to be related to imports, specifically, either one of these two immediately breaks intellisense as described in the first post:

from ctypes import *
from array import *

Once it's not working, to fix the file, I need to remove the "from xxx import *", and restart VS, or rename the file. I guess intellisense is cached, and I don't see a way to force a refresh.