From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alessandro Bertulli Newsgroups: gmane.emacs.help Subject: Re: Xref/tags/lsp possible bug Date: Mon, 25 Apr 2022 12:01:56 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15707"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: dgutov@yandex.ru Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 25 12:43:34 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1niwBq-0003u6-I1 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 25 Apr 2022 12:43:34 +0200 Original-Received: from localhost ([::1]:51684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1niwBp-0003gc-8P for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 25 Apr 2022 06:43:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nivXq-00040K-OR for help-gnu-emacs@gnu.org; Mon, 25 Apr 2022 06:02:14 -0400 Original-Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:36701) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nivXl-0000iB-Fp for help-gnu-emacs@gnu.org; Mon, 25 Apr 2022 06:02:14 -0400 Original-Received: by mail-lf1-x132.google.com with SMTP id bq30so25233919lfb.3 for ; Mon, 25 Apr 2022 03:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=oWjKUbDSPL+qRB5xz6VQb2h9FfhobGQnVGe6bl8M+rs=; b=m/+sP3/W4TG8We2/ppsS5uPu/BZ7FC7iuxXoRaREjTscs0kBv+TjomHadUgoxOLEoy mYJz97zX8tpum5fAcdLyxuimox1416S7NqMOwcjukjqRCL+Fo7EhntnN3YPvmJWytzGQ +LKLiNvanT7BJiWH236EDBMu/QDIZLBanlrMKqiCCMEb45nni4EQ0ytg6hLCBg8ZZzi4 uAnsLLlHSx3E8h/NSMX8m+3ax+iZRq5BsrvcUkoq8YapSOofefNTOvIyx3HQfd1nDfxL ar5y4B9M/gYq8MC/wGMqLG3yFlt/4hFeYMXFnpE68phrlQeL6Gyhb+EdgAro0HquzVf8 b8kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=oWjKUbDSPL+qRB5xz6VQb2h9FfhobGQnVGe6bl8M+rs=; b=p4c03SEVOsS9y4Su8P94RBahyjX0sAQiZ94udd29d935HEjAaHw+5sFX3vhnVCYYMT 4OUcweG5/lji8gJEtsXSxxpdJIfBAckw6jYQimmg5V7gWwQNga838hEVJu4xGxex/3PZ 1bt96EtjylId6bB0DiYbQeLPCPsY+6Vrawv8VTKKU+IIbKMJ4TfEqXGuFvKgw8Nttd4D UICLpjCh9GchLfdNdQMkDzjZ7SDwEw0ESasGFh5TFJGFWWfuzF8m4+ItdWKphFFLif3Z 0Kb/GaEEB6M2rzRv4YhzMSKuLXhdz2j2f0ns9iU3f0uUnt7IpL14y/MLfBG6/3JF0xLM +M2g== X-Gm-Message-State: AOAM532mGBYaXq5e7FRtvAnkLCSyZ3BmDae/p5sbRXDx23CfnbmRCq5L fubIyyk54SwHRKvXniQ8TPdDJQca4p3VWmyyZes= X-Google-Smtp-Source: ABdhPJybHxbIogY2m2zEqnhi5MwbhkdcjHll3xnzj1zFUwGlw9wOQIcZvHZmjiSjhv8aVnUO9tv5ZsgNT9KhMzhCKIA= X-Received: by 2002:ac2:5285:0:b0:471:afb7:e794 with SMTP id q5-20020ac25285000000b00471afb7e794mr12598852lfm.436.1650880927204; Mon, 25 Apr 2022 03:02:07 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=alessandro.bertulli96@gmail.com; helo=mail-lf1-x132.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=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-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:137020 Archived-At: Thanks Dmitry! > AFAIK it's a limitation of the LSP protocol: it's unable to perform > completion on all symbol names globally. Nor is it able, in general, to > find a symbol by name (it needs a location of an existing reference in > some file). So that affects how lsp-mode's Xref integration works (and > Eglot's). Indeed, you're right, I opened an issue on lsp-mode's GitHub and the maintainer (Ivan) kindly answered me. I report here its answer, in case it is useful to someone: "In lsp protocol, there is no convenient method to list the symbols. We do some hacks using document symbols to provide some handling when the method is invoked like that C-u M-x xref-find-definitions(or with (setq xref-prompt-for-identifier t)) but that is not really what the xref wants. This feature of xref is designed with tags in mind and it does not fit well with lsp protocol. Thus we have created lsp-find-* set of functions to make the difference between lsp and xref more evident." Okay, it's not a real problem, but I wonder why is it, though. I suppose LSP does have a sort of symbol table kept in memory, so I think it wouldn't be a big problem to allow the user to query it. I suppose it's something that can be added in a future specification. As a side note, reading your answer to Eli: yes, I got the hint it could be a problem of Xref, that's a part of why I asked here (being Xref a part of Emacs, or at least GNU Elpa). Anyway, thank you all for your support! Alessandro