Revert "Remove completion function"

This reverts commit f32f915ecfadf6fa0712224d8509e483c9c858c4.