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
 Feature Requests
 BUG: move to source file discards title comments
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Mordachai
Tomato Guru

USA
158 Posts

Posted - Feb 15 2017 :  09:36:25 AM  Show Profile  Visit Mordachai's Homepage  Reply with Quote
If I have a small inline function definition in my header, that I decide to move to my source, that starts like:


	// check if there is an item for the alias 
	inline CDynamicMenuItem * CDynamicMenu::FindItem(const CString & name)
	{
		if (!this)
			return nullptr;

		// translates a given name to an nID, or returns false if not found
		auto it = m_aliases.find(name);
		if (it == m_aliases.end())
			return nullptr;

		return it->second;
	}


Then after using refactor - move to source - I'll end up with:

	DynamicMenu::CDynamicMenuItem * CDynamicMenu::FindItem(const CString & name)
	{
		if (!this)
			return nullptr;

		// translates a given name to an nID, or returns false if not found
		auto it = m_aliases.find(name);
		if (it == m_aliases.end())
			return nullptr;

		return it->second;
	}


The title comment - describing what this function is for - is gone from the header, and did not make it to the .cpp file.

accord
Whole Tomato Software

United Kingdom
3020 Posts

Posted - Feb 15 2017 :  9:52:58 PM  Show Profile  Reply with Quote
I'm seeing the same effect here. Thank you for the clear description.

case=56606
Go to Top of Page

Mordachai
Tomato Guru

USA
158 Posts

Posted - Feb 16 2017 :  10:50:11 AM  Show Profile  Visit Mordachai's Homepage  Reply with Quote
note: occasionally it will leave the comment in the header - if I do several of these in a row. Not sure why or what distinguishes those form others - but either way - it should include the title comment with the moved code.

thanks :)
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3020 Posts

Posted - Feb 16 2017 :  6:42:50 PM  Show Profile  Reply with Quote
Yes, it should indeed include. Yes, I noticed that with your specific example, it was removed but with others, it's left in the header. Quite strange. This is definitely something we need to look into.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2017 Whole Tomato Software, Inc Go To Top Of Page
Snitz Forums 2000