Add button to autocomplete options

I am modifying the autocomplete so that when you type an option that does not exist, the autocomplete widget will show a “Add new parameter” button to create a new parameter. What would be the best way to implement this? I have tried updating the apply property of the completion which works well to create the new parameter, but I am having trouble getting the button to show up in the list of completions. It shows up when “add” or “new” or “parameter” shows up in the string but otherwise will disappear. Is there a way to make sure the “Add new parameter” button shows up even if it doesn’t match the current token?

No, this isn’t something that the autocomplete package provides support for.