universal-ctags / citre

A superior code reading & auto-completion tool with pluggable backends.
GNU General Public License v3.0
337 stars 26 forks source link

C, enh: Consider a name of member before '(' as a callable member when soring #54

Closed masatake closed 3 years ago

masatake commented 3 years ago

Doing M-. at "poll" on the line:

work = n->poll(n, weight);

shows the list

linux/arch/x86/include/uapi/asm/kvm.h
72: (member/__u8) __u8 poll;
linux/arch/x86/kvm/irq.h
36: (member/u8) u8 poll;
linux/drivers/input/mouse/psmouse.h
127: (member/int (*)(struct psmouse * psmouse)) int (*poll)(struct psmouse *psmouse);
linux/drivers/net/ethernet/mellanox/mlx5/core/en_stats.h
394: (member/u64) u64 poll;
linux/drivers/net/ethernet/sfc/falcon/net_driver.h
574: (member/bool (*)(struct ef4_nic * efx)) bool (*poll) (struct ef4_nic *efx);
...

"(" comes after "poll" on the line, callable members should have higher priorities in the list.

With this change, the list becomes:

linux/drivers/input/mouse/psmouse.h
127: (member/int (*)(struct psmouse * psmouse)) int (*poll)(struct psmouse *psmouse);
linux/drivers/net/ethernet/sfc/falcon/net_driver.h
574: (member/bool (*)(struct ef4_nic * efx)) bool (*poll) (struct ef4_nic *efx);
...
linux/arch/x86/include/uapi/asm/kvm.h
72: (member/__u8) __u8 poll;
linux/arch/x86/kvm/irq.h
36: (member/u8) u8 poll;
...

Signed-off-by: Masatake YAMATO yamato@redhat.com

AmaiKinono commented 3 years ago

Thanks!