I think its worth forwarding a cautionary snippet from Rocky that
makes a lot of sense:
On 2/4/07, R. Bernstein
The caveat though in all of these cases is that it can be difficult to get exactly what the valid completions are. For example if you know you need an number, do you really want to complete on all objects that are a numeric type plus the digits 0-9, "+", "-", and "("? And also throw in functions which return a number? So in general, I think one has to back off a bit. And there are two ways to back off: one is allowing more possible completions (e.g. any object) and another by allowing less. I've been offering less. But I think really it's dictated by what "feels" right which will no doubt be different for different people. "Feeling right" could also be determined by how long completion takes is which may vary in different situations on different computers.
Handling command completion feels more like engineering than art or science.