About input assistant mechanism

6 views
Skip to first unread message

limodou

unread,
Aug 31, 2006, 9:40:07 PM8/31/06
to uli...@googlegroups.com
Now I'm moving autoComplete to InputAssistant, and I hope the
InputAssistant will be a complete mechanism, so if I finished, you can
custom more input assistant in acp files. The totally list is here:

1) based on string match input assistant

include replacement and append, for example:

replacement style:

[autostring]
def<space> = def !^():\n\t

append style:

[autostring_append]
def<space> = !^():\n\t

2) based on regular expression match input assistant

also include replacement and append, for example:

replacement style:

[autore]
(^\s*)if<space> = \1if !^:\n\t

append style:

[autore_append]
from\s+([\w.]+)\s+import(.*)<space> = @acp.python.import.fromimport
if\s+__name__<space> = == '__main__'

3) the match value could be string, list, or even a function

string:

[autostring]
def<space> = def !^():\n\t

list:

[autostring_append]
< = a,blockquote,br,body,center,

function:

[autore_append]
from\s+([\w.]+)\s+import(.*)<space> = @acp.python.import.fromimport

if the match value is a list, UliPad will popup a list enable you to
choice from them, and the function can return four format output:

'append', string
'append', list
'replace', string
'replace', list

it works just like above.

4) default auto identifier input assistant

if you define like this in acp file:

[auto_default]
1 = @acp.python.import.default_identifier
2 = a,b,c,

so if there are not matches will be applied, this mechanism will be
effected. And UliPad will calculate all the result according the
vaules of auto_default section(the key is not used), and combine them
into one list, so you can select a match string from the popup list.
As you see, there are could be more than one entry in auto_default
section, and the value could be a function or a list.

5) function calltip (developing)

Just as you type '(' then will find a function defination match, and
popup a calltip window to help you know the info about this function.
This functionality is in developing now, I hope user could define a
import file, just like:

def functionA(a,b,c):
"""docstring"""
pass

so UliPad could deal with them just like import python modules. then
as you type ')', the popup windows will be hidden.

This mechanism will be defined as:

[auto_complete]
calltip = @acp.python.import.calltip

So you see, it should be a function.

6) auto dot extend input assistant

should be define in auto_complete section also, just like:

[auto_complete]
autodot = @acp.python.import.autodot

This functionality is also in developing now. And as you type a '.',
UliPad will call the autodot function to get a list, and let you
choose from it.

7) auto background analysis mechanism

This mechanism is mainly used for defaullt auto identifier input
assistant, because except for reversed words and bulitin functions or
methods, there are also locale identifier in current document, so how
to get them from current document and combine them for input
assistant, and I think there should be a syntax analyser for that, so
this mechanism is designed for that. And the processing will be
executed in threading. This functionality is also in developing.

8) aoto assign input assistant to file type

As you see, many acp files are named according to a certain language,
right, if you open a certain file type, just like python, the
python.acp will be auto assigned to it.

9) manually assign input assistant to an opened document

You can also manully assign a acp file to an opened document, so the
document will multi acp files at a time.

10) A main acp file could include sub acp file

If you define such string in a acp file:

[include]
1=django_py.acp

This will indicate that, as importing this acp file , also need to
import the acp files which dedefine in include section. And let us
look at django_py.acp:

[default]
projectname = django

You can see that there is a default section in django_py.acp file, if
the content of it is empty, so django_py.acp will be available for
each python file. But if you defined a projectname entry, only when
you are work at a "django" project, this acp file could be available.
And the projectname could be a list, just like:

django,python,

So this funcationality is also concerned with simple project
management in UliPad you know.

So there are many things converned with input assistant, and you can
use it to well support a framework or something else, it'll speed up
you developing efficiency I hope.

--
I like python!
My Blog: http://www.donews.net/limodou
UliPad Site: http://wiki.woodpecker.org.cn/moin/UliPad
UliPad Maillist: http://groups.google.com/group/ulipad

Reply all
Reply to author
Forward
0 new messages