mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -191,7 +191,11 @@ bool ModelASTWalker::walkToDeclPre(Decl *D) {
|
|||||||
else if (VarDecl *VD = dyn_cast<VarDecl>(D)) {
|
else if (VarDecl *VD = dyn_cast<VarDecl>(D)) {
|
||||||
const DeclContext *DC = VD->getDeclContext();
|
const DeclContext *DC = VD->getDeclContext();
|
||||||
if (DC->isTypeContext()) {
|
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();
|
SourceLoc NL = VD->getNameLoc();
|
||||||
SyntaxStructureKind Kind = SyntaxStructureKind::InstanceVariable;
|
SyntaxStructureKind Kind = SyntaxStructureKind::InstanceVariable;
|
||||||
pushStructureNode({Kind, VD->getAttrs(),
|
pushStructureNode({Kind, VD->getAttrs(),
|
||||||
|
|||||||
Reference in New Issue
Block a user