[Top][All Lists]

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

Re: Is intellisense features integration in Emacs technically possible?

From: Stefan Monnier
Subject: Re: Is intellisense features integration in Emacs technically possible?
Date: Thu, 23 Jan 2014 20:40:36 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

> 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.

>> But returning completion candidates asynchronously is not compatible
>> with the current all-completions/try-completion API, so we'd need
>> a fairly serious rework of minibuffer.el.
> Do you think reworking minibuffer.el to support both types of calls
> with a unified interface (for example with the possibility to block
> until the asynchronous call returns if we need the completions "right
> now") would be the right thing?

Could be.  I haven't thought enough about it to know.  The problematic
part that immediately springs to mind is things like partial-completion
which make various calls to the backend to construct the "list of
candidates".  This would need to be rewritten in a "continuation passing
style" (or event-driven style, if you prefer), I guess, but that'd be
rather inconvenient.

> Alternatively, a separate in-buffer completion behavior akin to or
> based on auto-complete.el might make more sense?

Not sure what that would look like.

`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.


reply via email to

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