[Haskell-cafe] Code-completion problem with emacs, ghc-mod and auto-complete

Илья Бирюков iu.biryukov at gmail.com
Sun Jan 18 17:40:35 UTC 2015


Thanks for pointing me to company-ghc. I've installed it and it works great!

--
Regards, Ilya Biryukov.

On 18 January 2015 at 00:16, Anthony Cowley <acowley at seas.upenn.edu> wrote:

>
> > On Jan 17, 2015, at 8:19 AM, Илья Бирюков <iu.biryukov at gmail.com> wrote:
> >
> > Hi, Cafe!
> >
> > I'm struggling to configure my emacs for haskell development with
> ghc-mod and auto-complete. It works well for the most part, but I've run
> into the issue when completing qualified names. In the following example I
> don't get any completion after BS:
> >
> >         module Playground where
> >
> >         import qualified Data.ByteString.Lazy as BL
> >
> >         doWork :: BL.By -- no completion after dot
> >
> > Completion for unqualified names and module name in imports works just
> fine.
> > Maybe someone has run into this issue before?
> >
>
> Completion after the dot is provided by company-ghc, so you'd want to
> setup company rather than autocomplete.
>
> Anthony
>
>
> > My .emacs:
> >       (ac-config-default)
> >       (auto-complete-mode t)
> >
> >       (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation)
> >
> >       (autoload 'ghc-init "ghc" nil t)
> >       (add-hook 'haskell-mode-hook (lambda () (ghc-init)))
> >
> >       (defun my-ac-haskell-mode ()
> >         (setq ac-sources (append ac-sources '(ac-source-ghc-mod))))
> >
> >       (add-hook 'haskell-mode-hook 'my-ac-haskell-mode)
> >       (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode)
> >       (add-hook 'haskell-mode-hook 'turn-on-haskell-indent)
> >
> >       (ac-define-source ghc-mod
> >         '((depends ghc)
> >           (candidates . ghc-select-completion-symbol)
> >           (symbol . "s")
> >           (cache)))
> >
> > --
> > Regards, Ilya Biryukov.
> > _______________________________________________
> > Haskell-Cafe mailing list
> > Haskell-Cafe at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20150118/3c0b73ed/attachment.html>


More information about the Haskell-Cafe mailing list