forked from qt-creator/qt-creator
Clang: Integrate clang's fixits as refactoring actions
They are invokable by the usual means (Alt+Enter, editor's context menu
> Refactor) plus by the context menu of the editor's left margin for the
related line.
The fixit text comes directly from libclang and is thus not translated.
We modify the text slighty by stripping the diagnostic category prefix
("note:", "error:", ...) and capitalizing the first letter.
A follow-up change should properly indicate available refactorings with
a refactoring icon in the editor's left margin.
Task-number: QTCREATORBUG-14868
Change-Id: I86157c9f824d2a9dedf19087476d02ad1e6cc854
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
@@ -38,7 +38,13 @@
|
||||
#include <QObject>
|
||||
#include <QScopedPointer>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QMenu;
|
||||
class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Core { class IDocument; }
|
||||
namespace TextEditor { class TextEditorWidget; }
|
||||
|
||||
namespace ClangCodeModel {
|
||||
namespace Internal {
|
||||
@@ -76,11 +82,16 @@ private:
|
||||
void onAbstractEditorSupportContentsUpdated(const QString &filePath, const QByteArray &content);
|
||||
void onAbstractEditorSupportRemoved(const QString &filePath);
|
||||
|
||||
void onTextMarkContextMenuRequested(TextEditor::TextEditorWidget *widget,
|
||||
int lineNumber,
|
||||
QMenu *menu);
|
||||
|
||||
void onProjectPartsUpdated(ProjectExplorer::Project *project);
|
||||
void onProjectPartsRemoved(const QStringList &projectPartIds);
|
||||
|
||||
void connectTextDocumentToTranslationUnit(TextEditor::TextDocument *textDocument);
|
||||
void connectTextDocumentToUnsavedFiles(TextEditor::TextDocument *textDocument);
|
||||
void connectToWidgetsMarkContextMenuRequested(QWidget *editorWidget);
|
||||
|
||||
private:
|
||||
IpcCommunicator m_ipcCommunicator;
|
||||
|
||||
Reference in New Issue
Block a user