Clang: Fix completion position for clang and proposal

* Rename some members/functions to clarify their meaning.

* Ensure that the position for the proposal widget is at start of the
  identifer, so that the filter prefix will be found correctly in the
  GenericProposalWidget. For certain cases the completion were
  calculated but the widget was never shown:

  Case 1:

    void f()
    {
        <COMPLETION_CURSOR>
    }

  Case 2:

    void f()
    {
        st<COMPLETION_CURSOR>
    }

  Case 3:

    if (true)
      <COMPLETION_CURSOR>

  Case 4:

    foo. mem<COMPLETION_CURSOR>

Change-Id: Ie79e01e8a22f8ec306136ec4ccbfffd544edd573
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-07-23 16:06:48 +02:00
parent 49b1d35778
commit 91429aa752
9 changed files with 108 additions and 50 deletions

View File

@@ -363,7 +363,7 @@ int ClangCompletionAssistProcessor::startOfOperator(int positionInDocument,
*kind = activationSequenceProcessor.completionKind();
int start = activationSequenceProcessor.position();
int start = activationSequenceProcessor.operatorStartPosition();
if (start != positionInDocument) {
QTextCursor tc(m_interface->textDocument());
tc.setPosition(positionInDocument);