tonylukasavage / triple

REPL for Titanium
MIT License
96 stars 21 forks source link

Titanium namespace completion doesn't work in statements #32

Closed tonylukasavage closed 10 years ago

tonylukasavage commented 10 years ago

As noted in detail here, Titanium namespace auto-complete only works when the Titanium namespace is the first and only thing at the prompt. For example:

$ triple

//  hitting tab will get you auto-complete list
> Ti.UI.cre

// hitting tab will get you nothing
> var win = Ti.UI.crea

We need to do some basic parsing on the given input to extract the current part of the expression to which we should be applying auto-completion. Lots of hints to be gleaned from node.js's own repl lib, specifically the section that uses simpleExpressionRE.

jhaynie commented 10 years ago

we should be able to lift some of their code just glancing at it.

tonylukasavage commented 10 years ago

Yeah, I had some of this done already, but I'll piggyback off the work you did so far. It's really just a matter of finding the last expression in the statement an executing the auto-complete from there.