diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2023-11-22 16:21:56 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2023-12-13 12:29:08 +0000 |
commit | 3b7d29d2a12429fe61f510c73e03b3048163d9d3 (patch) | |
tree | 5b1fcf4e9bf3bd84cd066e1505a7832bbe1d086e /src/plugins/clangtools | |
parent | 0e04f40fa76197d7f3d7d905d07731452777de2f (diff) |
Utils: Add formatting information to ChangeSet::EditOp
... and make use of that in TextEditor::RefactoringFile.
This allows calling code to have fine-grained control over which parts of
a refactoring should get re-formatted, while also providing sensible
default values that are "almost always" right, so things typically work
as expected out of the box.
Change-Id: I9200c2135b7477c33bc5a61c5d410b34853e4b61
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/clangtools')
-rw-r--r-- | src/plugins/clangtools/clangfixitsrefactoringchanges.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp index 4eeb72f94f..52c33c70d5 100644 --- a/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp +++ b/src/plugins/clangtools/clangfixitsrefactoringchanges.cpp @@ -188,10 +188,10 @@ void FixitsRefactoringFile::shiftAffectedReplacements(const FilePath &filePath, continue; for (const auto &op : replacements) { - QTC_ASSERT(op.type == ChangeSet::EditOp::Replace, continue); + QTC_ASSERT(op.type() == ChangeSet::EditOp::Replace, continue); if (op.pos1 > current.pos) break; - current.pos += op.text.size() - op.length1; + current.pos += op.text().size() - op.length1; } } } |