It is necessary to traverse children of unnamed declaration contexts
to get symbols which are currently missing in document outline, e.g.:
extern "C" {
void foo();
}
Differential D84839
Add document outline symbols from unnamed contexts, e.g. extern "C". ilya-golovenko on Jul 29 2020, 5:41 AM. Authored by
Details It is necessary to traverse children of unnamed declaration contexts extern "C" {
Diff Detail
Event Timeline
Comment Actions @kadircet I decided to add OnlyChildren to enum VisitKind instead of making a VisitKindSet - this helped to minimize the changes in shouldVisit(). What do you think? Comment Actions SGTM.
Comment Actions Thank you much for the review. I don't have commit access so could you please land it for me: |
this will result in traversal of other declcontexts like block/capturedecls.
i think we should rather change the VisitKind to {No, Decl, Children} and then make shouldVisit return a VisitKindSet and take a Decl* instead of a NamedDecl.
Later on we should first check for LinkageSpecDecl and return Children only while keeping the rest of the logic the same (i.e. try to cast to nameddecl and return No if it fails.
Finally logic in here should also be adjusted accordingly to visit children and the decl itself separately.
Do you have other cases apart from extern'd symbols?