Review Request: Display of many function overloads in code completion

Thomas Schöps tom.schoeps at googlemail.com
Thu Apr 15 18:32:33 UTC 2010



> On 2010-04-15 16:11:23, Milian Wolff wrote:
> > trunk/extragear/sdk/kdevelop/languages/cpp/codecompletion/context.h, line 60
> > <http://reviewboard.kde.org/r/3612/diff/1/?file=23620#file23620line60>
> >
> >     what's the difference between fullCompletion and automaticInvocation?
> >     
> >     imo you want to check against fullCompletion, no need for the additional parameter

The difference between the parameters is that fullCompletion is always true if the KDevelop Language support setting "Level" is set to "Always Full Completion", whether the completion is invoked automatically or not. The new parameter gives this information.

I think that the argument hints whose behavior I want to change with the patch (those above the cursor) are not shown if fullCompletion is false, so it wouldn't make sense to check against it. To implement that all overloads are only shown if the completion is invoked manually (like discussed in the bug report), the additional parameter is needed.

But as the completion is currently not invoked automatically after '(', leaving it out and assuming false would yield the same result for now.


> On 2010-04-15 16:11:23, Milian Wolff wrote:
> > trunk/extragear/sdk/kdevelop/languages/cpp/codecompletion/context.cpp, line 1277
> > <http://reviewboard.kde.org/r/3612/diff/1/?file=23621#file23621line1277>
> >
> >     this is not filtering properly, I now get like 20 function hints in e.g.:
> >     
> >     QString s;
> >     s.append(|);
> >     
> >     place the cursor at the pipe.

I tried it and pressing Ctrl+Space at this position correctly gives me the 6 overloads of append() above the cursor, so I can't follow you here ...


> On 2010-04-15 16:11:23, Milian Wolff wrote:
> > trunk/extragear/sdk/kdevelop/languages/cpp/codecompletion/context.cpp, line 1280
> > <http://reviewboard.kde.org/r/3612/diff/1/?file=23621#file23621line1280>
> >
> >     you are in a loop that checks the functions, so this will always be true, remove it

Okay, here I agree with you :-)
This is the same as in the original code which checked for too much overloads and there it was also only useful if maxOverloadedOperatorArgumentHints was negative ...


- Thomas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/3612/#review5065
-----------------------------------------------------------


On 2010-04-15 14:29:12, Thomas Schöps wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/3612/
> -----------------------------------------------------------
> 
> (Updated 2010-04-15 14:29:12)
> 
> 
> Review request for KDevelop.
> 
> 
> Summary
> -------
> 
> I tried to fix this:
> https://bugs.kde.org/show_bug.cgi?id=215206
> 
> With the patch, Ctrl+Space always shows all overloads, while automatic invocation of code completion shows the first 5 overloads and possibly "x more overloads of y".
> Currently, the automatic invocation case doesn't happen because automatic code completion after '(' is disabled.
> It would be even better if the "more overloads" item would be clickable to reveal the remaining items, but I don't know how to implement this and as it isn't shown currently, it's probably not too important.
> 
> I've never coded on KDevelop/KDevplatform or even a KDE app before, so please check the patch carefully and tell me if that is not the correct way to implement it ;-)
> 
> 
> Diffs
> -----
> 
>   trunk/extragear/sdk/kdevelop/languages/cpp/codecompletion/context.h 1115078 
>   trunk/extragear/sdk/kdevelop/languages/cpp/codecompletion/context.cpp 1115078 
>   trunk/extragear/sdk/kdevplatform/language/codecompletion/codecompletioncontext.h 1115078 
>   trunk/extragear/sdk/kdevplatform/language/codecompletion/codecompletionmodel.cpp 1115078 
>   trunk/extragear/sdk/kdevplatform/language/codecompletion/codecompletionworker.h 1115078 
>   trunk/extragear/sdk/kdevplatform/language/codecompletion/codecompletionworker.cpp 1115078 
> 
> Diff: http://reviewboard.kde.org/r/3612/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Thomas
> 
>





More information about the KDevelop-devel mailing list