News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Patch: function arguments added to autocomplete tooltip

Started by p2rkw, November 26, 2012, 02:03:14 AM

Previous topic - Next topic

oBFusCATed

p2rkw:
First impressions - it look really bad, when longer functions are completed. It adds '...' at the end.
Is it possible to try to resize the completion window?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

p2rkw

My first idea was to call:
           ed->GetControl()->AutoCompSetMaxWidth(0);
           ed->GetControl()->AutoCompSetMaxHeight(12);
before AutoComp show, but this doesn't work. Maximum size of autocomp listbox is hardcoded in ListBoxImpl::GetDesiredRect() in file PlatWX.cpp:
(...) if (maxw > 350)
       maxw = 350;
add similar for maxh.
This limitations are unnecessary because later scintilla clamp rect returned by this function to values setted by AutoCompSetMaxWidth and AutoCompSetMaxHeight. So I removed this limitations and AutoCompSetMaxWidth and AutoCompSetMaxHeight works as it should be.

p2rkw

I removed few bugs, now default arguments, and overloads are handled correctly. If you use autocomp outside function's block argument's types will be not removed (because outside blocks are only function's definitions/declarations).
I also apped patch for PlatWX.cpp - if you apply it your autocomplete listbox will be adjusted to widest match.
I think I finished this functionality, now I will work on documentation helper.

edit: patches are now in patch tracker.

ollydbg

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

oBFusCATed

Then we choose one to be committed and the second will be fixed after the commit.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Alpha

Commit this one first (it was here longer :)); I will update my patch after that.

oBFusCATed

I've found some problems with this patch:
1. completing push_back of a std::vector results in vec.push_back(__x)|, but what I want to have after the completion is vec.push_back|
2. completing end of a std::vector results in vec.end()|, I want it to be vec.end|

'|' is where the cursor is after the completion.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

p2rkw

You probably have disabled option "add parentheses after function autocomplete". Thanks for info. I'll fix it when Alpha's patch will be in svn.
btw: can you enable this option and say what you think about new behaviour?

oBFusCATed

Yes, it is disabled, but the first case will be an error even if it is enabled.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

p2rkw

Ok, I fixed it, but now I don't have time to generate patch.
When this option is enabled and you complete push_back then argument names (in this case "__x") will be selected. It's a feature :)

oBFusCATed

What do you mean by selected?
Keep in mind that this is bug in my opinion and it can be very annoying!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

p2rkw

Patch updated.

Btw. if I will prepare patch, should I start topic to describe it, send it directly to patch tracker, or maybe I shouldn't send anything at all?

oBFusCATed

Quote from: p2rkw on December 03, 2012, 03:30:15 PM
Btw. if I will prepare patch, should I start topic to describe it, send it directly to patch tracker, or maybe I shouldn't send anything at all?
What patch? Some other patch? Are you asking what is the accepted procedure for providing patches?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]