Make keyword completion model return HideListIfAutomaticInvocation by default

Authored by ahmadsamir on Jul 16 2019, 10:24 PM.



Change KateKeywordCompletionModel::matchingItem to return
HideListIfAutomaticInvocation so that the completions menu is hidden for
typed keywords, e.g. typing "return" the menu get auto hidden.

Test Plan
  • Enable keyword completion in kate
  • Open a file and change the mode to a language where return is a keyword say Python
  • Type "return", check that when the word is fully typed the completions menu is hidden

Diff Detail

R39 KTextEditor
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir created this revision.Jul 16 2019, 10:24 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptJul 16 2019, 10:24 PM
ahmadsamir requested review of this revision.Jul 16 2019, 10:24 PM

Independent of anything else I think this is a very sensible change, and seems like an oversight / bug.

One of the more core kate guys should approve, but +1 from me.

Hmm, does that really work this way? At least for me, even with and without that patch, I get with C++ more proposals than just return on typing return.
And for other things like the completion already now disappears.

I messed up the test plan; try with the mode set to Python. It looks like a corner case where if there's only one exact match, the completions menu doesn't get auto hidden.

ahmadsamir updated this revision to Diff 61932.Jul 17 2019, 6:22 PM
ahmadsamir edited the test plan for this revision. (Show Details)

Fix test plan :/

cullmann accepted this revision.Jul 17 2019, 6:23 PM

Ok, there I can see a difference and the new behavior is better.

This revision is now accepted and ready to land.Jul 17 2019, 6:23 PM
This revision was automatically updated to reflect the committed changes.

FWIW, the combined effect of this patch and D22477, hopefully you'll no longer see the Q_RETRUN_ARG and co. completions unless the menu is manually invoked with the mode set to C++.