Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Support for python (work with pytools)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

stephenk
New Member

8 Posts

Posted - Sep 21 2012 :  10:02:50 AM  Show Profile  Reply with Quote

(I'm not sure whether this is an issue with pytools or vassist,
but am posting here since we paid for vassist! :) )

For "open file in solution" VassistX seems to be able
to open all files which are added to c++ projects.

However it doesn't seem to see files which are part of python
projects. (e.g. as in http://pytools.codeplex.com/)


To reproduce:

Create a c++ project.
Add an arbitrary file to the project.
See it shows up in "open file in solution"

Create a python project.
Files in this project do not show up in "open file in solution" dialog
Expected: they show up.


Eventually it would be nice if pytools and/or vassist could interoperate to get find symbol working also but this would
be a good start.

Stephen.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 22 2012 :  6:54:39 PM  Show Profile  Reply with Quote
I have been playing with the mentioned extension and Visual Assist, trying to find a way to make it work for you. I wasn't able to find any convenient workaround, but at least I found one, even if it's clumsy. :)

But first, about the problem. I have put in a bug report, kind of a question, about why doesn't VA list the files. The files are listed in the solution explorer, but it seems that the files are not reported by VS's project API for some reason:

case=69488

Now the workaround: you can tell VA to handle py files as they would be C++ files:

http://docs.wholetomato.com?W328

VA have a feature that parses all other files in any directory after you open a source file, and list them in Open File in Solution dialog. But the "catch" is that you need to open a cpp file. So you would need to put an empty cpp file in your directory where you store the files and open it as first thing after you started VS, so VA parse all other source files, including .py files. This workaround is even more limited if you use a lot of directory.

I have put in an enhancement request for this to work when you open .py files:

case=69487

But the correct fix would be solving case=69488 but I'm not sure how easy would it be and whether it's possible.

Edited by - accord on Sep 22 2012 6:56:47 PM
Go to Top of Page

stephenk
New Member

8 Posts

Posted - Sep 24 2012 :  12:24:58 PM  Show Profile  Reply with Quote

Thanks for the quick response! Are the case=X internal bug numbers or do you have a link for them?

BTW I notice the python projects look quite different to "normal" c++ projects. E.g. look at the property sheet on the project. I wonder is there a different automation interface?
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 24 2012 :  1:44:02 PM  Show Profile  Reply with Quote
I got reply and have good news. VA have a white list for non-standard projects. This is because some crash had happened because of other extensions, so it is safer this way.

To enable pyproj's files in alt+shift+o dialog, create a new string registry entry with the name CustomProjectExtensions with the content .pyproj; here:

HKEY_CURRENT_USER\\Software\\Whole Tomato\\Visual Assist X\\VANet11

I did a quick test in my small python test project, and it worked. Hopefully it will be stable for everyday use as well.
Note that this is an unsupported option. Also, we don't test extension projects, so no guarantee that it will work for all project types.

Hope this helps.

Edited by - accord on Sep 24 2012 1:47:30 PM
Go to Top of Page

stephenk
New Member

8 Posts

Posted - Sep 25 2012 :  04:25:56 AM  Show Profile  Reply with Quote

That's fantastic news, thanks! That works and solves 90% of what I need.

The last 10% is wish-list stuff :). Roughly in order of priority:

Alt-G doesn't work in python files, but F12 (the intellisense version?) does. It would be great if Alt-G (which is strongly in muscle memory) could fall back to the intellisense version for file types it doesn't know about.

It would be nice if "Find Symbol" and "Find References" worked also. Presumably pytools has this information since it has an object browser and refactoring support? I don't know if it can make the data available to vassist however.

Thanks,
Stephen.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 25 2012 :  3:01:58 PM  Show Profile  Reply with Quote
Basically, python tools provides some intellisense, as I read on their web page. You can bind alt+g to do as you would hit F12 through Visual Studio's key configuration dialog:

Tools -> Options... -> Environment -> General -> Keyboard

Here, type Edit.GoToDefinition to the search bar, and re-bind it to alt+g.

We don't use Intellisense for "Find Symbol" and "Find References" (as we have our own parser), but I read on python tools's web page that Find References works out of the box.
So, in theory, only Find Symbol remains, which is 3.33%-ish (1/3 of 10%)

For this last 3 percent, just hit ctrl+, to see what happens. If the list is empty, ask them if they can make it work or provide their own dialog. Python Tools already looks awesome so I'm sure they're willing to improve it even further.

Edited by - accord on Sep 25 2012 3:02:58 PM
Go to Top of Page

stephenk
New Member

8 Posts

Posted - Sep 26 2012 :  04:47:09 AM  Show Profile  Reply with Quote
quote:
You can bind alt+g to do as you would hit F12


Ah, but then I'll lose the binding for C++. Or have to toggle it back & forth for C++. In fact our workspace has both c++ projects and a python project. And Vassist.GotoImplementation is normally much better than the intellisense version.

The situation for "find references" is similar. Yes pytools provides a "find references" but I don't want to have to remember two parallel sets of key bindings. And I don't want to have to remember which ones to use depending on which file type I happen to have open. Muscle memory!

Really, I'd love if there was an option (or by default) vassist could just fall back to intellisense for projects it doesn't know how to deal with. I'd be delighted if the idea was at least mooted to the dev team.

Thanks for your help,
Stephen.

Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 26 2012 :  11:42:09 AM  Show Profile  Reply with Quote
Ok, will do that. But one more question, first: you use alt+g or the goto button, it's trivial. But how do you use Find References, normally? Via a keyboard shortcut bound to VAssistX.FindReferences? If you use right click, "Find all references" is there, and it may be easier to learn to use that, that getting use to a new shortcut. What do you think?
Go to Top of Page

stephenk
New Member

8 Posts

Posted - Sep 26 2012 :  12:31:02 PM  Show Profile  Reply with Quote
I almost always use keyboard shortcuts, have hidden all the toolbars and use context menus only rarely. So I'm more likely to learn the duplicate bindings for now.

I don't remember if I have changed the binding from default but
ctrl+shift+f -> vassist.FindReferences
ctrl+shift+s -> vassist.FindSymbol
ctrl+shift+o -> vassist.OpenFileInSolution
alt+m, alt+o, alt+g I assume are default bindings.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 27 2012 :  1:12:42 PM  Show Profile  Reply with Quote
I have put in a feature request to fall-back to default intellisense in non-supported files to see what the developers make of it:

case=69605

This is for alt+g and find reference's defined shortcut, alt+shift+o and alt+o should work as normal (do you use alt+o in python?), and I think there is no alternative shortcut for alt+m in intellisense.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000