https://bugs.kde.org/show_bug.cgi?id=404925

            Bug ID: 404925
           Summary: code completion popup content can change after the
                    user selected an item
           Product: kdevelop
           Version: 5.3.1
          Platform: Compiled Sources
                OS: All
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Code completion
          Assignee: kdevelop-bugs-n...@kde.org
          Reporter: rjvber...@gmail.com
  Target Milestone: ---

Created attachment 118445
  --> https://bugs.kde.org/attachment.cgi?id=118445&action=edit
tentative fix

SUMMARY
It is possible (and often too easy) to insert an unwanted entry from the code
completion popup, i.e. some unforeseen entry that gets inserted under the
cursor *after* you hit the Enter key but before that event is processed.
Sometimes I even get the result of an entirely unexpected code completion when
the popup appears just before my tap on the Enter key lands or the keypress
gets registered.

STEPS TO REPRODUCE
1. Activate automatic appearance of the completion popup

OBSERVED RESULT
As described in the summary, happening more frequently with documents with lots
of headers and code that leads to long lists with completion candidates. I
can't affirm that it happens more often on my slower machine than on my faster
machine but it does happen more often when I'm keeping the machine busy (and is
elusive when you want to trigger it).

EXPECTED RESULT
Deterministic behaviour...


SOFTWARE/OS VERSIONS
KDE Frameworks Version: 5.52.0
Qt Version: 5.9.7

ADDITIONAL INFORMATION
A few possible solutions:
- a user-configurable "select this entry" would prevent accidental code
completion when all you want is just enter a newline
- make it impossible to accept an entry from the list if the list isn't yet
complete 
OR
- activate the feature only when the list is complete.

I'm attaching a tiny patch that appears to achieve the latter solution by using
the waitForReset signal.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to