I have added TemplateCompletions to KojoLite with pretty good success. The only areas I am having issues are:
(1) Templates with multiple parameters.
Kojo has an arc command. The template for this is:
arc(${radius}, ${angle})
So I type in 'a', hit Ctrl+Space, see arc in the completion drop down, select it, and hit Enter. The template shows great, with boxes around the radius and angle slots. The cursor is on the radius slot. I type in a number - and this goes into the radius slot. But now the angle slot loses its box. I can't tab into it to enter a number for the angle parameter.
Is this an issue with multiple parameter templates?
(2) Templates with no parameters
I have certain templates with no parameters, e.g:
animate {
${cursor}
}
These currently don't work for me, (I think) because I have not specified the correct paramterListStart and paramterListEnd strings for my TemplateCompletions. What I did instead was to comment out the block of code that handles the zero parameter case (AutoComplete.java, line 991)
// if (pc.getParamCount()==0) {
Now things work great, except that I have to hit enter (or tab) once to get to the cursor slot. Is there any way that I can have the cursor show up in the right place without having to hit enter/tab?
Also, what would it take to relax the check above (AutoComplete.java, line 991), for official inclusion in AutoComplete, to do something like:
if (param count is zero and not (pc is a template completion and pc has a ${cursor} piece))
Note - all my zero parameter templates have a ${cursor}, as I suspect most zero parameter templates will.
PS. If needed, I can (a) check in my current (Scala) code that does code-completion and send out a link to the source within the KojoLite project on googlecode, and (b) upload the compiled code to the KojoLite Webstart app so that its available 'live' to play with.
Thanks,
- Lalit
::
Lalit Pant
Creator and Lead Dev,
The Kojo Project (http://www.kogics.net/kojo)
