By default, Godot's autocomplete feature replaces the code when you press enter.
You can press shift + enter to insert the suggestion instead.
You can edit both shortcut in Editor > Editor settings > Shortcuts,
look for "ui_text_completion_replace" and "ui_text_completion_accept".