forked from qt-creator/qt-creator
Utils: Add factory functions for ChangeSet
This greatly simplifies code that produces change sets with a single EditOp. Change-Id: If042bb91e5132b7141d88404cfbd3ba12632b52d Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -116,10 +116,9 @@ public:
|
||||
const QmlJSRefactoringChanges &,
|
||||
const QString &) override
|
||||
{
|
||||
Utils::ChangeSet changes;
|
||||
const int insertLoc = _message.location.begin() - _message.location.startColumn + 1;
|
||||
changes.insert(insertLoc, QString::fromLatin1("// %1\n").arg(_message.suppressionString()));
|
||||
currentFile->apply(changes);
|
||||
currentFile->apply(Utils::ChangeSet::makeInsert(
|
||||
_message.location.begin() - _message.location.startColumn + 1,
|
||||
QString::fromLatin1("// %1\n").arg(_message.suppressionString())));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user