Code snippet: struct Foo; struct Bar; void func(int, Foo*); void test() { int x=1; Foo* foo; Bar* bar; func( } In the ‘func’ call, Ctrl-Space correctly offers ‘x’ as best match. After selecting that option and typing a comma, ie. after “func(x, ”, it correctly offers ‘foo’ as best match. However, if the first argument is invalid, completion for the second argument doesn't work. For example, completion after “func(nonexistingvar, ” shows all local variables in alphabetical order, and no “best matches” section at all. I understand this might be due to overloading: if there are several overloads of ‘func’, KDevelop may not know the type of the function's second parameter until it knows what overload I'm using, and for that it may need the type of the first argument. But then there should be special handling for the case of ‘func’ having only one overload, like in the above example.
I tried to reproduce the bug in KDevelop5, and it not shows all local variables. http://i.imgur.com/y5BDLya.png Probably it is necessary to close.
This is probably fixed in KDevelop5, but your screenshot is not really evidence for it. You should write a comma and see what completion you get on the *second* argument. It should offer 'foo' (because the type matches) above other local variables. I don't currently have KDevelop5 to try it myself.
Sorry, I did not immediately understand. Yes, the bug is still there. http://i.imgur.com/8eIIuc9.png
Oh wow, I really imagined it would work now. Thanks for testing!
With kdev-clang we'll probably need to fix this in clang itself.
Thank you for the bug report. As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved.
KDevelop 5.6.2, this so broken that maybe I should file a separate bug. If I complete after "func(" I don't get *any* local variables in the list. My original report was about whether a certain variable was shown in "best matches" or just in the normal list, but now local vars are missing entirely. If I complete after "func(b" I do get "bar".