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 & Move Refactoring error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

blq
Junior Member

Sweden
18 Posts

Posted - Oct 11 2006 :  05:36:28 AM  Show Profile  Reply with Quote
Having C-style comments *with commas inside* in a method argument list causes Create&Move refactoring to format incorrectly.

Example: int dummy(/*bla, bla*/);

Refactoring "Create Implementation" and "Move Implementation to Source File" => int dummy(/*bla*/, bla*/)

// Fredrik




Edited by - blq on Nov 29 2006 05:58:20 AM

blq
Junior Member

Sweden
18 Posts

Posted - Oct 11 2006 :  05:40:44 AM  Show Profile  Reply with Quote
I've been using 1535 & 1538 btw.

Edited by - blq on Dec 14 2006 05:24:07 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Oct 11 2006 :  1:08:43 PM  Show Profile  Reply with Quote
confirmed

case=2970

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

bugfix
Tomato Guru

Germany
324 Posts

Posted - Dec 14 2006 :  12:25:45 PM  Show Profile  Reply with Quote
just wanted to add that 'Extract Method' is also affected

http://www.mf-sd.de
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Dec 14 2006 :  5:57:54 PM  Show Profile  Reply with Quote
how are you triggering this problem with Extract Method? Using the function:

static void testingExtract()
{
    int nFoo = 0;
    nFoo = 3; /* there is a comma, in this comment */
}


and extracting the line with the comment I am not seeing any problems.

zen is the art of being at one with the two'ness

Edited by - feline on Dec 14 2006 5:58:29 PM
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Dec 15 2006 :  03:20:11 AM  Show Profile  Reply with Quote

class bla
{
    STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid)
    {
        static const IID* arr[] = 
        {
            &GUID_NULL,
        };

        for (int i=0; i<sizeof(arr)/sizeof(arr[0]); i++)
        {
            if (InlineIsEqualGUID(*arr[i], riid))
                return S_OK;
        }
        return S_FALSE;
    }
};


now select the for loop and do extract method.

i found this thread after searching for STDMETHOD which pointed me first to TOPIC_ID=5440 and then i ll ended up here:)
looking closely there seems to be another bug... the new methods first param uses 'static' as qualifier.

http://www.mf-sd.de

Edited by - bugfix on Dec 15 2006 03:20:35 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Dec 15 2006 :  10:07:01 AM  Show Profile  Reply with Quote
static not being removed from the parameter is a known problem

case=4037

When I extract the for loop I get a mismatched bracket on the function:

STDMETHOD( MyMethod( static const IID* arr, REFIID riid )

case=4125

the function is also wrapped in "STDMETHOD", does this seem sensible? I don't claim to understand why STDMETHOD is used, so I don't know if this is sensible or not.

There is also a problem where the new function is called, its value is returned directly. however, thinking about this, I am not sure there is anything VA can do about this, other than possibly display a warning suggesting you are doing something unwise.

case=4126

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

bugfix
Tomato Guru

Germany
324 Posts

Posted - Dec 15 2006 :  10:17:32 AM  Show Profile  Reply with Quote
its some of those COM odds. id say remove it, as the new extracted function does not implement a COM interface function. like extracting a method from a virtual function.

http://www.mf-sd.de
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18950 Posts

Posted - Dec 15 2006 :  10:30:00 AM  Show Profile  Reply with Quote
that makes sense, I have put a note on the case about this. thank you.

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

support
Whole Tomato Software

5566 Posts

Posted - Apr 14 2007 :  12:02:42 AM  Show Profile  Reply with Quote
Case=2970 is fixed in Build 1553.
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