I spent some time last Friday writing some C to expose that function, and in the process discovered that libedit either doesn't have the function or at least has a sufficiently different implementation that my code wouldn't build against it.

Writing a parser wouldn't solve the problem of Readline/libedit only replacing the portion it has determined is being completed. We could stop using the built in tab completion entirely, but we'd lose some support for various `inputrc` settings.