[RangeInfo] Report the innermost decl context for the range under selection. (#6448)

This commit is contained in:
Xi Ge
2016-12-21 16:50:39 -08:00
committed by GitHub
parent 5cff812195
commit 94851e25d7
7 changed files with 148 additions and 4 deletions

View File

@@ -24,6 +24,7 @@ namespace swift {
class Expr;
class Stmt;
class Decl;
class DeclContext;
class SourceLoc;
class SourceRange;
class ASTWalker;
@@ -42,6 +43,10 @@ namespace swift {
void walk(ASTWalker &Walker);
void walk(ASTWalker &&walker) { walk(walker); }
/// \brief get the underlying entity as a decl context if it is one,
/// otherwise, return nullptr;
DeclContext *getAsDeclContext() const;
};
} // namespace swift