ccls icon indicating copy to clipboard operation
ccls copied to clipboard

Caller Hiearchy shows lines of each reference in caller, not start li…

Open withgod84-zz opened this issue 6 years ago • 3 comments

As like other IDEs (Eclipse, ..) , it's better to show line of each reference in caller hiearchy, Instead of caller's start line. For example, if caller has a lots of lines, it's annoying to find which line calls current symbol in which context or condition.

withgod84-zz avatar Jun 28 '19 01:06 withgod84-zz

Ready to merge in my opinion.

withgod84-zz avatar Jun 28 '19 12:06 withgod84-zz

  • I remember someone suggested to use the function line instead of the call site for caller hierarchy. It may not be obvious from the UI which functions are the callers.
  • src/messages/ccls_call.cc is used by both caller and callee hierarchies. This change will break callee hierarchy.
  • foo may be called multiple times in bar. Creating duplicate nodes in the caller hierarchy is redundant.

MaskRay avatar Jul 01 '19 07:07 MaskRay

  • I remember someone suggested to use the function line instead of the call site for caller hierarchy. It may not be obvious from the UI which functions are the callers.
  • src/messages/ccls_call.cc is used by both caller and callee hierarchies. This change will break callee hierarchy. ===> First of all, my change only shows function line only in case of caller hiearchy. ===> In case of callee, it's better to show definition of callee, but it's not case in caller. ===> IMHO, it's better to take different strategy between caller and callee.
  • foo may be called multiple times in bar. Creating duplicate nodes in the caller hierarchy is redundant. ===> This is reasonable point, but this may harm efficiency of using caller hiearchy ===> For every entry in graph, user should find the location which call the function.

I think there is trade off between function line and reference line. If then, how about creating new parameter option to show reference line instead of function start line?

withgod84-zz avatar Jul 01 '19 08:07 withgod84-zz