User forums > General (but related to Code::Blocks)

Call-Tips for STL

(1/2) > >>

Anonymous:
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

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.

Anonymous:

--- 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.
--- End quote ---

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.

mandrav:
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;

--- End code ---

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;

--- End code ---

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.

Anonymous:
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()
--- End code ---


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 ()
--- End code ---
. 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.
--- End code ---


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?

Navigation

[0] Message Index

[#] Next page

Go to full version