A different take on code completion

I came up with this suggestion in a different thread, but I thought I would make this request here formally.

I would like to propose an additional form of code completion:

  • A new button would be added to the bar above he keyboard
  • When pressed a window would open on the screen with buttons listing all the different functional groups of APIs (drawing, physics, etc)
  • When one of those is selected all the functions in that group will be listed
  • When of those is selected then that API is inserted into the current file at the caret location.

As all know using the on-screen keyboard is less than ideal. Codea’s existing code completion is very good, but something like this solution would allow people to code even faster. Every single Codea API would be no more than three presses away (one to press the button on the keyboard, one to select the group, one to select the API), regardless of the length of the command, namespace, etc.

Back in the 80s I did some work on a Modula-2 based workstation that had an editor that did something like that. You would hit ESC and a menu would pop up of all the modules in your app with a number next to them. Once you pressed the corresponding number, the menu would be replaced with the entry points in that module. Once you got the hang of it it, it was very efficient.

Obviously you would need to prototype this and see if it works as well as imagined, but I think it would be worth it to try.

I second this and would add one thing: code coloring for Codea api stuff that is exposed in the global namespace. This would make the code much easier to read IMHO.

@Vega, ah yeah that would be nice!

I will note that once you have something like I described it could also insert control structures and code templates. So function() … end, if … then … else … end, for k,v in pairs(…) do … end, etc would also be trivial to enter.

That would be great.