QmlJs: fix reformatting of 'signal' statements

Reformatting 'signal' preceded by comments used to bring to a bad
formatted file.

Task-number: QTCREATORBUG-17886
Change-Id: I02e093a4721cd1e75d45b498ea768251aee88ea4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Marco Benelli
2017-04-05 11:19:05 +02:00
parent 107a93ff0d
commit d0823cd5e2
2 changed files with 16 additions and 2 deletions

View File

@@ -150,8 +150,12 @@ protected:
void outCommentText(const QString &str)
{
QStringList lines = str.split(QLatin1Char('\n'));
bool multiline = lines.length() > 1;
for (int i = 0; i < lines.size(); ++i) {
_line = lines.at(i); // multiline comments don't keep track of previos lines
if (multiline)
_line = lines.at(i); // multiline comments don't keep track of previos lines
else
_line += lines.at(i);
if (i != lines.size() - 1)
newLine();
}
@@ -582,7 +586,7 @@ protected:
out(ast->identifierToken);
}
} else { // signal
out("signal ");
out("signal ", ast->identifierToken);
out(ast->identifierToken);
if (ast->parameters) {
out("(");