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
 Improvements to create from usage
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

avt
New Member

3 Posts

Posted - Dec 14 2017 :  04:50:57 AM  Show Profile  Reply with Quote
I like to prototype code by having empty classes and inventing needed methods along the way, e.g.

auto result = class1_instance.method1(1.0, class2_instance.method2(1.0), 1.0);

In this case, method1 is already declared as

TypeA method1(double, TypeB, double);

Yet, when I use "Create from usage" on method2 (create declaration is unavailable), VAX will suggest a method that accepts two parameters (double and unknown instead of only double) and returns TypeA (instead of TypeB).

I was unsure if I should file this as a bug or improvement on existing feature.

Thanks.

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Dec 15 2017 :  07:19:54 AM  Show Profile  Reply with Quote
First the easy bit, in this situation Create Declaration isn't going to be offered, since you are not triggering it on an implementation. Perhaps this is a bit narrow, but it does give us a focused and well defined refactoring command.

I have expanded on your line of code, to make a more useful test case, but in doing so, in your code sample do you really mean to use "class2instance" in the parameter call? Or should this be class1_instance? It changes what is going on here.

Assuming you mean "class1_instance" in both cases, I have created the following test case. This code in the header file:

enum felinePrototypeEnumReturn { RETURN_ONE, RETURN_TWO };
enum felinePrototypeEnumParam { PARAM_ONE, PARAM_TWO };

class felineTestPrototypeClass
{
	felinePrototypeEnumReturn simpleMethodEnumInEnumOut(double, felinePrototypeEnumParam, double);
};

and this code in the matching cpp file:

felinePrototypeEnumReturn felineTestPrototypeClass::simpleMethodEnumInEnumOut(double valueOne, felinePrototypeEnumParam enumTwo, double valueThree)
{
	return felinePrototypeEnumReturn::RETURN_ONE;
}

void usingFelinePrototypeClass()
{
	felineTestPrototypeClass protoClassFoo;
	auto result = protoClassFoo.simpleMethodEnumInEnumOut(1.0, protoClassFoo.newMethodNotCreatedYet(1.0), 1.0);
}

which is causing a problem with Create From Usage, so I want to run some tests, to try and get a good feel of what works and what fails here with Create From Usage on new function calls.

But am I testing what you are doing here? Or am I testing a different situation?

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

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Dec 16 2017 :  08:52:20 AM  Show Profile  Reply with Quote
I have opened a bug report for the problems I am seeing here with Create From Usage, when the new function being created is seen as a parameter of a known function:

case=113221

If you have something else going on that also breaks, can you please post an example I can study?

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

avt
New Member

3 Posts

Posted - Dec 19 2017 :  05:01:22 AM  Show Profile  Reply with Quote
Hi,

Thanks for your response! I actually meant class1_instance and class2_instance but your test case likely covers the problem since the return types differ in the same way. That said, if you can't reproduce the behavior I described, that might be it.

It's nice to see responses and actions initiated directly here on the forums. Knowing this I will be sure to report any other issues I find. The only other thing to complain about at the moment is your forum, which threw away the previous incarnation of this post I just wrote because I misspelled the password...

Cheers and Happy Holidays!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Dec 19 2017 :  06:31:41 AM  Show Profile  Reply with Quote
We do try to respond quickly to all questions and bug reports, either via the forum or email

As for the forum, sadly, this is a known problem with everything online. Unless what you are doing is being saved for you as you go along, it is always at risk if something times our or goes wrong. I tend to copy everything to the clipboard before sending it, just because I have been caught one to many times over the years.

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

avt
New Member

3 Posts

Posted - Dec 20 2017 :  04:36:36 AM  Show Profile  Reply with Quote
Forum responses are great!

About the forum, I'm sorry, but I would say that 99.9% of forums out there handle this particular thing better nowadays. Just separating log in and post writing would help this particular issue immensely, and saving the content of a form entry field when something fails is basic internet form 101 for at least the last 5-10 years.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18751 Posts

Posted - Dec 20 2017 :  06:49:33 AM  Show Profile  Reply with Quote
I have just loaded the forum in a new browser window, where I am not logged in, and I have no ability to post anything. I don't recall ever seeing the forum let me post when I am not logged in, but to be fair I am logged in most of the time.

We know the forum is fairly old now, but it does its job, so diverting limited resources to move to a newer forum system, and moving all of the historical information across with it, isn't really a priority for us. Sorry about this, but email is also available for support queries if that is easier for you.

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