forked from qt-creator/qt-creator
Replace the current license disclaimer in files by a SPDX-License-Identifier. Task-number: QTBUG-67283 Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
// Copyright (C) 2016 The Qt Company Ltd.
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0+ OR GPL-3.0 WITH Qt-GPL-exception-1.0
|
|
|
|
#pragma once
|
|
|
|
#include "clangutils.h"
|
|
|
|
#include <texteditor/quickfix.h>
|
|
|
|
#include <utils/changeset.h>
|
|
|
|
#include <QVector>
|
|
#include <QSharedPointer>
|
|
|
|
namespace TextEditor {
|
|
class RefactoringChanges;
|
|
class RefactoringFile;
|
|
}
|
|
|
|
namespace ClangCodeModel {
|
|
namespace Internal {
|
|
|
|
class ClangFixItOperation : public TextEditor::QuickFixOperation
|
|
{
|
|
public:
|
|
ClangFixItOperation(const QString &fixItText, const QList<ClangFixIt> &fixIts);
|
|
|
|
int priority() const override;
|
|
QString description() const override;
|
|
void perform() override;
|
|
|
|
QString firstRefactoringFileContent_forTestOnly() const;
|
|
|
|
private:
|
|
void applyFixitsToFile(TextEditor::RefactoringFile &refactoringFile,
|
|
const QList<ClangFixIt> fixIts);
|
|
Utils::ChangeSet toChangeSet(TextEditor::RefactoringFile &refactoringFile,
|
|
const QList<ClangFixIt> fixIts) const;
|
|
|
|
private:
|
|
QString fixItText;
|
|
QVector<QSharedPointer<TextEditor::RefactoringFile>> refactoringFiles;
|
|
QList<ClangFixIt> fixIts;
|
|
};
|
|
|
|
} // namespace Internal
|
|
} // namespace ClangCodeModel
|