On Sun, Mar 5, 2023, 21:21 Dmitry Gutov wrote: > > Which modes? The ones where "declaration" is a thing. > > So we'll have a dozen different commands called 'xxx-find-declarations' > which will be implemented the same (?) way? Bound to the same key sequence? > > If there a particular point to doing that? Do we expect other modes to > reuse the same binding to do something else? That will reduce UI > consistency, at the very least. > Implementation could be trivial, xref could even provide a command-defining macro. Consistency should be evaluated considering the two approaches. Is it more consistent to have an xref command that doesn't really make sense in a another dozen languages? > IOW xref should try to stay language-agnostic, but provide common > > framework for language-specific things like major modes to reach > > backends like Eglot or anything else > > Most programming languages have something that corresponds to the term > "declaration". > Not sure about that. But if one squints very hard, everything does indeed look like a nail to one's hammer. > Mind you the same point made for xref can be made about LSP, > > language-agnostic on paper, but many a language-specific concept poorly > > disguised in there. But I see no reason to copy that flaw. > > I don't mind the idea of extensibility (and packages like lsp-mode do > this already: IIRC they have commands called lsp-find-declarations and > lsp-find-implementations). > As commands, this would be bloat in Eglot. But Eglot can give access to these LSP interfaces. But insofar as languages do have shared syntactic concepts, I don't see > why we wouldn't want to include more common ones. > "Definition" and "references" are universal enough. "Declaration", "class" and others, not so much. But that's just my 2c. João >