forked from qt-creator/qt-creator
Clang: Fix slots and function pointers completion
Check completed functions for preceding & and don't add parantheses in that case Task-number: QTCREATORBUG-17578 Change-Id: I21b1e2c9ffb9d288f3267146e9afd575e6fef30b Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -111,7 +111,11 @@ void ClangAssistProposalItem::apply(TextEditor::TextDocumentManipulatorInterface
|
||||
// in which case it would be annoying if we put the cursor after the already automatically
|
||||
// inserted closing parenthesis.
|
||||
const bool skipClosingParenthesis = m_typedCharacter != QLatin1Char('(');
|
||||
|
||||
QTextCursor cursor = manipulator.textCursorAt(basePosition);
|
||||
cursor.movePosition(QTextCursor::PreviousWord);
|
||||
while (manipulator.characterAt(cursor.position()) == ':')
|
||||
cursor.movePosition(QTextCursor::PreviousWord, QTextCursor::MoveAnchor, 2);
|
||||
if (manipulator.characterAt(cursor.position()) != '&') {
|
||||
if (completionSettings.m_spaceAfterFunctionName)
|
||||
extraCharacters += QLatin1Char(' ');
|
||||
extraCharacters += QLatin1Char('(');
|
||||
@@ -151,6 +155,7 @@ void ClangAssistProposalItem::apply(TextEditor::TextDocumentManipulatorInterface
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (autoInsertBrackets && data().canConvert<CompleteFunctionDeclaration>()) {
|
||||
|
||||
Reference in New Issue
Block a user