Unfortunately the default Prolog mode of GNU Emacs is not very good. There are several alternatives though:
dap-mode
debug_adapter