Author |
Topic |
|
andre.horst
Tomato Guru
Germany
150 Posts |
Posted - Aug 14 2012 : 05:50:17 AM
|
It is not possible to find references of ctor calls, VAx finds all references to the class. It should be possible to find the references only to the ctors or specific overloaded ctors. |
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Aug 20 2012 : 9:57:58 PM
|
We are considering adding this:
case=1262
its not as easy as "normal" class member functions though, since you have to cover all the places where the class is created. |
zen is the art of being at one with the two'ness |
|
|
schollii
Starting Member
1 Posts |
Posted - Jan 14 2013 : 1:27:53 PM
|
I really wish for this too. I've seen several posts about this so I'm hoping it is getting high priority on your list. I notice whole tomato mods indicating it is not an easy task. This is true if you want to cover all grounds: explicit construction on stack or heap and conversions in return "values" and function parameters (am I missing any? I think op= is a subset of previous).
But isn't this a case of filtering out some of the results? If you look at all places where the class name can appear: class declaration, class definition, method definitions, forward declarations, member reference (data or methods), and probably a couple more... Surely you guys can come up with a filter that will remove most of those, leaving just the constructors and maybe a couple of false positives.
In current VAX (build 1925) about 80% of results are not the constructor we are looking for. That's a lot of false positives. Even if you could bring this down to 10% false positives that would be really helpful.
|
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Jan 15 2013 : 10:56:15 AM
|
This is still on the list of features we are considering adding. I have put a note on the case about this, you have an interesting approach here, and it might help a bit, thank you. |
zen is the art of being at one with the two'ness |
|
|
Mordachai
Tomato Guru
USA
224 Posts |
Posted - Feb 11 2013 : 11:12:16 AM
|
I'll just throw my 2c in as "I also wish for this feature commonly."
I know it opens a bag of worms to make this work better, but not perfectly (you'll get a slew of "this doesn't work right!@!@# gobble-gobble!", but I agree with Schollii, an 80% solution beats the current 20% solution :) |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Feb 11 2013 : 3:47:04 PM
|
Depending on your code, and how you create instances of your class, you might be able to use a regular expression search to get quite a few of the constructors.
As an experiment, using the following sample code:
class testFindConstructor
{
public:
testFindConstructor();
testFindConstructor(int nParam1, int nParam2);
};
void testParam(testFindConstructor used1, testFindConstructor *used2);
void testUsingClass()
{
testFindConstructor *test1 = new testFindConstructor();
testFindConstructor test2;
testParam(test2, test1);
}
and VS2012, the following regular expression find is helping:
(<new:b+testFindConstructor>)|(<testFindConstructor:b+:i+;)
obviously it will some fine tuning for your requirements, but it is an interesting start point. |
zen is the art of being at one with the two'ness |
|
|
Wernlund
Starting Member
1 Posts |
Posted - Mar 10 2013 : 11:28:44 AM
|
I would like to chime in for this feature as well! And, while we're at it, and I figure this is tricky as well, finding references to operators would be magnificent as well!
Today I can still find references to a particular constructor by doing something with its arguments (well, usually anyway) and see where the compiler starts complaining, but doing the same with operators is very difficult.
/ Lars |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Mar 11 2013 : 10:43:14 PM
|
Are you looking to run Find References on any particular operators, or all overloaded operators?
We are considering allowing Find References on operators, but this is a long term idea:
case=57778 |
zen is the art of being at one with the two'ness |
|
|
steinsomers
Ketchup Master
Belgium
65 Posts |
Posted - Sep 20 2013 : 09:49:30 AM
|
I'd be delighted with this feature too. I don't think Find References on a constructor (or destructor) currently has any advantage over a dumb word search, unless the class name is "overloaded" through nesting or namespaces.
Of course, if you also wanted to list implicit calls to constructors, like pass-by-value or implicit conversions, and implicit calls from explicitly or implicitly defined constructors in derived classes, you're in for a treat. But just listing explicit calls would be welcome. |
|
|
feline
Whole Tomato Software
United Kingdom
19014 Posts |
Posted - Sep 23 2013 : 5:59:01 PM
|
Certainly initially I think we will only look for explicit constructors. Some, probably most implicit calls are going to be very difficult to find, and so could end up causing more problems than it solves. |
zen is the art of being at one with the two'ness |
|
|
|
Topic |
|