Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Extract Method places method inside #if#else
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - May 11 2023 :  06:24:04 AM  Show Profile  Reply with Quote
Minimal example code:

  struct ProgramContext{};
  struct DebugContext{};

  int fun( ProgramContext* pContext, DebugContext* pDebugContext )
  int fun( ProgramContext* pContext )
    int select_this_line_and_extract_method_with_VA = 1;


Selecting the select_this... line and letting VA "Extract Method" the method is reliably placed inside the #else-#endif block below the second function header, even if that #else is turned off. This works with code blocks of any size inside such a code situation, not just one line.

It should not place it inside the #if at all, much less between a function header and its body.

I searched the forums and couldn't find this bug yet.
Thank you.

Whole Tomato Software

United Kingdom
18746 Posts

Posted - May 11 2023 :  11:59:01 AM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.


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