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, 6 Mar 2023 15:23:59 +0200 Message-ID: <253cdcdd-863e-e8e3-a783-62ce1c570cfb@yandex.ru> References: <1587ddb6-f631-0890-965a-c7acb5729fa6@yandex.ru> <87r0u2ax26.fsf@betli.tmit.bme.hu> 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="4976"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Cc: John Yates , Helmut Eller , emacs-devel To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , Felician Nemeth Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 06 14:24:41 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 1pZApV-000191-GY for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Mar 2023 14:24:41 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZAp2-0004EI-HO; Mon, 06 Mar 2023 08:24:12 -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 1pZAoz-00044M-0P for emacs-devel@gnu.org; Mon, 06 Mar 2023 08:24:09 -0500 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZAow-0005yZ-I6 for emacs-devel@gnu.org; Mon, 06 Mar 2023 08:24:08 -0500 Original-Received: by mail-wr1-x42d.google.com with SMTP id h14so8801389wru.4 for ; Mon, 06 Mar 2023 05:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678109041; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=LjvFWJFAs7MV00dPRL5tNbowJikQbAbaGdRJbcFgMNw=; b=Qy83x+gtIFMxWuK/Nm0Nk3mLyLDkobt32Hl2QrGjGHUYQp0qSU6mqjv2ogYmLXMjSo uUk8QUNtfLyfZzL6fpkCofE8Krkxslekj2hU/FNfInrKQKF9hNa0ouGJHJILmYFCoIPj 8//m8P+vwDjHNILFT/oPlIJXRaw3JSyfglFwSqAvnD2bCVjdE9sQKAc0Ib1bhoC/kTpw WtRiDysVOzQxFgsu5iqTooqlydsEOAxNW858AoL9YBRKjcsFTMMtfr8FG+37yqTcNdD2 cm6J5wWEoqLvHzJBkBaNsw7sxP3WWqFAK5hNZdctUWbI4B3KRm4mTh/toUSPk2G7pMpV zhtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678109041; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LjvFWJFAs7MV00dPRL5tNbowJikQbAbaGdRJbcFgMNw=; b=cXFyT6mWjIIRkhCV3bQwCBxvMABB2Zex+pOEturI3eXNMGS9QgDOBeTbifXD4kLCkC De8nOu+De3mqNQGwXF6VL+zmdT/TsIKwTkwQQnbI4cJ3O9UR+X78m1/R0ao2owTz/W19 +zHEZ6ELJrBVw0bTSq0PxjkYb7+MV7vOA3NJdp0lAs+2Syt7Q314w0Di5gMGNfj6N26i naopy7K5n0V17+mrsBsUsSUzPNjCGl9lfowUoWRTe3v4lrnptIl0VaD1vGw8/y+wTGS/ OtIkkbcBof4bmG74Q44rDbFIcPIzpBQGKlrjj91vk0dqJbK1QSBYFKgBw02f1NMTuUEE 5Zrw== X-Gm-Message-State: AO0yUKV3h3iz+Jfw+lA3RPSI65UN7uENv8eiDZWXKlgzqLUQa7aLXA+p qpC6CDYei1CYe+JyTIeDtHA= X-Google-Smtp-Source: AK7set8Q2oASr99ZOYz4f9HSJkqnEOy5kXA8Fue7P/oOfpTNQkDq82+8A7jGx80/vil4VipiHEWmhA== X-Received: by 2002:a5d:6611:0:b0:2bf:d0a4:3e63 with SMTP id n17-20020a5d6611000000b002bfd0a43e63mr7725702wru.44.1678109041672; Mon, 06 Mar 2023 05:24:01 -0800 (PST) Original-Received: from [192.168.0.2] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id v11-20020a5d610b000000b002c5a790e959sm9884516wrt.19.2023.03.06.05.24.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Mar 2023 05:24:01 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:304042 Archived-At: On 06/03/2023 15:15, João Távora wrote: > On Mon, Mar 6, 2023 at 12:23 PM Felician Nemeth > wrote: >> Can you, please, consider adding more than just one new xref command? >> The Language Server Protocol defines jump-to-declaration, >> jump-to-implementation, and jump-to-typeDefinition commands as well. >> >> ---- >> >> I can image a new xref-find-extra command that provides a >> `tmm-menubar'-like single key selection for the specific jump type. The >> list of jump-types could be filled up by Eglot or major-modes (ada-mode >> would add "specifications", ocaml-mode would add "interface"). If C-M-? >> is bound to this new xref-find-extra, then "C-M-? i" would jump to the >> interface definition in ada-mode, and "C-M-? d" would ask the LSP server >> for declarations in case of Eglot. >> >> (Users who find "C-M-?" awkward can rebind xref-find-extra to "s-.") >> >> What do you think? > To me, the "find extra" trampoline idea sounds nice too. It doesn't > suffer from the drawback of adding "interface", "implementation", > "typeDefinition", "superSpecificLanguageConstruct" concepts to xref.el > in poorly-scalable fashion. Could Eglot dynamically report on which of these operations are supported in the current buffer?