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
 "Create implementation" annoyance
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Feb 12 2010 :  04:26:57 AM  Show Profile  Reply with Quote
This behavior is still present in VAX 1738...

In header I type the following:
void foo(int x);
After issuing the VAX command, the implementation looks like this:
void MyClass::foo( int x )
{

}
1) There is no newline-character after the scope. Wrong!
2) I do not want the spaces around the function argument. Annoyance!
3) If placed under "bar", the implementation should be inserted under "MyClass::bar" scope and not at the end of the file. Annoyance!

#1 could in fact produce a warning on some compilers.
#2 actually yields more typing than if I write all this manually.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 12 2010 :  6:21:38 PM  Show Profile  Reply with Quote
1. An extra <enter> (empty line) will help with this in the snippet for Create Implementation. You can edit snippets here:

VA Options -> Advanced -> Suggestions -> Edit VA Snippets (button)

Select the snippet for Create Implementation and here we go.

2. The spaces also can be deleted around the param. list by editing the snippet.

3. I agree. We are considering implementing this at some point:

case=12454

#1: what warning? which part of the created implementation is problematic? I'm really surprised.
#2: I hope that changing the snippet will help a little bit. Also, VA Outline can help dragging the function to the final location. The created implementation is selected by default in recent versions. This is to support moving the result. VA "cooks" you an empty implementation, takes you to the cpp so you just need to "specify" the location.

The actual logic contains a plus when you are working with more classes in the same file: it will find the place where you have put the other implementations for the class you are working with and put the new function after these functions. So VA keeps member functions grouped by classnames.
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Feb 15 2010 :  03:43:00 AM  Show Profile  Reply with Quote
#1: The C++ standard requires a newline-character at the end of each .h/.cpp. Nothing special about that, except that Visual C++ does not produce a warning. However, if I recall correctly, GCC will produce a warning.

ISO C++ Standard.

2.1/1.2 "If a source file that is not empty does not end in a new-line
character, or ends in a new-line character immediately preceded by a
backslash character, the behavior is undefined".
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Feb 15 2010 :  09:32:41 AM  Show Profile  Reply with Quote
The blank line at the end of the file, some UNIX compilers complain, some do not. We are considering changing VA to try and make sure there is normally / always a blank line at the end of the file:

case=158

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Feb 13 2015 :  8:18:12 PM  Show Profile  Reply with Quote
case=12454 is fixed in build 2059
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