blob: c89688940f2022a2a35f593ddb1c3b92fef0d729 (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
|
// 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 "cppsemanticinfo.h"
#include <texteditor/codeassist/assistinterface.h>
#include <texteditor/codeassist/iassistprovider.h>
#include <texteditor/quickfix.h>
#include <cplusplus/LookupContext.h>
namespace CppEditor {
class CppEditorWidget;
class CppRefactoringFile;
using CppRefactoringFilePtr = QSharedPointer<CppRefactoringFile>;
namespace Internal {
class CppQuickFixInterface : public TextEditor::AssistInterface
{
public:
CppQuickFixInterface(CppEditorWidget *editor, TextEditor::AssistReason reason);
const QList<CPlusPlus::AST *> &path() const;
CPlusPlus::Snapshot snapshot() const;
SemanticInfo semanticInfo() const;
const CPlusPlus::LookupContext &context() const;
CppEditorWidget *editor() const;
CppRefactoringFilePtr currentFile() const;
bool isCursorOn(unsigned tokenIndex) const;
bool isCursorOn(const CPlusPlus::AST *ast) const;
bool isBaseObject() const override { return false; }
private:
QTextCursor adjustedCursor();
CppEditorWidget *m_editor;
SemanticInfo m_semanticInfo;
CPlusPlus::Snapshot m_snapshot;
CppRefactoringFilePtr m_currentFile;
CPlusPlus::LookupContext m_context;
QList<CPlusPlus::AST *> m_path;
};
class CppQuickFixAssistProvider : public TextEditor::IAssistProvider
{
public:
CppQuickFixAssistProvider() = default;
IAssistProvider::RunType runType() const override;
TextEditor::IAssistProcessor *createProcessor(const TextEditor::AssistInterface *) const override;
};
TextEditor::QuickFixOperations quickFixOperations(const TextEditor::AssistInterface *interface);
} // Internal
} // CppEditor
|