[SourceKit][CodeFormat] Awake the indent-sibling test after coping with the recent updates on AST representation of parameters.

This commit is contained in:
Xi Ge
2016-02-01 14:51:33 -08:00
parent aa102c16a7
commit a2490e2ae1
2 changed files with 51 additions and 52 deletions

View File

@@ -1899,7 +1899,7 @@ class FormatWalker: public ide::SourceEntityWalker {
if (EleStart.isInvalid()) {
EleStart = TE->getElement(I)->getStartLoc();
}
addPair(TE->getElement(I)->getEndLoc(), EleStart, tok::comma);
addPair(TE->getElement(I)->getEndLoc(), FindAlignLoc(EleStart), tok::comma);
}
}
@@ -1917,8 +1917,9 @@ class FormatWalker: public ide::SourceEntityWalker {
// Function parameters are siblings.
for (auto P : AFD->getParameterLists()) {
for (auto param : *P) {
addPair(param->getEndLoc(),
FindAlignLoc(param->getStartLoc()), tok::comma);
if (!param->isSelfParameter())
addPair(param->getEndLoc(), FindAlignLoc(param->getStartLoc()),
tok::comma);
}
}
}