forked from qt-creator/qt-creator
QmlDesigner: Fix remove imports in the Rewriter
The import should be removed and not the import list. Change-Id: I6d9017141ea9c0d5885ed6d3dc3d227c2fe7b2f4 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
@@ -79,8 +79,8 @@ bool ChangeImportsVisitor::remove(QmlJS::AST::UiProgram *ast, const Import &impo
|
||||
|
||||
for (UiImportList *iter = ast->imports; iter; iter = iter->next) {
|
||||
if (equals(iter->import, import)) {
|
||||
int start = iter->firstSourceLocation().begin();
|
||||
int end = iter->lastSourceLocation().end();
|
||||
int start = iter->import->firstSourceLocation().begin();
|
||||
int end = iter->import->lastSourceLocation().end();
|
||||
includeSurroundingWhitespace(start, end);
|
||||
replace(start, end - start, QString());
|
||||
setDidRewriting(true);
|
||||
|
||||
Reference in New Issue
Block a user