Intellisense not working

Oct 12, 2011 at 6:08 PM

Hi,

I just installed Python Tools and IronPython 2.7. Everything seems to be working fine on the VS2010 IDE except by the Intellisense/Autocompletion. I have clicked twice already on the "Generate Completion Database" button which gets me to the dialog confirming that it will be available when the process completes. It does not seem to be working since even waiting for more than an hour I still don't see it available. Does anyone know what could be wrong?

Thanks.

Coordinator
Oct 12, 2011 at 6:20 PM

Do you see any Microsoft.PythonTools.Analzyer processes running on your machine? 

Also where are the completions missing - do you get completions against things like System and other .NET namespaces?  If not can you go into project properties and make sure that the interpreter for the project is set to IronPython or make sure that Tools->Options->Python Tools->Interpreter Options has the default interpreter set to IronPython?

Oct 12, 2011 at 6:43 PM

Thanks for your prompt response.

I tried again and was able to see the process running. It ran for about 10 secs or so. I am running it with the "Generate built-in and standard library databases". Still no autocompletion. Don't get autocompletion on the .NET namespaces either, but since I am new to Python and the PTVS, I am assuming I am missing referencing somehow such namespaces.

The interpreter should be set correctly. I don't get errors when running the programs. I just don't get any kind of intellisense or autocompletion. I have restarted VS also and still don't get anything. For instance, after I instantiate a string, I don't get intellisense for such string:

s = 'Test'

Writing "s." would not prompt any of the attributes of such string instance.

 



Coordinator
Oct 12, 2011 at 8:33 PM

Can you look in %LOCALAPPDATA%\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46 and see if there's an AnalysisLog.txt and attach the output there?  Also might be helpful to include %LOCALAPPDATA%\Python Tools\CompletionDB\AnalysisLog.txt as well (the 1st one is specific to a single interpreter, the 2nd one covers all of the interpreters).

Also, if you type "import " do you see any completions for things like System? 

Oct 13, 2011 at 3:55 PM

Hello dinov,

I am also experiencing the same issue here.

I had Python 2.6 installed on my computer after installing ArcGIS. I then installed IronPython (which I guess installed python 2.7) and then I installed python 3.2.

After installing Python Tools for VS, I generated completion database for all the versions of python I have installed.

 

I ran tree (in Command Line) on my %LOCALAPPDATA%\Python Tools\CompletionDb and got the following results

├───2af0f10d-7135-4994-9156-5d01c9c11b7e
│   ├───2.6
│   └───3.2
└───80659ab7-4d53-4e0c-8588-a766116cbd46
    └───2.7

 

 

This is the content of the %LOCALAPPDATA%\Python Tools\CompletionDb\ActivityLog.txt file

 

 

"2011/10/13 2:44:43.447 PM" "C:\Python32\python.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\2af0f10d-7135-4994-9156-5d01c9c11b7e\3.2" "START_SCRAPE"
"2011/10/13 2:44:43.918 PM" "C:\Python32\python.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\2af0f10d-7135-4994-9156-5d01c9c11b7e\3.2" "START_STDLIB"
"2011/10/13 2:46:39.453 PM" "C:\Python32\python.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\2af0f10d-7135-4994-9156-5d01c9c11b7e\3.2" "DONE (STDLIB)"
"2011/10/13 2:47:56.624 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_SCRAPE"
"2011/10/13 2:48:06.567 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_STDLIB"
"2011/10/13 2:48:38.846 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "DONE (STDLIB)"
"2011/10/13 2:48:38.883 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_SCRAPE"
"2011/10/13 2:48:48.873 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_STDLIB"
"2011/10/13 2:49:11.710 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "DONE (STDLIB)"
"2011/10/13 2:51:30.232 PM" "C:\Python26\ArcGIS10.0\python.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\2af0f10d-7135-4994-9156-5d01c9c11b7e\2.6" "START_SCRAPE"
"2011/10/13 2:51:35.890 PM" "C:\Python26\ArcGIS10.0\python.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\2af0f10d-7135-4994-9156-5d01c9c11b7e\2.6" "START_STDLIB"
"2011/10/13 2:55:21.230 PM" "C:\Python26\ArcGIS10.0\python.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\2af0f10d-7135-4994-9156-5d01c9c11b7e\2.6" "DONE (STDLIB)"
"2011/10/13 3:13:46.229 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_SCRAPE"
"2011/10/13 3:13:58.698 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_STDLIB"
"2011/10/13 3:14:25.985 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "DONE (STDLIB)"
"2011/10/13 3:14:50.709 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_SCRAPE"
"2011/10/13 3:15:02.282 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_STDLIB"
"2011/10/13 3:15:24.983 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "DONE (STDLIB)"
"2011/10/13 3:17:24.901 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_SCRAPE"
"2011/10/13 3:17:35.793 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_STDLIB"
"2011/10/13 3:18:01.520 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "DONE (STDLIB)"
"2011/10/13 3:18:20.551 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_SCRAPE"
"2011/10/13 3:18:31.986 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "START_STDLIB"
"2011/10/13 3:18:56.083 PM" "C:\Program Files\IronPython 2.7\ipy.exe" "C:\Users\Alex\AppData\Local\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46\2.7" "DONE (STDLIB)"


 

I tried this code in Visual Studio and I did not get any intellisense while entering the code.

 

print("Enter a message to be echoed on the screen or type EXIT to quit.")

message = input(">")

while message.lower() != "exit":
    print(message + "\r\n")
    message = input(">")

 

Afterwards, I tried to 'forcefully' invoke intellisense by clicking after the period before the lower() statement (on the while line) and choosing Display an object Member List but I still got nothing.

What could possibly be wrong and how do I get it fixed?

 

Coordinator
Oct 13, 2011 at 5:36 PM

franzalex: From the logs it looks like the intellisense database should have successfully been generated so now we need to figure out why it's not being displayed.  While you shouldn't have to do this, have you tried re-starting VS?  Also, do you see completions for something simpler like:

   x = 42

   x.

 

I'm just concerned it's possible we wouldn't know the return type for input() and that might be more likely for 3.x.   

Also, do either of you have any other extensions installed in VS?

Oct 14, 2011 at 11:29 AM

@dinov:

I checked the extensions that were installed in Visual Studio and I found that IronPython had left behind some extensions.

This is how I fixed the issue:

  1. Uninstalled Python Tools for VS
  2. Uninstalled IronPython
  3. Removed the leftover files in the C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\CommonExtensions\Microsoft directory
  4. Installed IronPython without Tools for Visual Studio.
  5. Installed Python Tools for VS.

I now have intellisense and tooltips for member variables.

 

Thanks for the help.

Coordinator
Oct 14, 2011 at 4:13 PM

Thanks for the reply back w/ the fix, hopefully that'll help other people who are having the same issue.

Oct 17, 2011 at 3:24 PM

@dinov:

Don't see specifically %LOCALAPPDATA%\Python Tools\CompletionDB\80659ab7-4d53-4e0c-8588-a766116cbd46 as you mentioned and as franzalex reports, however I do have the directory under another GUID. This is the one I have:

%LOCALAPPDATA%\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7

This is the content of the ActivityLog.txt file:

"2011/10/12 12:10:10.887 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "START_SCRAPE"
"2011/10/12 12:10:19.669 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "START_STDLIB"
"2011/10/12 12:10:31.625 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "DONE (STDLIB)"
"2011/10/12 1:49:51.292 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "START_SCRAPE"
"2011/10/12 1:49:55.680 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "START_STDLIB"
"2011/10/12 1:50:07.861 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "DONE (STDLIB)"
"2011/10/12 1:50:52.627 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "START_SCRAPE"
"2011/10/12 1:50:57.375 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "START_STDLIB"
"2011/10/12 1:51:09.076 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "DONE (STDLIB)"
"2011/10/12 2:32:21.273 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "START_SCRAPE"
"2011/10/12 2:32:25.558 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "START_STDLIB"
"2011/10/12 2:32:37.074 PM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "DONE (STDLIB)"

"2011/10/17 11:15:00.530 AM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "START_SCRAPE"

"2011/10/17 11:15:06.954 AM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "START_STDLIB""

2011/10/17 11:15:23.828 AM" "C:\Program Files (x86)\IronPython 2.7\ipy64.exe" "C:\Users\rbriceno\AppData\Local\Python Tools\CompletionDB\36aad816-5bf2-4179-96df-b61ec2fa76e9\2.7" "DONE (STDLIB)"

 

Let's try uninstalling and installing as franzalex mentions. However, I do not have the leftover files in the Microsoft path (step 3).

 

Thank you both.

Oct 17, 2011 at 3:45 PM

Yeap, uninstalling and installing the way franzalex indicated does the trick. Thank you both.

Jun 26, 2012 at 12:45 PM
Edited Jun 26, 2012 at 12:48 PM

Hi guys, I'm having the same problem with Intellisense, but uninstalling and re-installing the way franzalex suggested didn't work. I reinstalled VS2010 totally, too.

Nice thing is that yesterday it worked, but today it's not working anymore.

What seems strange to me is that in VS2010 About Window I see 2 versions of PTVS, 1.0 and 1.1.50530.0. If I uninstall PTVS, they both disappear, and as I reinstall it they both reappear.

Any idea?

Jun 26, 2012 at 1:27 PM

I uninstalled PTVS 1.5.1 and reinstalled an earlier version (1.1.1), and it works for the first instance of VS2010. As I close the program and restart it, there's no more intellisense until I install a different version of PTVS, so I have to bounce between 2 versions of PTVS

Coordinator
Jun 26, 2012 at 4:43 PM

Hi paeletta, do you also have IronPython installed or are you just using PTVS w/ normal Python?

Either way can you try uninstalling PTVS and then going to C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\CommonExtensions\Microsoft and deleting any files related to PTVS there?  If you did an Advanced install and selected all users these files will actually be in %LOCALAPPDATA%\Microsoft\VisualStudio\10.0\Extensions\Microsoft.  Then re-installing PTVS and see if you have 2 versions listed in Help->About and/or if the problem persists?

Jun 27, 2012 at 8:43 AM

It's completely working now!!

I had some IronPyton Tool files left over in C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft, so what I've done is:

 - Uninstall PTVS

 - Uninstall IronPython

 - Remove leftover files from C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft

 - Install IronPython

 - Install PTVS (from version 1.5 Beta 1 support for IronPython is installed by default)

Thank you very much for your support

Jun 27, 2012 at 8:51 AM

The steps you described are just the same as I provided earlier.
just saying...

Anyway, it's good to know it's working for you now.

Jun 27, 2012 at 9:04 AM

More or less, my problem was that leftover files were in ...\IDE\Extensions\Microsoft instead of ...\IDE\CommonExtensions\Microsoft

 

Anyway, thank you franzalex, too!