Re: [code] [textadept] New Code Autocompletion "Framework"

From: Richard Philips <>
Date: Tue, 27 May 2014 12:31:49 +0200

Hi Mitchell,

Is there a way that the possible completions can contain spaces?

In editing.lua, I see:

buffer:auto_c_show(len_entered, table.concat(list, ' '))

Would it be possible to use another character instead of ' '?


On Monday, May 26, 2014, Mitchell <> wrote:

> Hi,
> Adeptsense was an interesting experiment when it was first introduced in
> version 3.7 beta (early 2011). While providing a generic interface for
> autocompleting code in most languages, it was a fairly large framework, and
> made a number of compromises. Since then, in writing Adeptsenses, I find
> that I'm subclassing/redefining most Adeptsense functions, which is pretty
> much defeating the purpose of the framework. Also, the documentation
> heavily suggests providing a ctags-like "tags" file in order to auto-load
> completions. While Adeptsense can transform tags into completions quite
> well, generating such files (particularly by hand) is annoying at best.
> Finally, let's not kid ourselves -- Adeptsense is far from accurate on
> enough occasions to be obnoxious, especially when a trigger character
> unexpectedly pops up an inaccurate completion list.
> In an attempt to improve the situation, I've committed code[1] to hg that
> removes Adeptsense and adds a single, new `autocomplete()` function to the
> `textadept.editing` module. This function makes use of "autocompleter"
> functions in a new `textadept.editing.autocompleters` table. When an
> autocompleter function is called, it has complete control in determining a
> symbol's context and producing a set of potential (and hopefully more
> accurate) completions. Language modules will typically add a
> language-specific autocompleter function. Examples for ANSI C and Lua
> autocompleters are here[2] and here[3], respectively. I've also updated the
> CSS, HTML, Python, and reST modules to define autocompleter functions.
> There are no longer any trigger characters that automatically pop-up
> completions either. If you prefer such functionality, you can add your own
> `events.CHAR_ADDED` handler to do it for a specific lexer(s). If you have
> custom key bindings that called on Adeptsense, please update your bindings.
> An example is here[4].
> In particular, I hope these changes enable one to more easily add
> autocompletion support for other languages (1 simple function that
> leverages ta's existing API vs. learning the Adeptsense framework...).
> I've placed the legacy Adeptsense code and language modules that used it
> on the wiki[5] for anyone who'd like to keep using it. However, please note
> they will no longer be maintained.
> All of this should be available starting in tonight's nightly, assuming it
> builds properly with some of the other changes I committed.
> Any feedback is welcome. If I'm making a horrible mistake, I'd like to
> hear that too.
> Cheers,
> Mitchell
> [1]:
> [2]:
> modules/ansi_c/init.lua
> [3]:
> modules/lua/init.lua
> [4]:
> modules/textadept/keys.lua
> [5]:
> --
> You are subscribed to
> To change subscription settings, send an e-mail to
> To unsubscribe, send an e-mail to

You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
Received on Tue 27 May 2014 - 06:31:49 EDT

This archive was generated by hypermail 2.2.0 : Tue 27 May 2014 - 06:40:15 EDT