forked from qt-creator/qt-creator
Fix function signature completion for cv-qualified functions.
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
This commit is contained in:
@@ -1063,11 +1063,19 @@ bool CppCodeCompletion::completeConstructorOrFunction(const QList<TypeOfExpressi
|
|||||||
Overview overview;
|
Overview overview;
|
||||||
overview.setShowArgumentNames(true);
|
overview.setShowArgumentNames(true);
|
||||||
|
|
||||||
|
// get rid of parentheses and cv-qualifiers
|
||||||
|
QString completion = overview(f->type());
|
||||||
|
if (f->isVolatile() || f->isConst())
|
||||||
|
completion = completion.mid(1, completion.lastIndexOf(')') - 1);
|
||||||
|
else
|
||||||
|
completion = completion.mid(1, completion.size() - 2);
|
||||||
|
|
||||||
|
if (completion.size()) {
|
||||||
TextEditor::CompletionItem item(this);
|
TextEditor::CompletionItem item(this);
|
||||||
item.text = overview(f->type());
|
item.text = completion;
|
||||||
item.text = item.text.mid(1, item.text.size()-2);
|
|
||||||
m_completions.append(item);
|
m_completions.append(item);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user