Intellisense not working with doc string info from .pyd file - PTVS 1.1

Feb 12, 2012 at 9:34 PM

Python Tools 1.1, downloaded Feb 12th, ~noon mountain time zone.
Python 2.7.1 downloaded form Using 32-bit Python, on a 64 bit Win7 box.

We have a .pyd file (built from boost::python) that has doc string information in it. A typical Python script looks like this:

import ourlib

We have the needed paths set up (from the command line where we invoke devenv.exe) in the devenv.exe environment so that the previous script will run when the script is ran with the debugger. This script will run in Debug and Release mode from within VS when we do a "Start Debug", but not when we do a "Start without Debug". Granted - that last bit doesn't really matter - just an FYI.

The Python interactive window is able to do module level and member method Intellisense - but only names. No doc strings. The method parameters do not show up in the parameter list.

The real issue is that when we are in the editor we get no Intellisense whatsoever for any part of our compiled .pyd module. Intellisense works for all the other Python standard libraries. As a side note, we have done a "Tools->Options->Python Tools->Interpreter Options->Generate Completeion Database" several times, and we have done several VS restarts. Also, we have tried not setting the paths prior to invoking devenv.exe from the command line, and instead setting them via the "Search Paths" text box under the Debug section of the project settings. That doesn't change anything. We have also tried setting the environment variables from the command line AND for the project search paths. That doesn't work either.

Python's idle can see our doc string information from our compiled .pyd module.

What can be done to get Python Tools for Visual Studio to display our doc string information in the editors Intellisense?

We would be willing to jump through some serious loops and use nightly builds to get this to work. We have an internal tool that makes extensive use of Visual Studio's plug in model to add docking windows (for controlling hardware) and the like for our users. Due to the complexity of our API no Intellisense isn't an option for our users. Currently the alternative is to use Eclipse or something like it to do script development, then run the already developed script in Visual Studio to be able to use the UI part of our solution.

We would be willing to provide source code or work with a PTVS engineer via shared desktop to trouble shoot this issue. Please feel free to contact me off line if it would be helpful.

Feb 12, 2012 at 9:49 PM

I almost forgot another thing I tried - in case you wondered if we had tried it.

We put our .pyd file in C:\python27\DLLs, then added the needed directory for boost to our %path% variable, then started PTVS. We then regenerated the completion database via VS. We were able to run the script (with nothing set in for the project paths). But still no Intellisense in the editor. The PTVS Python repl window still gave us module and member method Intellisense, but no doc string information.



Feb 12, 2012 at 10:06 PM
Edited Feb 12, 2012 at 10:06 PM

And of course... the follow up on how to fix my own issue.

The release notes:

This contains the following: "For CPython users you can now add a reference to a .pyd extension module enabling analysis of the extension to provide completions." I was being too pythonic/C++-ish in my thinking. Making sure that the .pyd file was in a path, and therefor referenced, did not qualify as explicitly "adding a reference" to a .pdy extension". To do what I wanted I needed to go to the references node of the project, then manually select the needed .pyd file.

User error.

Glad I could be of some entertainment for all of those involved.