Commit cedaebc3 authored by Erik Verbruggen's avatar Erik Verbruggen
Browse files

Fixed superfluous (and erroneous) semi-colon insertion.

Bug: BAUHAUS-674
parent f335855a
...@@ -112,12 +112,12 @@ void AddPropertyVisitor::addInMembers(QmlJS::AST::UiObjectInitializer *initializ ...@@ -112,12 +112,12 @@ void AddPropertyVisitor::addInMembers(QmlJS::AST::UiObjectInitializer *initializ
if (isOneLiner) { if (isOneLiner) {
if (insertAfter == 0) { // we're inserting after an lbrace if (insertAfter == 0) { // we're inserting after an lbrace
if (initializer->members) { // we're inserting before a member (and not the rbrace) if (initializer->members) { // we're inserting before a member (and not the rbrace)
needsTrailingSemicolon = true; needsTrailingSemicolon = m_propertyType == QmlRefactoring::ScriptBinding;
} }
} else { // we're inserting after a member, not after the lbrace } else { // we're inserting after a member, not after the lbrace
if (endOfPreviousMember.isValid()) { // there already is a semicolon after the previous member if (endOfPreviousMember.isValid()) { // there already is a semicolon after the previous member
if (insertAfter->next && insertAfter->next->member) { // and the after us there is a member, not an rbrace, so: if (insertAfter->next && insertAfter->next->member) { // and the after us there is a member, not an rbrace, so:
needsTrailingSemicolon = true; needsTrailingSemicolon = m_propertyType == QmlRefactoring::ScriptBinding;
} }
} else { // there is no semicolon after the previous member (probably because there is an rbrace after us/it, so: } else { // there is no semicolon after the previous member (probably because there is an rbrace after us/it, so:
needsPreceedingSemicolon = true; needsPreceedingSemicolon = true;
......
...@@ -58,7 +58,7 @@ private: ...@@ -58,7 +58,7 @@ private:
quint32 m_parentLocation; quint32 m_parentLocation;
QString m_name; QString m_name;
QString m_value; QString m_value;
QmlDesigner::QmlRefactoring::PropertyType m_propertyType; QmlRefactoring::PropertyType m_propertyType;
QStringList m_propertyOrder; QStringList m_propertyOrder;
}; };
......
...@@ -108,7 +108,7 @@ void RewriteActionCompressor::compressImports(QList<RewriteAction *> &actions) c ...@@ -108,7 +108,7 @@ void RewriteActionCompressor::compressImports(QList<RewriteAction *> &actions) c
void RewriteActionCompressor::compressRereparentActions(QList<RewriteAction *> &actions) const void RewriteActionCompressor::compressRereparentActions(QList<RewriteAction *> &actions) const
{ {
QMap<ModelNode, ReparentNodeRewriteAction *> reparentedNodes; QHash<ModelNode, ReparentNodeRewriteAction *> reparentedNodes;
QMutableListIterator<RewriteAction*> iter(actions); QMutableListIterator<RewriteAction*> iter(actions);
iter.toBack(); iter.toBack();
......
...@@ -804,8 +804,6 @@ void TestCore::testRewriterForGradientMagic() ...@@ -804,8 +804,6 @@ void TestCore::testRewriterForGradientMagic()
" }\n" " }\n"
"}"); "}");
QSKIP("See BAUHAUS-674", SkipAll);
QPlainTextEdit textEdit; QPlainTextEdit textEdit;
textEdit.setPlainText(qmlString); textEdit.setPlainText(qmlString);
NotIndentingTextEditModifier modifier(&textEdit); NotIndentingTextEditModifier modifier(&textEdit);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment