[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generalizing find-definition

From: Stephen Leake
Subject: Re: Generalizing find-definition
Date: Thu, 11 Dec 2014 19:29:26 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.94 (windows-nt)

Stefan Monnier <address@hidden> writes:

> - identifier-at-point should document more clearly that the return value
>   may be something else than a string.  AFAIK the only interesting
>   non-string non-nil case is to return a special value (e.g. a marker
>   or just `t' to stand to (point)) which stands for "let the
>   find-definitions code figure out the identifier at that place".

In ada-mode, identifier is a class derived from xref-file-location:

(defclass xref-ada-identifier (xref-file-location)
  ((id :type string :initarg :identifier)))

This is because identifiers in Ada are overloaded, and are often just
the last part of the fully qualified namespace name. The backend uses
the cross-reference information output by the compiler; the compiler
does the name resolution.

If identifier is restricted to just the string, ada-mode needs a
guarantee that xref-find-definitions will be called with current-buffer
the same as the buffer containing the string, and point in the same
place, so the backend can determine the file, line, column. That seems

-- Stephe

reply via email to

[Prev in Thread] Current Thread [Next in Thread]