forked from qt-creator/qt-creator
Clang: Treat brace initialization as constructor completion
Try to complete constructor after left brace with fallback to normal completion. Task-number: QTCREATORBUG-20957 Change-Id: I6c33790a3ee1e623a3d8abe9a44cfd821b6f3106 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -83,7 +83,7 @@ void ActivationSequenceContextProcessor::process()
|
||||
processComment();
|
||||
processInclude();
|
||||
processSlashOutsideOfAString();
|
||||
processLeftParen();
|
||||
processLeftParenOrBrace();
|
||||
processPreprocessorInclude();
|
||||
}
|
||||
|
||||
@@ -163,9 +163,9 @@ void ActivationSequenceContextProcessor::processSlashOutsideOfAString()
|
||||
m_completionKind = CPlusPlus::T_EOF_SYMBOL;
|
||||
}
|
||||
|
||||
void ActivationSequenceContextProcessor::processLeftParen()
|
||||
void ActivationSequenceContextProcessor::processLeftParenOrBrace()
|
||||
{
|
||||
if (m_completionKind == CPlusPlus::T_LPAREN) {
|
||||
if (m_completionKind == CPlusPlus::T_LPAREN || m_completionKind == CPlusPlus::T_LBRACE) {
|
||||
if (m_tokenIndex > 0) {
|
||||
// look at the token at the left of T_LPAREN
|
||||
const CPlusPlus::Token &previousToken = m_tokens.at(m_tokenIndex - 1);
|
||||
|
||||
Reference in New Issue
Block a user