mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Differentiate decl.var.local from decl.var.parameter
For decls it can be interesting to know when a decl is a parameter vs. a local. This will be needed for the new fully annotated decls. For refs it's usually not interesting. rdar://problem/24292226
This commit is contained in:
@@ -165,6 +165,7 @@ public:
|
||||
|
||||
UIdent visitFuncDecl(const FuncDecl *D);
|
||||
UIdent visitVarDecl(const VarDecl *D);
|
||||
UIdent visitParamDecl(const ParamDecl *D);
|
||||
UIdent visitExtensionDecl(const ExtensionDecl *D);
|
||||
UIdent visitAssociatedTypeDecl(const AssociatedTypeDecl *D) {
|
||||
return IsRef ? KindRefAssociatedType : KindDeclAssociatedType;
|
||||
@@ -238,6 +239,11 @@ UIdent UIdentVisitor::visitVarDecl(const VarDecl *D) {
|
||||
return IsRef ? KindRefVarGlobal : KindDeclVarGlobal;
|
||||
}
|
||||
|
||||
UIdent UIdentVisitor::visitParamDecl(const ParamDecl *D) {
|
||||
// There is no KindRefVarParam. It's not usually an interesting difference.
|
||||
return IsRef ? KindRefVarLocal : KindDeclVarParam;
|
||||
}
|
||||
|
||||
UIdent UIdentVisitor::visitExtensionDecl(const ExtensionDecl *D) {
|
||||
assert(!IsRef && "reference to an extension ?");
|
||||
if (NominalTypeDecl *NTD = D->getExtendedType()->getAnyNominal()) {
|
||||
|
||||
Reference in New Issue
Block a user