From a7928b4b0b4c283f50c485da305582aad73afcfc Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Mon, 24 Aug 2015 18:26:09 +0200 Subject: 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 --- src/plugins/cpptools/baseeditordocumentprocessor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/cpptools/baseeditordocumentprocessor.cpp') diff --git a/src/plugins/cpptools/baseeditordocumentprocessor.cpp b/src/plugins/cpptools/baseeditordocumentprocessor.cpp index ec1a9a9617..43f5fb9029 100644 --- a/src/plugins/cpptools/baseeditordocumentprocessor.cpp +++ b/src/plugins/cpptools/baseeditordocumentprocessor.cpp @@ -64,6 +64,12 @@ TextEditor::TextDocument *BaseEditorDocumentProcessor::baseTextDocument() const return m_baseTextDocument; } +TextEditor::QuickFixOperations +BaseEditorDocumentProcessor::extraRefactoringOperations(const TextEditor::AssistInterface &) +{ + return TextEditor::QuickFixOperations(); +} + BaseEditorDocumentProcessor *BaseEditorDocumentProcessor::get(const QString &filePath) { CppModelManager *cmmi = CppModelManager::instance(); -- cgit v1.2.1