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
 Refactoring: Extract method
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mspa
Senior Member

Netherlands
44 Posts

Posted - Aug 07 2006 :  07:40:14 AM  Show Profile  Reply with Quote
When using the 'Extract method' feature, the 'ref' and 'out' keywords are wrongly positioned. Instead of before the identifier it is positioned after it.

Expected:
void MyMethod( ref object obj, out int x )

Actual result:
void MyMethod( object ref obj, int out x )

The actual result does not compile and I need to manual switch it.

mspa
Senior Member

Netherlands
44 Posts

Posted - Aug 07 2006 :  07:57:23 AM  Show Profile  Reply with Quote
Additional information:

Also the code generated calling the extracted method does not include the 'ref' and 'out' keywords.

Expected:
MyMethod( ref MyObject, out MyInteger )

Actual result:
MyMethod( MyObject, MyInteger )
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18952 Posts

Posted - Aug 08 2006 :  6:11:14 PM  Show Profile  Reply with Quote
what language and IDE are you using? i am guessing some form of C#

do you have a short example piece of code you can post to illustrate this effect?

if you are using 1530 you may want to upgrade to 1531, it contains a lot of bug fixes for refactoring.

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

mspa
Senior Member

Netherlands
44 Posts

Posted - Aug 09 2006 :  03:18:29 AM  Show Profile  Reply with Quote
I was using VAX 1524 and indeed C# as the language. I have upgraded to VAX 1531 but still have the same problem.

How to reproduce:

Start with something like

   String myString;
   String myCloneString = myString.Trim();


Select the bottom line and extract a method, the result is as followed

oid MyCloneMethod(String ref myString)
{
String myCloneString = myString.Trim();
}
	}
}


As seen some begin characters have disappeared and the 'ref' keyword is positioned at the wrong position (should be before 'String'), also the layout if messed up.

Edited by - mspa on Aug 09 2006 03:27:06 AM
Go to Top of Page

mspa
Senior Member

Netherlands
44 Posts

Posted - Aug 09 2006 :  03:25:21 AM  Show Profile  Reply with Quote
I found out the reason why the keyword 'void' was truncated to 'oid' and it is reproducable.

I started with the following exact code

namespace VAX_Test
{
   class Class1
   {
      static void Main(string[] args)
      {
         String myString;
         String myCloneString = myString.Trim();
      }
   }
}

Where each bracket is directly followed each other on the next lines. When you put one extra linefeed between the brackets the keyword 'void' is not truncated

namespace VAX_Test
{
   class Class1
   {
      static void Main(string[] args)
      {
         String myString;
         String myCloneString = myString.Trim();
      }
           // <-- notice the extra linefeed
   }
}
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18952 Posts

Posted - Aug 09 2006 :  9:03:48 PM  Show Profile  Reply with Quote
i am seeing the same thing in VS2003. i think the formatting upset is partly a result of the IDE's formatting ability being upset by "ref" being in the wrong place.

case=2014

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

support
Whole Tomato Software

5566 Posts

Posted - Aug 12 2006 :  11:21:58 PM  Show Profile  Reply with Quote
Case 2014 is fixed in build 1532.
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