Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Create from Usage with Singleton Pattern

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Vertexwahn Posted - Nov 14 2010 : 5:29:01 PM
The "Create from Usage" feature doesn't work with a singletons - see here for an example:


int bar = 5;
MySingleton::getInstance().foobar(5);


Now right click on foobar and try to choose "Create from Usage" -> not possible

It would be great to have this feature some day in VisualAssistX
4   L A T E S T    R E P L I E S    (Newest First)
support Posted - Nov 22 2010 : 3:36:55 PM
case=52335 is fixed in build 1837
accord Posted - Nov 16 2010 : 03:50:38 AM
I am seeing the same effect now, thank you for the example. I have put in a bug report for this:

case=52335
Vertexwahn Posted - Nov 15 2010 : 6:32:37 PM
I am currently using Version 10.6.1830.0 with Visual Studio 2010 Ultimate

your example is working in my environment

but it fails if you put the singleton in a namespace, like this:


namespace Foobar 
{
	class singleton 
	{
	public:
		static singleton* gObject;
		static singleton* Get() {return gObject;}
	};
}

void func()
{
	Foobar::singleton::Get()->CreateNewMethod();
}


Now "Create from Usage" doesn't working. Sorry I forgot to mention, that the singleton resides in a namespace.
accord Posted - Nov 15 2010 : 3:21:48 PM
I've tried a very simple snippet and it is working for me using 1833 or 1836:

class singleton 
{
	//[...]
	static singleton* gObject;
	static singleton* Get() {return gObject;}
	//[...]
};

void func()
{
	singleton::Get()->CreateNewMethod();
}


What Visual Assist and Visual Studio version are you using?
Can you please try if you can reproduce the problem with 1836?
http://www.wholetomato.com/downloads/default.asp
We have fixed some Create From Usage related issues like "Create from Usage offers the correct options when invoked on a method with whitespace before the opening parenthesis." (from history page: http://www.wholetomato.com/support/history.asp)
If you are still seeing the problem with the latest version, can you please post a simple example where Create From Usage fails? You may use singletons differently.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000