forked from qt-creator/qt-creator
Generalized the changeset operations.
This commit is contained in:
@@ -103,7 +103,7 @@ void ComponentFromObjectDef::createChanges()
|
||||
const QString txt = imports + textOf(start, end) + QLatin1String("}\n");
|
||||
|
||||
Utils::ChangeSet changes;
|
||||
changes.replace(start, end - start, componentName + QLatin1String(" {\n"));
|
||||
changes.replace(start, end, componentName + QLatin1String(" {\n"));
|
||||
qmljsRefactoringChanges()->changeFile(fileName(), changes);
|
||||
qmljsRefactoringChanges()->reindent(fileName(), range(start, end + 1));
|
||||
|
||||
|
||||
@@ -880,7 +880,7 @@ void QmlJSTextEditor::renameIdUnderCursor()
|
||||
Utils::ChangeSet changeSet;
|
||||
|
||||
foreach (const AST::SourceLocation &loc, m_semanticInfo.idLocations.value(id)) {
|
||||
changeSet.replace(loc.offset, loc.length, newId);
|
||||
changeSet.replace(loc.begin(), loc.end(), newId);
|
||||
}
|
||||
|
||||
QTextCursor tc = textCursor();
|
||||
|
||||
Reference in New Issue
Block a user