From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Adding support for xref jumping to headers/interfaces Date: Sun, 12 Nov 2023 02:08:13 +0000 Message-ID: References: <83h6uv47e8.fsf@gnu.org> <4639d7ca-2109-864c-33c0-38e65f26f262@yandex.ru> <835ybb3txt.fsf@gnu.org> <83wn3q311i.fsf@gnu.org> <412afa2d-5dbc-52da-39c4-99be3873929c@yandex.ru> <83o7p20wdi.fsf@gnu.org> <72b09256-5a1b-8962-9e3c-7d2ffd0dc0d7@yandex.ru> <83ilf925n8.fsf@gnu.org> <95afa441-18ae-e62a-be16-be73a545bbba@yandex.ru> <54cb435f-4d51-4c0d-43d8-2991dd7ee6bd@gutov.dev> <4b0b05a2-8c83-7026-4310-327d595dfd8a@gutov.dev> <87cywg8mx0.fsf@catern.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4773"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Spencer Baugh , emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 12 03:06:11 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 1r1zrX-00012Z-HY for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Nov 2023 03:06:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1zqn-00017R-TY; Sat, 11 Nov 2023 21:05:25 -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 1r1zqm-00016g-8C for emacs-devel@gnu.org; Sat, 11 Nov 2023 21:05:24 -0500 Original-Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r1zqk-00007y-NB for emacs-devel@gnu.org; Sat, 11 Nov 2023 21:05:24 -0500 Original-Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-507962561adso5014368e87.0 for ; Sat, 11 Nov 2023 18:05:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699754721; x=1700359521; darn=gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=MMuujpB9tN5mQvWBg55+manF507tZQychg7ixtIb324=; b=P6F4cFZ46ou6+6WObf8otocTQcWoRyX6AubY37XQeVyGktEC7C8hJEfUJqk/tEZhAG 2fZVXs6OTM9/vomwa714au3v3h+15B6vE/cLBvX9Lj6ulBop3Jf3VGcaflkT/1LRuNLT m24o5jmQopBnM/5LEsXIEWhqQF6UA1aR7OKSRVvaTnaYm90Ej9emb6taqH6H+cA9aAFb M46r7XvYxgj4ZoMQiYGazJ1nOQXzAOn9FtF7lawhseVIYRshpaPyCuhcR6iGJR+Lv10u tBTrLemqFrUjm/xcNQIz50qpYQb0jYdB8FND9lEZAg7tqKQkWdQkUqtnalZOlJrU67NS FasQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699754721; x=1700359521; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MMuujpB9tN5mQvWBg55+manF507tZQychg7ixtIb324=; b=CY/+ahOFn+zROiFQwCictFTs4KUVdeJV7/QNJCkBU9xPiLMKgpZnW5gjCegkElgcVV 7fC0Jyd8eSLUDJN4B5xSBywux7mgeEldpg7Ptl4aeH1eawJGpMbnXXCNhjsXEfzO83ST Y6aDZJUaZQtoamDKL922in7QAHGUYOsonVFTuOigtBNEgKdXV81z9h1iCSVwAEGUj5Nh 36GydlvXOiMIc8TFXKuUMKBfVzBv07WJ9KA2KEZ6Epi6Biv668eqLUuJ4JH3MLvf80b2 kUTOSGpNNpR4dWHeNUwqftLD331VfBHuhUXPhaE5rcU9nbKDektKGWf4q7/ToF6+0o8t Ag/Q== X-Gm-Message-State: AOJu0Yz+N0s2paMVEEsn052zPuO/Hu6kk1WWrxOm/sYIyFatnJJDHCUI 8NdrnrwtpSq+gHda/p8XYzJQkqTPCb1gKoO/n8YZGaREbhcFAg== X-Google-Smtp-Source: AGHT+IG2FObd6+luRt5+FrDEqr7LWx1J05q9Y8PGxNNT2DMUVPo/y31p5uDuraVgnovXMT1rNoYdtv1WRRdJrUFfxvQ= X-Received: by 2002:a05:6512:3f14:b0:4fb:8f79:631 with SMTP id y20-20020a0565123f1400b004fb8f790631mr2765719lfa.46.1699754720558; Sat, 11 Nov 2023 18:05:20 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::135; envelope-from=joaotavora@gmail.com; helo=mail-lf1-x135.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:312623 Archived-At: On Sun, Nov 12, 2023 at 1:51=E2=80=AFAM Dmitry Gutov wro= te: > I thought we might have decided that the backend would create its own > specific command for that (e.g. called > eglot-find-higher-order-template-cxx-macroexpansion-definitions). Noooo. Eglot only does LSP things! The major mode may do that if it has another alternative backend, or if it knows it is using LSP with a specific language server, like 'superduperclangdfork'. So it would = be c++-ts-mode-find-higher-order-template-cxx-macroexpansion-definitions , never eglot-foo. In my proposal, for your example, if the major mode knows LSP is being used with 'superduperclangdfork' fetching xrefs _may_ be simplified using some existing eglot.el helpers to be externalized later. If LSP is not being used, the major mode uses whatever it knows to use from its backend. The commands _should_ be defined by using xref.el command-defining macros for a consistent interface to the command (or defun+xref-show-refs for a potentially less consistent one). Good grief, so many mails to answer and statements to address. I'll be back later with more but I just wanted to quickly correct this misperception. This is not what's being proposed, at least by me, and not by Spencer, I think. Eglot will only ever do LSP things so the eglot-find-{implemtation|declaration|typeDefinition} trio is all you'll find there, at least until LSP invents a fourth or a fifth. The major mode _may_ bind these as well of course. Maybe it may bind them in a xref-defined prefix map _along_ with -find-shiiz Anyway, hope to get back to this later. Jo=C3=A3o