Closed jhaynie closed 10 years ago
The sdk find, read, and load into namespaces looks great, exactly how I was planning to do it given Titanium's limitations. It would have been very slick to do it like I wanted to originally, by eval
ing the last part of the expression and returning the properties of it back to the REPL (would work for anything then, not just Titanium objects), but that wouldn't work for Ti namespaces or proxies since you can't read there properties or functions like normal JS objects. And with that I continue to long for Ti.Next...
There is a problem with the completer though. A minor one where it dumps all possible matches whenever it doesn't find a match. This seems like an odd UX. I'm going to change it to only do that if the line is empty.
The real problem is that the completion only works when the Titanium namespace is the first and only thing in the line. For example, you get no help typing this and then a tab:
$ triple
> var win = Ti.UI.create
It only works if Ti.UI.create
was at the beginning of the line. There's some good code in node.js's own REPL server that handles this. It's a bit more complex than we need, but I think the relevant regexs can be lifted and used to better identify where this auto-complete can occur anywhere in the statement.
I merged this in and created #32 to address the shortcoming in auto-completion. Thanks again.
read api.jsca to perform tab completion for Ti api.