[IDE] Add a structure test for property in the syntax model. Adjust the range to include the type.

Swift SVN r10728
This commit is contained in:
Sonny Falk
2013-12-02 19:31:07 +00:00
parent e686707bde
commit 1ec5094eee

View File

@@ -191,7 +191,11 @@ bool ModelASTWalker::walkToDeclPre(Decl *D) {
else if (VarDecl *VD = dyn_cast<VarDecl>(D)) {
const DeclContext *DC = VD->getDeclContext();
if (DC->isTypeContext()) {
SourceRange SR = VD->getSourceRange();
SourceRange SR;
if (PatternBindingDecl *PD = VD->getParentPattern())
SR = PD->getSourceRange();
else
SR = VD->getSourceRange();
SourceLoc NL = VD->getNameLoc();
SyntaxStructureKind Kind = SyntaxStructureKind::InstanceVariable;
pushStructureNode({Kind, VD->getAttrs(),