T O P I C R E V I E W |
bins |
Posted - Jan 26 2016 : 1:03:21 PM 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 |
5 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Feb 01 2016 : 12:57:09 PM Excellent, I am glad it is so simple |
bins |
Posted - Jan 30 2016 : 10:14:32 AM #if 0 // symbols for VA #define WIN32_DEBUG #define ANDROID_DEBUG #endif
is just the thing!
thanks Rob |
feline |
Posted - Jan 29 2016 : 2:48:45 PM 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 |
bins |
Posted - Jan 29 2016 : 08:29:13 AM 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 |
accord |
Posted - Jan 28 2016 : 7:19:27 PM 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. |
|
|