Review Request: Feature: Lookahead Match Completions

Milian Wolff mail at milianw.de
Thu Nov 15 21:20:53 UTC 2012



> On Nov. 15, 2012, 9:15 p.m., Milian Wolff wrote:
> >

Forgot to add some comment:

First up, great work! I really want to try it out. I esp. wonder about the relatively arbitrary limit of 5 items... Anyhow, once you resolve the few small issues below I'd say we can merge that into master and see how it works for us.

BTW: At DevDays conference, I talked with Olivier Goffart about KDevelop and this feature and he suggested something that might be very useful (but should be done in a separate patch set):

<pre>
int width = // assume code completion here, or:

void foo(int width);
...
foo(/* assume code completion here*/);
</pre>

In both cases, we look for something that is a width. Can't we make use of that information somehow in our code completion grouping? It's of course not straight forward, but could be very useful in some cases. Handling stuff like "fooBarWidth = " though might become harder. Same for "QRect().w()" or such abbreviated function names.


- Milian


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


On Nov. 4, 2012, 5:54 p.m., Olivier Jean de Gaalon wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107200/
> -----------------------------------------------------------
> 
> (Updated Nov. 4, 2012, 5:54 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Description
> -------
> 
> Add a new feature which looks though existing completions for instances of classes, and looks in those classes for declarations which match the desired type. In other words:
> ------------
> struct foo
> {
>   int a;
> };
> int main()
> {
>   foo myFoo;
>   int myInt = //offers myFoo.a
> }
> ------------
> 
> In my testing, in the worst case (large file, lots of visible declarations), this takes under 60 ms for me. In most cases it will probably be much less.
> 
> 
> Diffs
> -----
> 
>   languages/cpp/codecompletion/context.h b6fb017 
>   languages/cpp/codecompletion/context.cpp 6d9c3cc 
>   languages/cpp/codecompletion/item.h c220753 
>   languages/cpp/codecompletion/item.cpp 2514f9a 
>   languages/cpp/tests/test_cppcodecompletion.h 574de0f 
>   languages/cpp/tests/test_cppcodecompletion.cpp 88a0df7 
> 
> Diff: http://git.reviewboard.kde.org/r/107200/diff/
> 
> 
> Testing
> -------
> 
> Added unit tests, usage.
> 
> 
> Thanks,
> 
> Olivier Jean de Gaalon
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20121115/c846862f/attachment.html>


More information about the KDevelop-devel mailing list