haskell/haskell-mode

haskell mode doesn't use completion-at-point for tab

Esnos33 opened this issue · 1 comments

Hi, I want to use <tab> for auto completion. I have set (tab-always-indent 'complete) and in python-mode or elisp-mode <tab> is set to

completion-at-point is an interactive native-compiled Lisp function in
‘minibuffer.el’.

It is bound to C-M-i and <tab>.

But when I use <tab> in haskell-mode, its set to

TAB (translated from <tab>) runs the command indent-for-tab-command
(found in global-map), which is an interactive native-compiled Lisp
function in ‘indent.el’.

It is bound to TAB.

Do you know why haskell-mode doesn't use completion-at-point ?

When tab-always-indent is 'complete, then completion is only triggered if the indentation did not change.

Multiple indentation points are possible with Haskell — its syntax is indentation-defined, like that of Python. So in both major modes, TAB always changes the indentation, and never triggers completion. In other words, you can't have TAB magically do two things in such language modes.

The solution is to directly trigger completion, e.g. with C-M-i, or use something like corfu and enable auto-triggering of completion.