User forums > Using Code::Blocks

Tooltips for Win32API and oter functions

(1/2) > >>

Vuki:
I've downloaded and installed Code::Blocks and I think it's awesome. However, the feature that I miss is displaying a tooltip with function prototype (parameters list) in a tooltip, like Visual Studio does. Searching for IDEs I've found MinGW Developer Studio. It's very barebone, but it has this feature, implemented as 'calltip'. See here for screenshot: http://www.parinyasoft.com/mds_win_snapshot7.html. It's implemented using a 'win32.ctp' file which contains function prototypes. I assume that both C::B and MinGW DS use Scintilla as the editor component. Is there a possibility to implement this feature in C::B? That would be great and it would stop me from thinking about switching to VS Express.

kkez:
It's already available under the name of "Code completion" (it's a plugin). Just go to Settings -> plugins' settings -> Code completion  :)

Vuki:
Kkez, I know about Code completion plugin but it's not what I meant. See screenshot linked in my post. Code completion plugin is not very useful. For example, write CreateWindow and press Ctr+Space. You'll get something like this:

--- Code: ---CreateWindowExW(DWORD,LPCWSTR,LPCWSTR,DWORD,int,int,int,int,HWND,HMENU,HINSTANCE,LPVOID) : WINAPI
--- End code ---
Now try to figure which parameter is which.
In my opinion, MinGW Developer Studio uses better approach. Besides, hovering the mouse cursor over function displays tooltip with function description).

takeshimiya:
There are two approachs to code completion:
1) Using a ctags like file which contains all the api functions (which is generated from the code).
2) Parsing the sourcecode in place.

Code::Blocks uses the 2nd approach, which I found better because if the (api or yours) code changes it'll reflected rapidly.

However it needs to improve the C/C++ parser (or use another), so that it extracts comments/documentation and puts in the tooltip (just as you described).

But however, the 1st approach will need to be implemented too, because sometimes there are sourcecode which not includes comments/documentation in the code, but they provide something like a ctags file (some examples can be w32api or PHPapi I think).

thomas:
Go on, switch to  MinGW developer studio. You will be back soon :)
I know because I have used it myself before switching to Code::Blocks.

But seriously, this approach is of course possible, do note, however, that while it has advantages, it has disadvantages too - it is a lot less flexible. The code completion plugin in Code::Blocks is quite universal, it works on (almost) any kind of source without any additional "calltip files".

What do you think about writing a plugin that reads its prototypes from a calltip file? Code completion is only just a plugin too, so you could just replace it with something that is statically prototyped.
Without having looked into it deeper, I believe that you could write such a plugin in not too much time, an afternoon or two maybe -- most of it is there already.

Navigation

[0] Message Index

[#] Next page

Go to full version