[textadept] Experimental Lua module

From: mitchell <c....at.caladbolg.net>
Date: Tue, 10 Aug 2010 23:48:55 -0400 (EDT)


I've been experimenting with a new Lua module. Currently t supports
dynamically generated autocompletion for the ta and Lua APIs with
on-demand calltips.

For example:

   Typing 'buffer' followed by '.' brings up all buffer fields.
   Typing 'buffer' followed by ':' brings up all buffer functions.
   Typing 'gui' followed by '.' brings up all gui fields and functions.

You can also use Ctrl+Enter to popup a completion list like you would with
editing.lua's word autocompletion.

Typing 'buffer:' and selecting 'add_text' and typing '(' followed by a tab
key shows a calltip with function information. In fact, when the caret is
just inside the function call of any ta or Lua function, a calltip is
shown when Tab is pressed. e.g. buffer:function(<tab>

The cool thing is that none of the ta API and calltips is hardcoded in
files. They are parsed from the LuaDoc. (Lua API has separate files in the
lua/api/ directory). And it's FAST. I don't notice any processing time to
parse out the API from luadoc.

The catch is you'll have to put the attached lua module in your _HOME
directory for now. Or you can change some occurances of _HOME to _USERHOME
(but not all) and put it in your user modules directory. I still need to
polish it up, but the functionality is there.

Also, it is necessary to have the new keys.lua I committed to hg (and
posted to the list about) in order to have transitions between Lua
autocomplete and word autocomplete (from editing.lua)

Zip attached.


Received on Tue 10 Aug 2010 - 23:48:55 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:50:50 EST