Commit Graph

7 Commits

Author SHA1 Message Date
Leandro Melo
d4e9b862fa Completion: Fine tuning perfect match behavior
Keeping or not the completion popup upon a perfect match
is best identified by the model in question instead of simply
by the triggering reason. For instance, in QML we don't want
to preserve the popup if completion was triggered by an
activation sequence. On the other hand, this is ok for C++
since a semicolon or parenthesis will in general still be
typed (in some cases even with the intention to take advantage
of the automatic bracked insertion).

For more context see 271bd44d2c1daa43c125cc09e6af57bb756de857.

Change-Id: If9dbf33243b623c077ce027e7e46265d0fc4ba8b
Reviewed-on: http://codereview.qt.nokia.com/563
Reviewed-by: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
2011-06-22 16:15:39 +02:00
Leandro Melo
e31accb848 Revert "Completion: Apply perfect match whenever not invoked explicitly"
This reverts commit 4959f53d2c.

It seems that usability is better when upon a perfect match the completion
popup stays when triggered either explicitly or by an activation character.
After all, in general one should need to type something else (semicolon,
parenthesis, etc.) anyway for the case of an activation character.

This is also consistent with the behavior from previous releases.

Change-Id: I1d50230affb1d0642f8f8bfd5cbac69dc52e44bd
Reviewed-on: http://codereview.qt.nokia.com/536
Reviewed-by: Thorbjørn Lindeijer <thorbjorn@lindeijer.nl>
2011-06-21 12:17:15 +02:00
Leandro Melo
4959f53d2c Completion: Apply perfect match whenever not invoked explicitly
This should not only be when the editor is idle but whenever the
completion was not invoked explicitly.

Change-Id: I0f3dbbe2f5db66ae3e1f57c7039a93f74f31e1dc
Reviewed-on: http://codereview.qt.nokia.com/130
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-26 12:14:24 +02:00
Leandro Melo
0350314b22 Completion: Don't propose when there's a "good" candidate
This also generalizes some code previously specific to C++.

Change-Id: I5774d04a45f28a4e276a0ef282ce0aa5a2f2e552
Reviewed-on: http://codereview.qt.nokia.com/48
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-20 17:11:49 +02:00
Leandro Melo
99fee33fd1 Completion: Complete prematuraly only if invoked explicitly
Change-Id: I941a94df2f8fb86f340ee04338641fe50c55e1b2
Reviewed-on: http://codereview.qt.nokia.com/45
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-20 17:11:27 +02:00
Leandro Melo
9e6f387bce Completion: Complete automatically only when in sync
Whith the out-of-GUI completion one can have undesired
effects when invoking the completion, continue typing,
getting automatic content added to the editor
asynchronously, and then noticing that the lastly
input characters were "shifted" to a different
position.

Now we only do partial completions or implicit completions
(when there's a single match) if the proposal widget is
still in synch with the editor. In other words, if the
editor has not received input from the moment the completion
was triggered until it was actually displayed.

Change-Id: I31683bd596c9f75b9a48bb79dafb48eec8f12a3e
Reviewed-on: http://codereview.qt.nokia.com/44
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-20 17:11:05 +02:00
Leandro Melo
bec4f02495 New code assist API
This is a re-work of our completion engine. Primary goals are:

- Allow the computation to run in a separate thread so the GUI is not locked.
- Support a model-based approach. QStrings are still needed (filtering, etc), but
internal structures are free to use more efficient representations.
- Unifiy all kinds of *assist* into a more reusable and extensible framework.
- Remove unnecessary dependencies on the text editor so we have more generic
and easily "plugable" components (still things to be resolved).
2011-05-18 10:46:20 +02:00