Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Bug: removal of "extern" in info too aggressive

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
o2a Posted - Mar 02 2006 : 1:13:43 PM
(VAX v10.2.1440.0,VS2005 english)

The keyword "extern" gets removed from the function signature in the parameter-info-tooltip (ctrl-shift-space) EVEN if the word extern is part of an identifier, but only if extern is followed by a white space (includes line break).

e.g.

void test(int counter_extern ); // space before closing brace
void test(int counterextern );  // space before closing brace
void test(int counter_extern , int blah); // space before comma
void test(int counter_extern
         ,int blah );  // linebreak after extern

The tooltip for all of them shows just "void test(int counter)" - "counter" without "extern". (The 2nd paramter blah shows up correctly where appropriate.)


void test(int counterExtern ); // upper case "Extern"
void test(int counterextern);  // no space before closing brace
void test(int counter_extern, int blah); // no space before comma

These show the name correctly.
9   L A T E S T    R E P L I E S    (Newest First)
support Posted - Apr 14 2006 : 11:28:16 PM
Case 1017 is fixed in build 1445.
o2a Posted - Mar 12 2006 : 04:00:44 AM
quote:
Originally posted by feline
do you have a simple and fairly clear example of what you are doing, where VA is not showing the full return type? the fact remains that if i understand what you are doing here correctly (which is doubtful, since i am half asleep at the moment) the fact returns that you have a void function, so there is no more return type or template parameter information for VA to display.



Ah, no, I have no problem with the return type at all.

It's just that the template parameters are missing from the signature as displayed by VA. Ok, actually they are not a part of the "signature" anyway in it's actual sense, are they?

But it would be nice to have the tooltip display e.g. void test<int INDEX>(int x); for the original example

template<int INDEX> void test(int x);


Or void test<typename T, int SIZE>(T const param[SIZE]); for

template <typename T, int SIZE> void test(T const param[SIZE]);


And to be perfect, VA could determine if one or more template parameters could be deduced from the (normal) argument list and hide them from the actual parameter info tooltip by default, but offering the full parameters as a overload in it's tooltip.

E.g. for
template <typename T> void swap(T value1, T value2);

it could display (1) void swap(T value1, T value2); as first overload in the ctrl-shift-space parameter info...
...and the full (2) void swap<typename T>(T value1, T value2); as a second overload.

(I know - they are no "overloads". I mean the variants you get for overloads by using the up- and down-arrow keys when a parameter info is shown )

And last but not least VA could add angular brackets at code completion of templated functions, just as it adds parenthesis already. And once again to be perfect here, there could be an option, if angular brackets should be added for ALL templated functions or only for such whose template parameters cannot be deduced by the compiler itself.
(For templated classes there should be angular brackets always, as their parameters cannot be deduced.)

Ok, I know this is very much to ask for. But this should just be a suggestion. Something the VA developers could consider - if it's worth and easy enough to implement.

(What I - and surely many many other people - are much more anticipating, is refactoring support for C++, even if it would be minimal (e.g. "Rename" would be great already) and not 100% bullet proof.
The only C++ refactoring tools I'm currently aware of are "Ref++" and "SlickEdit", both extremely slow and instable. And as VA always keeps most of the required information parsed, I'm hoping for a much better refactoring experience with VA.)

Ok, this was quite OT and a definitive sign to stop here.
Thanks for your patience!
feline Posted - Mar 08 2006 : 6:57:31 PM
all right, that makes more sense. i looked for the template type being passed in, which would make sense for a template function, but that was not happening.

there is no need to try and explain tuples, i read about them somewhere along the line and understood the point, i have made enough strange, weird and just plain odd lists in my time to have a desire for a std::list of tuples

do you have a simple and fairly clear example of what you are doing, where VA is not showing the full return type? the fact remains that if i understand what you are doing here correctly (which is doubtful, since i am half asleep at the moment) the fact returns that you have a void function, so there is no more return type or template parameter information for VA to display.
o2a Posted - Mar 07 2006 : 6:43:11 PM
Ok, my example was a bit misleading if you are not used to templates.

When declaring a template function or class, you have to put the keyword "template" and the template parameter list in front of the entire declaration.

template<int INDEX> void test(int x);

Here the "template"-keyword doesn't relate to the return type alone, but to the declaration itself. It's obviously no good example, since I don't use the parameter INDEX there at all.

A more typical one would be:

template <typename T> void test(T const *param);

Or something like

template <typename T, int SIZE> void test(T const param[SIZE]);


The original example makes sense e.g. in the context of the tuple-type as proposed for the (hopefully) coming C++0x in it's TR1. (A variant of this is implemented by boost::tuple.)
There you have a free function named std::get to extract members from a tuple. It's parameter is the tuple itself and the index of the member to extract. To enable the compilers to optimize them, the index is given as a true constant - therefore as an 'int' or 'size_t' template parameter.

A more complete version of the original example would be:

template<int INDEX> void test(std::string id)
{
    SomeTupleType &someTuple = getSomeTuple(id);
    cout << "Value of " << INDEX << ". element in tuple is " 
         << get<INDEX>(someTuple);
}


This example shall not explain the advantage of using tuples or using non-type template parameters anyway. It's just for the sake of template syntax.
feline Posted - Mar 06 2006 : 4:34:54 PM
*um* is your code example correct? i understand a function returning a template instance, like a std::list, and i understand a void function that does not return anything at all.

i am aware of template functions, but would have to look up the syntax, it has been quite a while since i wrote one, but your code does not seem to be any of these. as a result i am still not clear on what you are talking about here.
o2a Posted - Mar 04 2006 : 12:17:07 PM
Sorry, I didn't make it clear indeed.
I meant something like

  template<int INDEX> void test(int x);

The info tooltip just shows "void test(int x)". It would be nice if it could show the full template signature like "void test<int INDEX>(int x)".

This is a (minor) problem with code completion too.
At completion, VAX inserts just the braces but no angle brackets.
Hmm, I thought that it would be helpful sometimes to have the angle brackets inserted automatically too (as some sort of a reminder that there are template parameters)... but then again - in cases where the template parameters are optional, because they could be deduced by the compiler, this could get annoying.
If VAX could decided that template parameters can not be deduced... but... may be template parameters in the parameter info would be sufficient already.


feline Posted - Mar 04 2006 : 09:58:06 AM
i don't follow what you mean. using the test function:

testFunc(std::set<std::string> setString);


the parameter is fully displayed in the CTRL-SHIFT tooltip when i call this function.

o2a Posted - Mar 02 2006 : 7:29:07 PM
Btw, when that code code gets fixed - may be it would be the perfect time to add a missing feature:
Showing the template parameters in the info tooltip too.
(Currently they are completely stripped from the signature.)

feline Posted - Mar 02 2006 : 6:43:22 PM
confirmed. thank you for the detailed description, this made it very easy to see what was happening here.

case=1017

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