Closed masatake closed 3 years ago
In C language, struct tags and type names defined with typedef have different namespaces.
struct kvm; struct A; typedef struct A kvm; struct foo { struct kvm *bar; /* @ */ }; int bar;
When pressing M-. on bar at "@" line, xref shows:
bar
/tmp/bar.c 6: (member/kvm *@struct:foo) kvm *bar; 9: (variable/int) int bar;
The user may think the "bar" is typed with "kvm". It is not true; "bar" is typed with "struct kvm"
Code readers well optimized for C language utilize the difference between "kvm " and "struct kvm " as hints. They expect:
/tmp/bar.c 6: (member/struct:kvm *@struct:foo) kvm *bar; 9: (variable/int) int bar;
or
/tmp/bar.c 6: (member/struct kvm *@struct:foo) kvm *bar; 9: (variable/int) int bar;
ctags provides enough information:
bar bar.c /^ kvm *bar;$/;" m struct:foo typeref:struct:kvm * file:
citre may drop the first element of typeref:.
typeref:
The case that a client tool should drop the first element is when the first element is "typename". "typename" is a placeholder. So you can drop it.
I see. Thanks for the report.
In C language, struct tags and type names defined with typedef have different namespaces.
When pressing M-. on
bar
at "@" line, xref shows:The user may think the "bar" is typed with "kvm". It is not true; "bar" is typed with "struct kvm"
Code readers well optimized for C language utilize the difference between "kvm " and "struct kvm " as hints. They expect:
or
ctags provides enough information:
citre may drop the first element of
typeref:
.The case that a client tool should drop the first element is when the first element is "typename". "typename" is a placeholder. So you can drop it.