GNU bug report logs - #29619
Fwd: [xref.el] Add `xref-find-references` to `xref-prompt-for-identifier`

Previous Next

Package: emacs;

Reported by: Ray <emacsray <at> gmail.com>

Date: Fri, 8 Dec 2017 21:55:01 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 29619 <at> debbugs.gnu.org (full text, mbox):

From: Ray <emacsray <at> gmail.com>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 29619 <at> debbugs.gnu.org
Subject: Re: bug#29619: Fwd: [xref.el] Add `xref-find-references` to
 `xref-prompt-for-identifier`
Date: Sat, 9 Dec 2017 09:52:00 -0800
Thanks for being open to change the default if more people feel the same.

With the xref system people use drifting from tag based
(ctags,etags,GNU GLOBAL,cscope,...) tools to Language Server Protocol
(cquery, rls, ...),
a single identifier without position has become insufficient to
describe the one the user wants to look up. For example, a local
variable/struct/lambda `foo` may exist
in different functions.

I'm using a C++ language server called cquery. This is what I get (for
the argument `identifier`) when I hit the key bound to
`xref-find-definitions`:

#("QueryDatabase" 0 13 (fontified t ref-params (:textDocument (:uri
"file:///home/maskray/Dev/Util/cquery/src/query_utils.h") :position
(:line 11 :character 54) :context (:includeDeclaration :json-false))
def-params (:textDocument (:uri
"file:///home/maskray/Dev/Util/cquery/src/query_utils.h") :position
(:line 11 :character 54))))

Here the text properties are more useful than the identifier itself,
because LSP uses position instead of identifier to sending requests to
the language server.
https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#textdocumentpositionparams


This is my 2 cents. I am totally fine to live with the current default
`xref-prompt-for-identifier` because I can customize it.

On Sat, Dec 9, 2017 at 7:25 AM, Dmitry Gutov <dgutov <at> yandex.ru> wrote:
> On 12/8/17 11:27 PM, Ray wrote:
>>
>> Currently, xref-find-references prompts for the identifier to look up,
>> because it is not listed in xref-prompt-for-identifier:
>>
>> (defcustom xref-prompt-for-identifier '(not xref-find-definitions
>>
>> xref-find-definitions-other-window
>>
>> xref-find-definitions-other-frame)
>>
>> It will be much core convenient to add xref-find-references in the list.
>
>
> We've discussed it before, and for now have settled on this list of
> non-prompting functions.
>
> But thank you for your report. We may change the default if more people feel
> the same.




This bug report was last modified 5 years and 300 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.