forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user