iquiw / company-ghc

Company-mode completion back-end for haskell-mode via ghc-mod
125 stars 6 forks source link

company-ghc-turn-on-autoscan not detected #15

Closed vlatkoB closed 9 years ago

vlatkoB commented 9 years ago

Hi, company-ghc-diagnose shows no items when invoked first and suggests:

* company-ghc backend found: company-ghc
* automatic scan module is disabled.
  You need to run either 'M-x company-ghc-turn-on-autoscan' once
  or 'M-x company-ghc-scan-modules' when it is necessary.
* ghc-boot process has been done

However, :f1 v company-ghc-autoscan gives:

company-ghc-autoscan is a variable defined in `company-ghc.el'.
Its value is t

After manually invoking company-ghc-scan-modules, company-ghc-diagnose shows found modules and candidates.

Emacs 24.5.1 on Arch, current company-ghc from gitHub

br, vlatko

iquiw commented 9 years ago

Can you check the value of after-save-hook?

vlatkoB commented 9 years ago

Thanks for the tip. That seems to be the problem. I'm using ECB and when active, it changes after-save-hook. I'll look into it later and report. It worked before, so must be something I changed recently.

vlatkoB commented 9 years ago

Couldn't find the real problem, so I made a workaround by adding

(defun company-ghc-autoscanning ()
    (company-ghc-scan-modules)
    (company-ghc-turn-on-autoscan))

to haskell-mode-hook, so diagnose shows candidates even before first save.

In your opinion, is there something that conflicts with this approach?

iquiw commented 9 years ago

Maybe, company-ghc's init command does not run for some reason.

I don't see any problem on the custom hook approach.