From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Adding support for xref jumping to headers/interfaces Date: Mon, 27 Nov 2023 19:05:35 +0200 Message-ID: References: <87il697r5g.fsf@catern.com> <87r0kw8nxu.fsf@catern.com> <3fe5a8cd-b355-d7eb-10ad-8846aef3387b@gutov.dev> <878r6mx1xc.fsf@betli.tmit.bme.hu> <90e4b9a7-3b51-587d-e317-b89e5d5464d9@gutov.dev> <87sf4scxax.fsf@betli.tmit.bme.hu> <9ac758b8-5fb2-9b3d-7947-96777694e3e0@gutov.dev> <2fe6c4f0-dffc-ce00-758e-0c431a803d4d@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15132"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: Felician Nemeth , Spencer Baugh , emacs-devel@gnu.org, Eshel Yaron , John Yates , Ergus , Filipp Gunbin To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 27 18:06:40 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r7f4B-0003g2-8h for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Nov 2023 18:06:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7f3N-0005rS-2t; Mon, 27 Nov 2023 12:05:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r7f3J-0005rJ-SZ for emacs-devel@gnu.org; Mon, 27 Nov 2023 12:05:45 -0500 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r7f3H-0004G0-BZ for emacs-devel@gnu.org; Mon, 27 Nov 2023 12:05:45 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 22C2E5C01F7; Mon, 27 Nov 2023 12:05:41 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 27 Nov 2023 12:05:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1701104741; x=1701191141; bh=h+sc+fQm8/dGeHvqhpxR2mKerCcVCFA1iah vIAX5MQ8=; b=gkVeg9jI6UUT2opyy7sQstbUU5n0HGHdNnc+RF/GHclnGMT2CqF cR+F0sMrrGbwdzPBG/lglTAVBEc1nkODpi5WpW5og2J57t+OQ/dqymYvh4Jg+Y+8 mYXGzUwnGLfYR2pZtRxU3VDKHj8Mhu7CQle4O10s/uMj5ytyq1X4ATei0FQHiL+X zs1R6wpLm+SIZDFPd8PjD6W5UmJs+h5QcjHSswUIE76uz4Xt5EIkJXqfulogijlR ZpNw0VEFvgsvGFceIjCHO6envMnJv9yMhpJKvD2+XftxCF7QIjgyrcnx+G5w0qN4 P0KxfK0SPSHxIOEck9hOgXXS9ZtAWtw93Yw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1701104741; x=1701191141; bh=h+sc+fQm8/dGeHvqhpxR2mKerCcVCFA1iah vIAX5MQ8=; b=jjpeetMXEaf8ZxLbVAQ1hg1LhRM0rmGxwfzm0sUP/ioPmMwPjsN K35cNjPsOl4+xc6kZ4GUdj5fNF/MWNRFouusou9xmXUdzoOV8PfdJX7qzYgc192H XnEATOivEvkA87ANXVlx+vOZiIs1FLZnco5tZjiOUbfBnGMnX+Ax/5/mOa4Af51K g2be3TAN+/p8RSeqDSkAlFtH6zArRPLrkSOzpgg6LA0S3YRbosHaAkOYJp44jehq bOQukOklTiK4kg0FSIX1eevCfqSt/akqlWbuljaEH0wbdLd6mCrDQfUPqbwORT/5 By9RjygR7/gY1R+QFovpfvI2+cjTZs+Kt3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudeiuddgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhephfffheeljeffgeffueeghfekkedtfffgheejvdegjeettdduheeufffggfef jeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Nov 2023 12:05:38 -0500 (EST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=66.111.4.29; envelope-from=dmitry@gutov.dev; helo=out5-smtp.messagingengine.com X-Spam_score_int: -46 X-Spam_score: -4.7 X-Spam_bar: ---- X-Spam_report: (-4.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.857, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:313287 Archived-At: On 27/11/2023 18:41, João Távora wrote: > On Mon, Nov 27, 2023 at 4:23 PM Dmitry Gutov wrote: >> >> On 27/11/2023 18:04, João Távora wrote: >>> On Mon, Nov 27, 2023 at 3:45 PM Dmitry Gutov wrote: >>> >>>> That didn't answer the above question. To signal "what kind of >>>> cross-references it can find", it would define >>>> xref-backend-definition-kinds with corresponding return value. >>> >>> The answer was in the first two words. "Of course", and the reason >>> is in the words following that. >>> >>> So to be clear, yes, c++-ts-mode, if it ever gets such capabilities >>> should define c++-ts-find-declaration, c++-ts-find-partial-specializations >>> and so forth, but probably no c++-ts-find-implementation (fuzzy concept >>> in C++). It should (or rather, it may) bind them in a given xref-provided >>> prefix map and they should become active when c++-ts-mode is active. >>> >>> For "references" and "definitions" the existing xref commands will do, >>> but the phrases "references" and "definitions" should well be in the >>> "prompt for kind" list as options. >> >> We in the end we'll have dozens of similarly-named commands with the >> same implementation, right? Some of them in the core, others in >> third-party addons. > > What same implementation?? They only common part is is literally just > the string "xref-define-finder", the opening and the closing parenthesis. > Then comes the backend specifics. A JSONRPC-based transport with a specific > protocol, an HTTP transport with another protocol, a ask the oracle of Delphos > protocol, etc. > > Realistically, most people will be using Eglot anyway, so the existing > eglot-find-* commands are what they're going to see and use. So that's what your argument comes down to in practical sense -- keep the commands in Eglot, and not worry much about other Xref backends. Whether they are alternative LSP clients or not. Setting aside the issue of us binding ourselves to Eglot too closely, that *would* mean keeping those commands unbound for the foreseeable future. And I do remember users asking about the default bindings. >>> But you could put the existing xref-find-definition and xref-find-references >>> commands in it. Even the "find-all" could be there. >> >> That... doesn't sound very convincing, TBH. > > That's obvious. It's clear to me that you are already convinced > of whatever you want and all this discussion leads nowhere. I'm saying it doesn't look good as an argument that I could make to convince the current head maintainers of Emacs to free up the "M-'" binding. Or any other short key sequence, probably.