forked from qt-creator/qt-creator
CppEditor: Consider namespaces in "extract function" quickfix
Fixes: QTCREATORBUG-23256 Change-Id: I99b1271907767c3607e35adb49bd4109f3eca18c Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -3438,12 +3438,17 @@ public:
|
||||
|
||||
// Write class qualification, if any.
|
||||
if (matchingClass) {
|
||||
Class *current = matchingClass;
|
||||
const Scope *current = matchingClass;
|
||||
QVector<const Name *> classes{matchingClass->name()};
|
||||
while (current->enclosingScope()->asClass()) {
|
||||
current = current->enclosingScope()->asClass();
|
||||
classes.prepend(current->name());
|
||||
}
|
||||
while (current->enclosingScope() && current->enclosingScope()->asNamespace()) {
|
||||
current = current->enclosingScope()->asNamespace();
|
||||
if (current->name())
|
||||
classes.prepend(current->name());
|
||||
}
|
||||
for (const Name *n : classes) {
|
||||
const Name *name = rewriteName(n, &env, control);
|
||||
funcDef.append(printer.prettyName(name));
|
||||
|
||||
Reference in New Issue
Block a user