Author Topic: Call-Tips for STL  (Read 18326 times)

Anonymous

  • Guest
Call-Tips for STL
« on: January 27, 2005, 05:16:58 pm »
First, I'd like to say that this IDE is the best free IDE I have found for windows. I prefer it over Dev C++ and MinGW Studio.

Here's my Question: now that most compilers are generally STL compliant, I was wondering if there would be any chance of having Intellisense for the STL library functions are classes? Is this difficult to implement? Could I do it myself?

I tried looking at the source but I was not sure which file specifies how regular C commands like printf() already have call-tips. If there's anyway I go do this myself, could someone point me in the right direction?

-Mike

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Call-Tips for STL
« Reply #1 on: January 27, 2005, 10:54:17 pm »
The "Intellisense", as you call it, is provided by the code-completion plugin. It's not about a single file containing call-tips. It scans in real-time your sources plus the compiler's header files and provides you with the relevant options.

About the STL, well, they 're templates and templates are the only major C++ feature that is not supported by this plugin. IIRC templates and typedefs are not supported.

Yiannis.
Be patient!
This bug will be fixed soon...

Anonymous

  • Guest
Call-Tips for STL
« Reply #2 on: January 28, 2005, 03:23:43 am »
Quote from: mandrav
The "Intellisense", as you call it, is provided by the code-completion plugin. It's not about a single file containing call-tips. It scans in real-time your sources plus the compiler's header files and provides you with the relevant options.

About the STL, well, they 're templates and templates are the only major C++ feature that is not supported by this plugin. IIRC templates and typedefs are not supported.

Yiannis.

Are templates difficult to support? Could I add them myself with enough effort? The only thing I miss when using Code::Blocks from VS2K3 is code-completion for templates. This also answers my other question about why my code that used templates did not seem to work with the code-completion.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Call-Tips for STL
« Reply #3 on: January 28, 2005, 09:10:59 am »
Yes it is the more difficult thing to support. Stop for a minute and think about it. Take this simple piece of code for example:
Code

typedef std::list<std::string> StringList;
StringList myList;

First of all, let's pretend we support typedefs (which we don't - think about member function pointers for a reason why we don't). This is the easy example. The parser could ignore the "<std::string>" part (in the typedef) so it would work pretty much as it is.
Now take this example:
Code

class SomeRefCountedClass {...}

template <class T> class SmartPtr {
    ...
    void AddRef();
    void DelRef();
    T* operator()();
    ...
}

typedef SmartPtr<SomeRefCountedClass> SmartClass;
SmartClass myList;

Here, if you ignore the "<SomeRefCountedClass>" part in the typedef, let's suppose it would work with AddRef(), DelRef() ,etc.
But we want SmartPtr to be, like, transparent. Like it doesn't exist. Most call tips for it should actually be call-tips of SomeRefCountedClass. To do this, the plugin should recognize and take into account the T* operator()() template member function.

I don't know if the message is getting accross. I hope the above are clear enough, relative to the subject.
Anyway, these are some random thoughts (which always occur to me when thinking about templates and call-tips). I may be completely wrong or there may be an easier way to accomplish this. I don't know. I 'm always open to suggestions and contributions :)

Yiannis.
Be patient!
This bug will be fixed soon...

Anonymous

  • Guest
Call-Tips for STL
« Reply #4 on: February 05, 2005, 10:43:48 pm »
I was just thinking about your last reply. The school that I attend has MSVS.NET, and how they do call tips for the STL is simply list the function prototype and any overloads. So for your example the call tip for AddRef would just be:
Code
void AddRef()


Also, the overloaded operator has no effect on the call tip in Visual Studio, and it actually shows up as one of the options like:
Code
operator ()
. Furthermore,  I tryed typing a class into the SomeRefCountedClass, and I didn't get any data members or functions other than the ones for SmartPtr using MSVC when I typed
Code
myList.


Is there any way that you could just parse the function protoypes and data members in a templated class, treating them just like normal classes at MSVC does? That would probably be easier and most people would be satisfied with it. Do you understand what I'm saying?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Call-Tips for STL
« Reply #5 on: February 06, 2005, 12:36:12 am »
Quote from: Anonymous
That would probably be easier and most people would be satisfied with it. Do you understand what I'm saying?

Yes, I do understand.
I got some work to do on this plugin anyway, so I might give this a try...

Thanks,
Yiannis.
Be patient!
This bug will be fixed soon...