blob: 09fb151cc89c0db0bc679714bb18535badc367ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
// 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
|