TextEditor: Move more code into RefactoringFile

We want to get rid of RefactoringChangesData.

Change-Id: Ia428563a0ff70ec9660761beac3eb7168b8e9eca
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2023-11-16 16:09:26 +01:00
parent 4c0abb6d2c
commit 6f3bc431fc
11 changed files with 97 additions and 127 deletions

View File

@@ -89,15 +89,10 @@ bool applyTextEdits(const Client *client,
{
if (edits.isEmpty())
return true;
RefactoringChangesData * const backend = client->createRefactoringChangesBackend();
RefactoringChanges changes(backend);
RefactoringFilePtr file;
file = changes.file(filePath);
const RefactoringFilePtr file = client->createRefactoringFile(filePath);
file->setChangeSet(editsToChangeSet(edits, file->document()));
if (backend) {
for (const TextEdit &edit : edits)
file->appendIndentRange(convertRange(file->document(), edit.range()));
}
for (const TextEdit &edit : edits)
file->appendIndentRange(convertRange(file->document(), edit.range()));
return file->apply();
}