forked from qt-creator/qt-creator
CppEditor: Add class member from member initialization
That is, if a class member being initialized is not yet declared, offer to add the declaration. Fixes: QTCREATORBUG-11842 Change-Id: I1d2a56ab99543e996e220aa26b7923023dd163f7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -391,6 +391,22 @@ public:
|
||||
void match(const CppQuickFixInterface &interface, TextEditor::QuickFixOperations &result) override;
|
||||
};
|
||||
|
||||
/*!
|
||||
Adds a class member from an initialization in the constructor.
|
||||
*/
|
||||
class InsertMemberFromInitialization : public CppQuickFixFactory
|
||||
{
|
||||
public:
|
||||
void match(const CppQuickFixInterface &interface,
|
||||
TextEditor::QuickFixOperations &result) override;
|
||||
|
||||
private:
|
||||
QString getType(
|
||||
const CppQuickFixInterface &interface,
|
||||
const CPlusPlus::MemInitializerAST *memInitializer,
|
||||
const CPlusPlus::FunctionDefinitionAST *ctor) const;
|
||||
};
|
||||
|
||||
/*!
|
||||
Extracts the selected code and puts it to a function
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user