all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alessandro Bertulli <alessandro.bertulli96@gmail.com>
To: dgutov@yandex.ru
Cc: help-gnu-emacs@gnu.org
Subject: Re: Xref/tags/lsp possible bug
Date: Mon, 25 Apr 2022 12:01:56 +0200	[thread overview]
Message-ID: <CAJczNmDcg-woUxwwY9aFY_z6Lx56pe9w5KLncozEhSJXxW2bAw@mail.gmail.com> (raw)

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


             reply	other threads:[~2022-04-25 10:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-25 10:01 Alessandro Bertulli [this message]
2022-04-25 20:05 ` Xref/tags/lsp possible bug Stefan Monnier via Users list for the GNU Emacs text editor
2022-04-25 20:29   ` Dmitry Gutov
2022-04-25 21:48     ` Stefan Monnier
2022-04-26  1:41       ` Dmitry Gutov
  -- strict thread matches above, loose matches on Subject: below --
2022-04-23 15:28 Alessandro Bertulli
2022-04-23 12:17 Alessandro Bertulli
2022-04-23 12:52 ` Eli Zaretskii
2022-04-24 23:06   ` Dmitry Gutov
2022-04-25  1:32 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJczNmDcg-woUxwwY9aFY_z6Lx56pe9w5KLncozEhSJXxW2bAw@mail.gmail.com \
    --to=alessandro.bertulli96@gmail.com \
    --cc=dgutov@yandex.ru \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.