QmlJS indenter: Fix wrong indentation after list<> typed properties.

Task-number: QTCREATORBUG-7726
Change-Id: If709a9a71cfed69e2f14af92c114f79d11d03145
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
Christian Kamm
2012-09-10 10:39:16 +02:00
parent b17e944d4b
commit 0df5933539
3 changed files with 22 additions and 6 deletions

View File

@@ -198,18 +198,18 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
switch (kind) {
case Colon: enter(binding_assignment); break; // oops, was a binding
case Var:
case Identifier: enter(property_type); break;
case Identifier: enter(property_name); break;
case List: enter(property_list_open); break;
default: leave(true); continue;
} break;
case property_type:
case property_name:
turnInto(property_maybe_initializer);
break;
case property_list_open:
if (m_currentLine.midRef(m_currentToken.begin(), m_currentToken.length) == QLatin1String(">"))
turnInto(property_maybe_initializer);
turnInto(property_name);
break;
case property_maybe_initializer:
@@ -939,7 +939,7 @@ CodeFormatter::TokenKind CodeFormatter::extendedTokenKind(const QmlJS::Token &to
if (text == "on")
return On;
if (text == "list")
return On;
return List;
} else if (kind == Keyword) {
const QChar char1 = text.at(0);
const QChar char2 = text.at(1);