intellisense not working

May 19 at 3:59 PM
Edited May 19 at 4:00 PM
This might be related to discussion:545337 but seems a bit different. I'm using the 2.0 ptvs VS Express bundle.

I've got a fairly complex project that I created a PTVS solution by 'importing from existing code'. The relevant structure of the project is sketched out below. The vistrails code is static and has not been imported into my ptvs project but is added to both the Path Environment Variable of my Environment and the project's Search Paths.

from the init.py file in the sahm folder I have the lines:
import utils
from vistrails.core import system

when I hover over either utils or system I get <unknown type>. I also get no intellisense, definitions, etc. Am I doing something wrong in getting these recognized by the project or is this a bug? I would think that import utils from init.py would be recognized without any path modification. The project launches and runs fine and in fact I can hover over utils when the project is running and it recognizes the module. But there is no intellisense in the Debug Interactive window.

project structure:
<some other location>(this code has not been imported into the solution project, but has been added to search path environment path)
..\vistrails\
    __init__.py
    \core\
     __init__.py
     system.py
<development workspace> (this code has been imported into the project and is what I'm trying to edit)
..\userpackages\
__init__.py
\sahm\
    __init__.py
    init.py
    utils.py


Thanks for the great product and any help you can provide.
Coordinator
May 19 at 4:51 PM
Does the search path you've added include vistrails or does it stop at the directory one level higher? (I think you're stopping one level higher, but the .. you put before the path makes me uncertain.) Python only sees names inside the search path, so import vistrails only works if your search path is a\b\c\vistrails\..\ (== a\b\c).

Importing utils may in fact be a bug. I've done some work in 2.1 to improve import resolution (in 2.0 it's sorta-kinda a bit like what Python 2.4 used, and in 2.1 we now match the 2.6-3.2 model). If you can, it'd be great if you can try the 2.1 beta or the latest dev build to see if it has been fixed already.

As for no IntelliSense in the Debug Interactive window, that is strange. If you are broken into a running Python program, we should be using dir() and equivalents to find IntelliSense directly from the objects. I'd be interested in the results of calling dir(utils) from Debug interactive - maybe there's some failure that is being silently ignored.
May 19 at 5:21 PM
Hello Zooba,

Thanks for your prompt reply! To cover my bases I had put both vistrails and it's parent folder into my search paths.

Inline image 1

I just tried to relaunch to test the dir(utils) from a breakpoint but Visual Studio crashed. When I restarted and relaunched my project dir(utils) did work as expected, and indeed the intellisense was working from the Python Debug Interactive window. Maybe I just needed to restart the VS application.

Thanks,
Colin


Colin Talbert
GIS Analyst and Developer
US Geological Survey

[email removed]

USGS Fort Collins Science Center
2150 Centre Ave. Bldg. C
Fort Collins, CO 80526
(970) 226-9425

USGS North Central Climate Science Center
(970) 492-4283

Work schedule:
Monday - 7:00 - 3:00 (NC CSC)
Tuesday - 7:00 - 3:00 (NC CSC)
Wednesday - 7:00 - 3:00 (FORT)
Thursday - 7:00 - 5:00 (NC CSC)
Friday - 7:00 - 5:00 (FORT)


Coordinator
May 19 at 5:27 PM
Restarting VS shouldn't be necessary, but yeah, sometimes it makes things work.

Since you just suffered a crash, could you have a look in your Event Viewer at the Application log for a recent ".NET Runtime" or "Application Error" event? There's a chance we may have a stack trace from the crash that will help us fix whatever caused it. (If you're sending error reports to Microsoft then we'll get it eventually, but it's easier to go direct when we can.)
May 19 at 5:43 PM
Attached are the latest two error reports. It looks like it might have been an out of memory error.

Looking at my task manager it looks like devenv *32 is using almost 3gb of memory. I thought I had installed the 64 bit version of the VS ptvs package but maybe not. In the python installation that I'm using for this project there are quite a few packages (scipy, numpy, gdal, etc, etc which total about 92 packages). There are also a lot of python files in my userpackages folder as well as Eclipse project files, and .git directories.

Thanks,
Colin

Colin Talbert
GIS Analyst and Developer
US Geological Survey

[email removed]

USGS Fort Collins Science Center
2150 Centre Ave. Bldg. C
Fort Collins, CO 80526
(970) 226-9425

USGS North Central Climate Science Center
(970) 492-4283

Work schedule:
Monday - 7:00 - 3:00 (NC CSC)
Tuesday - 7:00 - 3:00 (NC CSC)
Wednesday - 7:00 - 3:00 (FORT)
Thursday - 7:00 - 5:00 (NC CSC)
Friday - 7:00 - 5:00 (FORT)


Coordinator
May 19 at 6:03 PM
Unfortunately, attachments are removed when they're posted to a discussion thread. You can email them to ptvshelp@microsoft.com. VS itself is a 32-bit application, which limits memory use, and ultimately out-of-memory errors are difficult to diagnose. Including a lot of Python files in search paths is an easy way to cause problems (roughly equivalent to including lots of files in your project) - we have special handling for site-packages to avoid these issues but not yet for search paths.

If it starts becoming a repeated issue, I'll be interested in what you are doing leading up to it. Changing settings repeatedly (especially search paths) is likely to exacerbate problems, but that isn't really typical use - I get far more worried about some of the problems caused simply by editing files, since everyone does that all the time :(
Coordinator
May 19 at 6:28 PM
Thanks for the logs. Unfortunately there's no way to figure out the cause of the OOM error, which is typical. Feel free to get in touch if it starts happening regularly though.