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
 1614: Formatting issue with "Move Implementation"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

MrDoomMaster
Tomato Guru

251 Posts

Posted - Oct 29 2007 :  2:02:59 PM  Show Profile  Reply with Quote
IDE: Visual Studio 2005

Assume you have the following two files:
foo.h
foo.cpp

Suppose the following class (in foo.h):

class foo
{
private:
    u32 m_one, m_two;

public:
    foo( u32 one, u32 two )
        : m_one( one )
        , m_two( two )
    {
    }
};


Now right click on foo's constructor (above) and click "Move Implementation to source file". Notice the output in foo.cpp:

foo::foo( u32 one, u32 two ) : m_one( one )
, m_two( two )
{

}


There's two issues with the output generated in foo.cpp by the move operation:

1) Notice that the whitespace before each member in the initializer list has been removed.
2) Notice how the first member in the initializer list, m_one, was removed and put on the same line as the constructor header.

Expected Behavior:
-------------------------------
The output should appear as follows. Whitespace, including carriage returns, should all be retained when moving the implementation over to the CPP/IPP file.
foo::foo( u32 one, u32 two )
    : m_one( one )
    , m_two( two )
{

}

feline
Whole Tomato Software

United Kingdom
19017 Posts

Posted - Oct 29 2007 :  4:03:23 PM  Show Profile  Reply with Quote
I am seeing the same thing here:

case=9594

The missing carriage return can be fixed by changing the formatting of the snippet "Refactor Create Implementation". Change the line:

$SymbolType$ $SymbolContext$( $ParameterList$ ) $MethodQualifier$

to:

$SymbolType$ $SymbolContext$( $ParameterList$ )
$MethodQualifier$

But this does not help with the fact the white space was removed. As an aside, zero indenting of the initializers in the cpp file is the formatting the IDE its self wants to apply.

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

MrDoomMaster
Tomato Guru

251 Posts

Posted - Oct 29 2007 :  4:15:54 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline

As an aside, zero indenting of the initializers in the cpp file is the formatting the IDE its self wants to apply.



The IDE will only apply formatting as you type. In other words, it watches for specific key input events (such as RETURN) to know what kind of whitespace to insert for you. Visual Assist, however, should be doing nothing more than inserting text into the edit control (text editor area). If VAX fails to insert whitespace, the IDE should have nothing to do with that as it is the functionality of the extension- not the IDE.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19017 Posts

Posted - Oct 29 2007 :  5:56:09 PM  Show Profile  Reply with Quote
I agree about the IDE formatting, I was simply mentioning it as a passing point. Personally I have given up fighting with the IDE over code formatting, at least most of the time.

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