|
| From: | Dmitry Gutov |
| Subject: | Re: Adding support for xref jumping to headers/interfaces |
| Date: | Tue, 28 Nov 2023 02:30:09 +0200 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
On 28/11/2023 01:25, João Távora wrote:
On Mon, Nov 27, 2023 at 6:12 PM Dmitry Gutov <dmitry@gutov.dev> wrote:There are also abstract method definitions in C++ and so on.No, there aren't. You probably mean "(pure) virtual member function". And yes, I can assure you that's the jargon that professional and aspiring C++ developers prefer when communicating with colleagues and compilers, certainly not wishy-washy Javaisms.
My deepest apologies.
What goes for declarations in a lot of cases will also be "definitionsof some sort". But if you squint hard enough, everything's "definition". In fact, definition definition definition. Definition? Definition!
Unless it's a reference (call site of a function or a place where a variable's value is looked up; or referred to in a doc). So yes, these are basically two categories of xrefs we distinguish: definitions (only one or a few of them for a given name; usually want to jump to one) and references (usually many of them for a given name; and we would often want to see the full list, to read or search/replace against it).
So in that terminology, both declarations and implementations are "kinds of definitions".
If there are suggestion for replacement of that term, I'm happy to discuss.
If you don't like "definitions" in "xref-show-definitions-function", then it would need to be a term that describes "special kind of cross-references". Probably referring to the kinds of locations those cross-references point to (which determines the optimal UI).I'm fine with that name myself, it's specifically for xref -find-definitions, right?
And for declarations/implementations, and so on. Again, xref-find-all-definitions might be renamed, but what it does by default is find all definition-looking sites for the entity at point. Which seems useful enough to me. And which also implies that "references" of any sort should not be in that list.
Just to reiterate: xref-find-all-definitions calls xref--show-defs which displays the results using xref-show-definitions-function.
I just find it nonsensical to use that to justify the "definitions" in your proposed xref-find-all-definitions which potentially serves to find C declarations, C++ deduction guides, Elisp feature-providing forms, CL macroexpansion loci, etc, etc. I've given plenty of alternatives.
The only alternative I remember you suggesting is using "xrefs", which was missing the point.
| [Prev in Thread] | Current Thread | [Next in Thread] |