Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I gave up trying to solve this myself, so any help will be appreciated.
Let's say, we have the following declaration:
C++
class A
{
  virtual void() foo() {....};
};

typedef A B;


Then, somewhere in code we have this:

C++
B b;
b.foo();


Now, if you are using MSVC++, Intellisense hint (when you hover your mouse over "b.foo();" call ) will resolve it as "void A::foo()", not "void B::foo()". I.e. if you typedef anything, Intellisense totally ignore your def, and resolves to the very bone of the declaration.

Same will happen if you declare B as descendant of A:
C++
class B: public A
{
};


Intellisense hint will still show "void A::foo()" until you override foo() in B one way or another.

And here is my problem. I'm writing a templated class, which itself is descendant of another templated class, etc, etc. Final class name become very, very long (>200 symbols). Of course, it is then typedef-ed, but - and this is my problem - Intellisense doesn't care about any typedef, and just unwraps the type to this crazy 200 symbols.

My question is this:
is there ANY way at all to force Intellisense to use typedef instead of unwrapped def?

If this is not possible, is it any way to have Intellisense at least display B::foo() instead of A::foo() in the above example, provided that there is no way I can override foo() in B?

My ultimate goal is this:

C++
template<class X1, class X2<X1>, ...., class X10000, typename Q=X1::nested_type> // joking, but you got an idea
class Base : public AnotherTemplatedBase<.....>
{
  typedef typename AnotherTemplatedBase<.....>::very_deeply_nested_type  data_type;
  data_type foo(yet_another_deep_data_type& src) {...}
}

typedef Base< and here are end-user params> UserClass;

....
UserClass uc;
auto x = uc.foo(y);
// and now I want Intellisense to show "data_type UserClass::foo(another_data_type& src)" instead of crazy long unwrapped base name.


Is this even doable? May be in new MSVC++ releases?...
Posted
Updated 27-Mar-15 17:33pm
v2
Comments
Philippe Mori 27-Mar-15 23:55pm    
You might make the suggestion on Visual Studio User Voice (https://visualstudio.uservoice.com/forums/121579-visual-studio)
Kosta Cherry 28-Mar-15 0:48am    
I doubt that they will ever pay attention to the request of a stranger...
Richard MacCutchan 28-Mar-15 4:32am    
Of course they will. How will they ever know it's a problem if you don't tell them?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900