OSDN Git Service

CodeAssist: Relax a bit premature match
authorLeandro Melo <leandro.melo@nokia.com>
Thu, 23 Jun 2011 13:35:07 +0000 (15:35 +0200)
committerLeandro T. C. Melo <leandro.melo@nokia.com>
Fri, 24 Jun 2011 08:23:39 +0000 (10:23 +0200)
commit395ba9875a4fb85757fdf104362984d01f7af0a2
tree0928a766f342f10e112e6280be3f2aba834579ee
parenta457124c5449dbf134c9916cc1caa563d208b5ec
CodeAssist: Relax a bit premature match

In a relatively recent commit (99fee33fd1a5e82b7be3d17a74229efaaf7571ef)
premature match was setup to work only on explicit invocations. However
this has shown to be too strict. Therefore, it's now a bit relaxed (not
as much as before): If the current item ends with the typed character we
assume  this is intenional - general premature matches do not end with
identifier characters anyway.

Note: Leaving only the last character as the condition is not an option
since sometimes they are not shown in the proposal description.

This patch also lifts the text method to IAssistProposalItem since
it's reasonable the every proposal must have at least some description.

Change-Id: I2ef7de2b7f978ce7059cce50175137a03315f495
Reviewed-on: http://codereview.qt.nokia.com/675
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
src/plugins/texteditor/codeassist/basicproposalitem.cpp
src/plugins/texteditor/codeassist/basicproposalitem.h
src/plugins/texteditor/codeassist/genericproposalwidget.cpp
src/plugins/texteditor/codeassist/iassistproposalitem.h