mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Add annotation tags for decl names
This splits the printDeclNamEndLoc callback into NameEndLoc and NameOrSignatureEndLoc variants to differentiate whether or not signatures are included. All existing clients move to NameOrSignatureEndLoc to maintain the current behaviour. I'm still not completely happy with how these are named, but I dont' have any better ideas right now. rdar://problem/24292226
This commit is contained in:
@@ -83,6 +83,13 @@ private:
|
||||
closeTag(getTagForDecl(D, /*isRef=*/false));
|
||||
}
|
||||
|
||||
void printDeclLoc(const Decl *D) override {
|
||||
openTag("decl.name");
|
||||
}
|
||||
void printDeclNameEndLoc(const Decl *D) override {
|
||||
closeTag("decl.name");
|
||||
}
|
||||
|
||||
void printTypeRef(const TypeDecl *TD, Identifier name) override {
|
||||
auto tag = getTagForDecl(TD, /*isRef=*/true);
|
||||
OS << "<" << tag << " usr=\"";
|
||||
|
||||
Reference in New Issue
Block a user