iquiw / company-ghc

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

haskell-interacative-mode conflicts with company-mode #4

Closed bixuanzju closed 10 years ago

bixuanzju commented 10 years ago

I am not sure if I should raise this issue somewhere else, but company-mode seems to conflict with haskell-interactive-mode.

To reproduce:

  1. (setq debug-on-error t)
  2. First enter haskell-mode, type something, company is working fine
  3. Then run command haskell-process-load-or-reload, and enter haskell-interactive-mode
  4. Back to haskell-mode, in the beginning of line ,type something, debugger window pops out.

The abridged error message in my case is below:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil) haskell-interactive-at-prompt() haskell-interactive-mode-completion-at-point-function() completion--capf-wrapper(haskell-interactive-mode-completion-at-point-function optimist) run-hook-wrapped(completion--capf-wrapper haskell-interactive-mode-completion-at-point-function optimist) company--capf-data() company-capf(prefix)

[0 "\n\203 ...

company--begin-new() company--perform()

[0 "\300 \207" [company--perform] 1 "\n\n(fn)"]()

funcall(#[0 "\300 \207" [company--perform] 1 "\n\n(fn)"]) company-auto-begin() company-idle-begin(# #<window 3 on Main.hs> 2490 3405) apply(company-idle-begin (# #<window 3 on Main.hs> 2490 3405)) byte-code("r\301\302H\303H\"\210)\301\207" [timer apply 5 6] 4) timer-event-handler([t 21441 4252 273797 nil company-idle-begin (# #<window 3 on Main.hs> 2490 3405) nil 0]) read-event(nil t 3) sit-for(3) flyspell-check-word-p() byte-code("\306 ... flyspell-post-command-hook()

iquiw commented 10 years ago

I think this is not a problem of company-mode since the same problem can happen without company-mode. Instead of auto completion by company-mode, manually executing M-x completion-at-point causes it.

bixuanzju commented 10 years ago

@iquiw So it has something to do with haskell-mode?

iquiw commented 10 years ago

So it has something to do with haskell-mode?

I think so, but am not perfectly sure.

iquiw commented 10 years ago

I've sent a pull request to haskell-mode. https://github.com/haskell/haskell-mode/pull/307

bixuanzju commented 10 years ago

Thank you!