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
 Custom dictionary
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bins
Ketchup Master

United Kingdom
77 Posts

Posted - Jan 26 2016 :  1:03:21 PM  Show Profile  Reply with Quote
I'm not sure what to call this really, but I work with code that compiles for multiple platforms and configurations, and we generate a different solution based on platform. This means that for example if I'm building for android that other platform defines are not defined e.g. WIN32_DEBUG, so I have to type that in in full.

Anyway what I want is for VA to work a bit like my phone for tokens/words which it doesn't have in its db and 'learn' from what I type.

not a biggy really, just would be nice

thanks
Rob

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 28 2016 :  7:19:27 PM  Show Profile  Reply with Quote
Do you regenerate your file(s) where you keep your defines?

Are you aware of Insert Snippet menu? You can invoke it via this icon:



You can use the "Create VA Snippet from selection..." from that menu. You can bind a keyboard shortcut to it via the command "VAssistX.VaSnippetInsert". So you can easily create new snippets for macros that you use often. Just use Ctrl+W to select the macro you typed.

Edited by - accord on Jan 28 2016 7:20:37 PM
Go to Top of Page

bins
Ketchup Master

United Kingdom
77 Posts

Posted - Jan 29 2016 :  08:29:13 AM  Show Profile  Reply with Quote
Well the define in question isn't defined - so VA won't _ever_ find it - but in the course of my typing I'll still end up using that - e.g. wrapping stuff in
#ifndef WIN32_DEBUG
// non-windows code here
#endif


Yes I do have some snippets to expand stuff (and of course I can use that) - I was just wondering if some kind of add user symbol would be possible.

cheers
Rob
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Jan 29 2016 :  2:48:45 PM  Show Profile  Reply with Quote
For wrapping code, the snippet:

#ifndef WIN32_DEBUG
$selected$
#endif


will help, but you will still need to trigger and insert the snippet. You can set a single character, with the "Surround With" setting, in the VA Snippet Editor for your snippet.

VA will learn symbols that it sees defined in your code, but since the defines are not defined, you can manually define them in some inactive code, e.g.

#if 0 // symbols for VA
#define WIN32_DEBUG
#define ANDROID_DEBUG
#endif


This works since VA parses inactive code, so it can help you edit it. Or, if you don't want to add this to your solution, you can create a file called "va_stdafx.h" and place this in the same folder as your SLN or VCPROJ files. There is no need to add this file to your solution, VA searches for it automatically.

Place the lines:

#define WIN32_DEBUG
#define ANDROID_DEBUG


into this file, making sure the file ends with a blank line. Then rebuild your VA symbol database and restart the IDE:

VA Options -> Performance -> Rebuild symbol databases

I have just tried this here, using VS2013, and VA now knows these symbol names, and will suggest them as I type.

https://wholetomato.fogbugz.com/default.asp?W302

zen is the art of being at one with the two'ness
Go to Top of Page

bins
Ketchup Master

United Kingdom
77 Posts

Posted - Jan 30 2016 :  10:14:32 AM  Show Profile  Reply with Quote
#if 0 // symbols for VA
#define WIN32_DEBUG
#define ANDROID_DEBUG
#endif

is just the thing!

thanks
Rob
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18749 Posts

Posted - Feb 01 2016 :  12:57:09 PM  Show Profile  Reply with Quote
Excellent, I am glad it is so simple

zen is the art of being at one with the two'ness
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