forked from qt-creator/qt-creator
Clang: Do not show completions after comma in initializer list
Appends 0852f889d1.
Do not automatically show global completion when initializer list
does not have a type, e.g. auto foo = {{},<cursor>};
Change-Id: I233fef71c60bb79211000df70bf5b04fa2d9df37
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -110,6 +110,8 @@ int ClangCompletionContextAnalyzer::startOfFunctionCall(int endOfOperator) const
|
||||
functionNameSelector.setPosition(functionNameStart);
|
||||
functionNameSelector.setPosition(index, QTextCursor::KeepAnchor);
|
||||
const QString functionName = functionNameSelector.selectedText().trimmed();
|
||||
if (functionName.isEmpty() && m_completionOperator == T_LBRACE)
|
||||
return endOfOperator;
|
||||
|
||||
return functionName.isEmpty() ? -1 : functionNameStart;
|
||||
}
|
||||
@@ -139,7 +141,10 @@ void ClangCompletionContextAnalyzer::handleCommaInFunctionCall()
|
||||
const int start = expressionUnderCursor.startOfFunctionCall(textCursor);
|
||||
m_positionEndOfExpression = start;
|
||||
m_positionForProposal = start + 1; // After '(' of function call
|
||||
m_completionOperator = T_LPAREN;
|
||||
if (m_interface->characterAt(start) == '(')
|
||||
m_completionOperator = T_LPAREN;
|
||||
else
|
||||
m_completionOperator = T_LBRACE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user