[Top][All Lists]

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

Re: Completions in Semantic

From: Eric M. Ludlam
Subject: Re: Completions in Semantic
Date: Wed, 21 Oct 2009 08:35:29 -0400

On Wed, 2009-10-21 at 12:58 +0200, Lluis wrote:
> Just as a side-note, now that you've raised the topic of a completion 
> interface.
> I don't know about the features of current code, but I miss some features on
> some (if not all) the completion interfaces I've tested. So here's a list of
> (my) desired features (all of which should be configurable by the user):
> - symbol name
>   Of course, this is what already provides every completion UI
> - extra information
>   This can be filled ub with symbol "metadata". Which metadata appears on the
>   completion UI should be configurable by the user:
>     - return type
>     - arguments (type and/or name)
>     - definition location (aka file)
>     - short documentation
>     - long documentation
>   All this metadata should be located anywhere around the symbol name and/or 
> the
>   minibuffer (e.g., I think company-mode shows short documentation on
>   minibuffer, until user presses F1, when full documentation is shown.
>   Some metadata might be shown in the minibuffer after completion selection
>   (e.g., prototype).
> - result narrowing
>   A-la company-mode.
> - argument placeholders
>   So that argument type and/or name is shown as placeholders, such that the 
> user
>   simply TABs (or whatever) to fill-in the blanks.

Hi Lluis,

Just as an FYI about the semantic tag info (which you seem to be
alluding to), is that it provides all that info, though not necessarily
from the completion engine via a UI.

The internal tag table format of semantic includes data type info,
argument lists, positional info, and the doc is available.  You can also
pass a semantic native tag table directly into 'try-completions' or any
other completion prompt in Emacs.

The completion engine in Semantic also takes advantage of this and
allows ways to focus on a tag based on it's positional information, or
distinguish based on arg list or some such.  Since it uses a code
analyzer, you tend not to need too much in the way of narrowing of scope
since it knows what symbols don't fit in a particular context, so it
doesn't provide them as completions.

If core emacs completion prompts were to select some metadata based
approach to completion tables, the Semantic tag format is pretty simple,
and could provide what is needed.  A tag table is a list, with each
element formated like this:


Where attributes and properties are plists, and POSITION is an optional
element which could be either an overlay, or a vector of two numbers.
Attributes are features of whatever the tag is, such as arg lists, or
datatype.  Properties are features of the tag itself, like the filename
it is in, or other data needed to maintain the tag, like parser
information.  Of course there may not be a use case for this outside of
tag data, so perhaps it is a moot point.


reply via email to

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