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
 Technical Support
 Autocorrect treats class names as constructor
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Shambler
Senior Member

48 Posts

Posted - Aug 24 2014 :  05:50:02 AM  Show Profile  Reply with Quote
This is for the autocorrect option: Insert () and closing } ) ] ' "

Whenever I type a class name, and hit tab to auto-complete from the popup suggestions, this always adds a () after the class name, as if it is the class constructor being called.

This happens very regularly in pretty much all C++ code, and actually interrupts code flow, such as when I want to do something like "ClassName* VarName = NULL;", when I autocomplete I start with "ClassName()", then have to remove the (), and continue with the rest.

It would be good to either have the option to remove autocorrect for constructors, or to make autocorrect more intelligent about when it does that with constructors.

Edited by - Shambler on Aug 24 2014 05:52:29 AM

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 24 2014 :  12:41:39 PM  Show Profile  Reply with Quote
Strange, I am not seeing this happen here. Does this happen in both .cpp and .h files, or mainly just in .h files?

Which IDE and version of VA are you using?

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

Shambler
Senior Member

48 Posts

Posted - Aug 24 2014 :  5:17:09 PM  Show Profile  Reply with Quote
I think I've narrowed it down to only occurring with classes using a macro to define whether they are dllexport or such, i.e. "class PACKAGE_API ClassName : public Parent" vs "class ClassName : public Parent"

It looks like it might be the case, that PACKAGE_API is not defined until compile time (might only be in compiler commandline defines), or something similar like that, which could be breaking or confusing parsing within VAX.

It occurs in both .h and .cpp files, and I have VS2013 Update 3, with latest VAX (2014.07.10).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 25 2014 :  1:46:00 PM  Show Profile  Reply with Quote
Can you please try creating a new text file, called "va_stdafx.h" and place it in the same directory as your .SLN or one of your .VCXPROJ files. Edit the file and insert the line:

#define PACKAGE_API

making sure the file ends with a blank line. Now press the button:

VA Options -> Performance -> Rebuild symbol databases

and restart your IDE.

There is no need to add this file to the solution, its a helper file that VA looks for, and it is used to help our parser understand complex code. Hopefully this will help here. This FAQ entry explains about using this file:

http://docs.wholetomato.com/default.asp?W302

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

Shambler
Senior Member

48 Posts

Posted - Aug 25 2014 :  3:57:05 PM  Show Profile  Reply with Quote
Thanks - I tried that now, though it didn't seem to fix the issue.

I grabbed the latest version of the project I'm working on, from source control, and that doesn't seem to have the issue anymore - I spent a while diffing the (quite large) codebase, to try and track down what changed to fix this, and wasn't able to figure it out.

I still have the old project folder containing the problem though, so can try out more things if you like - otherwise though, doesn't seem to be a problem with latest code, but I'll keep an eye out for it occurring again.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Aug 25 2014 :  6:25:29 PM  Show Profile  Reply with Quote
Since this is now working correctly for you, its probably not worth spending any more time on. The solution, if we had to find one, would simply be to provide VA with a definition of the macro that makes sense, and that fixes the problem, and it sounds like your recent code update has already achieved this.

Obviously if you encounter any new problems, or if this problem comes back again, then please do let me know and I will do what I can to help you.

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