Add support for tab-completion to haskell-interactive-mode #178

Closed
hvr opened this Issue Jul 7, 2013 · 5 comments

Comments

Projects
None yet
4 participants
Owner

hvr commented Jul 7, 2013

This is basically the same to #164 but for haskell-interactive-mode

@ghost ghost assigned hvr Jul 7, 2013

hvr added a commit that referenced this issue Jul 7, 2013

Add new `haskell-str` module
This module is going to replace `haskell-string` in the long run; it
features a slightly shorter namespace function prefix `haskell-str-*`
and tries to better follow Elisp coding conventions.

Most notably, this module provide functions for converting to/from
Haskell string literals, which sets up some of the infrastructure
needed for addressing #164 and #178.

hvr added a commit that referenced this issue Jul 7, 2013

Add support for `completion-at-point` to interactive-mode
This requires a `ghci` with the `:complete` command
(see http://ghc.haskell.org/trac/ghc/ticket/5687)

A GHCi based on GHC 7.6.x providing the `:complete` command can be
found at http://hackage.haskell.org/package/ghci-ng

This addresses #178
Owner

hvr commented Jul 26, 2013

Btw, here's a very crude attempt to provide an autocomplete source for auto-complete.el for use within Haskell source buffers:

(require 'auto-complete)

(ac-define-source haskell
  '((candidates
     . (lambda ()
         (let ((resp (haskell-process-get-repl-completions (haskell-process) ac-prefix)))
           (if (string= (car resp) "")
               (cdr resp)
             (mapcar (lambda (s) (car resp)) (cdr resp))))))))

(add-hook 'haskell-mode-hook '(lambda ()
        (add-to-list 'ac-sources 'ac-source-haskell))

This provides identifier completion based on current imports (assuming AC-mode is enabled)

Contributor

mijoharas commented Aug 1, 2014

hmm... I was wondering if you could help me. upon running this with ac-complete-haskell I get:

Symbol's Function definition is void: haskell-process-get-repl-completions

but when I look in my local copy of haskell-process.el I can see the function there.

In addition this person seems to have a working haskell autocompletion but searching the el recipes that he installs I can't figure out how it works. Any advice would be greatly appreciated

Contributor

mijoharas commented Aug 1, 2014

Ahh, figured out that I need to add (interactive-haskell-mode) to my emacs initialization, feel free to ignore this. Thanks.

@hvr hvr removed their assignment Mar 28, 2015

Contributor

geraldus commented May 21, 2015

@hvr there is one caveat: haskell-process-get-repl-completions uses sync request behind scenes hanging Emacs until REPL request will be received. This is very annoying side effect with big projects with template haskell, because reloading sources takes notable time. Can you say is it possible to provide completions for auto-complete asynchronously? I'm trying to find time to finish asynchronous completions for company-mode and it will be great if we could implement some unique asynchronous mechanism in haskell-interacive.el which could be easily adopted by both company-mode and auto-complete.

@gracjan gracjan removed this from the milestone Oct 16, 2015

Contributor

gracjan commented Aug 29, 2016

Looks like this is working.

@gracjan gracjan closed this Aug 29, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment