CppEditor: Add quickfix for converting comments from C++ to C style

... and vice versa.

Fixes: QTCREATORBUG-27501
Change-Id: I8584cc1e86718b3fe0f0ead2a3436495303ca3c8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2023-07-10 12:58:26 +02:00
parent d201899a0a
commit f93836b25d
8 changed files with 567 additions and 8 deletions

View File

@@ -12,6 +12,8 @@
#include <texteditor/refactoringchanges.h>
#include <optional>
namespace CppEditor {
class CppRefactoringChanges;
@@ -44,6 +46,8 @@ public:
void startAndEndOf(unsigned index, int *start, int *end) const;
QList<CPlusPlus::Token> tokensForCursor() const;
using TextEditor::RefactoringFile::textOf;
QString textOf(const CPlusPlus::AST *ast) const;
@@ -55,6 +59,9 @@ protected:
CppRefactoringChangesData *data() const;
void fileChanged() override;
int tokenIndexForPosition(const std::vector<CPlusPlus::Token> &tokens, int pos,
int startIndex) const;
mutable CPlusPlus::Document::Ptr m_cppDocument;
friend class CppRefactoringChanges; // for access to constructor