[SyntaxColoring] Add syntax coloring to indirect keyword of enum element decl. rdar://21927124

Swift SVN r30521
This commit is contained in:
Xi Ge
2015-07-23 01:37:22 +00:00
parent 6471303c12
commit d980700f17
2 changed files with 13 additions and 0 deletions

View File

@@ -865,6 +865,12 @@ bool ModelASTWalker::walkToDeclPre(Decl *D) {
SN.Dcl = D;
SN.Kind = SyntaxStructureKind::EnumCase;
SN.Range = charSourceRangeFromSourceRange(SM, D->getSourceRange());
for (auto *EnumElemD : EnumCaseD->getElements()) {
if (auto IA = EnumElemD->getAttrs().getAttribute<IndirectAttr>()) {
passNonTokenNode({SyntaxNodeKind::Keyword,
charSourceRangeFromSourceRange(SM, IA->getLocation())});
}
}
if (pushStructureNode(SN, D)) {
// FIXME: ASTWalker walks enum elements as members of the enum decl, not
// as members of the enum case decl. Walk them manually here so that they