Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Non-standard C++

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
dushan Posted - Jul 20 2006 : 3:21:14 PM
Hi,

My workplace uses a custom preprocessor that adds a number of non-standard features to C++. Replies to a post I made to this forum a few months back have helped me to get VA to work reasonably well with our codebase (thank you!), however there's still one major problem remaining.

Our preprocessor adds an 'extends' keyword, which as far as VA is concerned is identical to ': public'. Unfortunately there's currently no way of telling VA that this is the case. I avoid it like plague in my own code but there's an awful lot of code I have to deal with on daily basis that doesn't.

Is there any chance you could add an optional preprocess step before VA starts parsing the source file? A simple search & replace given a user defined dictionary would fix our problem and provide a useful workaround for others dealing with non-standard C/C++ code.

Thanks
9   L A T E S T    R E P L I E S    (Newest First)
support Posted - Jul 24 2006 : 6:06:03 PM
Our mistake. We should have mentioned you needed the fix for case 1213 which is available only in the 15xx builds.
dushan Posted - Jul 24 2006 : 5:49:50 PM
Thanks Feline, that did the trick!

I hope that this is an official feature and that it won't be going away in future builds...

I've got to say that 1530 feels a lot snappier than 1440 and I love the new refactoring tools.

Fantastic job!
feline Posted - Jul 23 2006 : 3:26:52 PM
quote:
Originally posted by dushan

We're using the stable build (1440) right now, should I try the latest beta build?


using VS2005 and VA 1530 i tried placing the #define into:

C:\\Program Files\\Visual Assist X\\Misc\\StdAfx.h

and then placed your two sample classes into a .h file, and VA parsed the code correctly for me. so it looks like this should work for you in 1530.
feline Posted - Jul 22 2006 : 11:40:29 AM
the latest beta is worth trying on its own merits, the refactoring support has already become completely invaluable to me however i have no idea if the latest beta will work any differently in this case.

i intend to try this experiment myself for the Qt signals and slots, it is just a case of finding the time to do so.
dushan Posted - Jul 21 2006 : 1:40:47 PM
Moving the #define to StdAfx[Va].h and adding the parens produces the same results. The 'EXTENDS' is recognised ('Alt+G' jumps to the StdAfx file) but the subclass still fails to parse.

We're using the stable build (1440) right now, should I try the latest beta build?
support Posted - Jul 21 2006 : 12:12:36 PM
VA X expands preprocessor macros that have parens. Hence, you might try:

#define EXTENDS() : public

Put this in stdafx.h in the Misc subdirectory of your VA X installation directory. Then press Rebuild on the Performance node of our options dialog and restart your IDE. (VA X only reads its own stdafx.h during full parsing.)

If you want to save a step, press Rebuild and exit your IDE. Change stdafx.h and restart your IDE.

We haven't tested the example ourselves. Let us know what you discover.
jpizzi Posted - Jul 21 2006 : 01:04:58 AM
Did you try it in one of the two mentioned files? VA treats those differently than ones in the code.
dushan Posted - Jul 20 2006 : 6:55:36 PM
I have tried #defining 'extends' before with no luck.

As a quick test I just tried:

#define EXTENDS : public

class ClassA
{
public:
int foo();
};

class ClassB EXTENDS ClassA
{
public:
int bar();
};

Although VA knows that 'EXTENDS' is a define (it's purple), it fails to parse ClassB correctly ('ClassB' has a red wavy underline, no auto-completion on instances of ClassB). So unless VA treats #defines in StdAfx.h differently, this won't work.

It appears that the VA parser doesn't expand #defines - which I believe is the right thing to do. It would be nice if VA had a simple string replace step before the parser kicks in, driven by a text file with a bunch of 'map from' / 'map to' pairs.

Edit:
Incidentally, I think this would also help with Qt issues (e.g. topic 4990) as 'public slots:' and 'signals:' could be mapped to 'public:'.
feline Posted - Jul 20 2006 : 5:38:03 PM
you could try adding a #define like to tell VA that "extends" is the same as ": public" to either:

C:\\Program Files\\Visual Assist X\\Misc\\StdAfx.h

or

C:\\Program Files\\Visual Assist X\\Misc\\StdafxVa.h

i am not sure that this would work, but it might. you would need to restart your IDE after making such an edit, and you may need to rebuild your symbol database.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000