emacs-devel
[Top][All Lists]
Advanced

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

Re: Is intellisense features integration in Emacs technically possible?


From: Jorgen Schaefer
Subject: Re: Is intellisense features integration in Emacs technically possible?
Date: Fri, 24 Jan 2014 11:25:20 +0100

On Thu, 23 Jan 2014 20:40:36 -0500
Stefan Monnier <address@hidden> wrote:

> > I think there is currently no provision for the backend to return
> > annotation information or documentation that complements the actual
> > completions?
> 
> Yes and no.  The completion-at-point-functions can return any number
> of extra properties, and Company uses that to let the backend provide
> various extra info (see lisp-completion-at-point in a recent lisp.el
> for an example).  IOW you can provide as much extra info as is
> currently supported by Company.

Ok, that was what I was missing. Thank you. :-)

> `completion-at-point-functions' has 2 "call levels":
> - first level is: we call the functions on that hook to know if
> there's a completion and (if there is) what kind of completion it is
>   (boundaries, completion-table, properties, ...).
> - second level is: we call the completion-table to get the list
>   of candidates.
> 
> Doing the second level asynchronously means to rewrite
> partial-completion and friends in CPS.
> 
> But maybe we can get by with only doing the first asynchronously.
> IOW the first level could return an :async property which is a
> function which you call with a continuation.  That function will
> contact some external process and when it's ready it will call the
> continuation, passing it the real completion-table.  And of course,
> we'd need to make sure that non-async uses can also just wait for the
> process to return the completion data.

That sounds sensible. The asynchronous calls I use all return a list of
possible completion candidates and where they start, which is more
robust than auto-complete currently trying to identify the prefix with
Emacs Lisp code. This response can then be used to construct the
completion table without the need for any further asynchronous calls.

Even documentation right now is returned by the initial asynchronous
call and then cached for later use by auto-complete.el.

I'm not sure about "returns an :async property which is called with a
continuation". There does not seem to be a need to return a function
which is called to run another function? Just letting the Emacs code
know that we might add completions later and then calling some
well-known function with additional completions once they are available
would be sufficient I think?


Jorgen



reply via email to

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