Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-completion doesn't work right in new build #787

Closed
mathlover2 opened this issue Jul 30, 2015 · 5 comments
Closed

Auto-completion doesn't work right in new build #787

mathlover2 opened this issue Jul 30, 2015 · 5 comments

Comments

@mathlover2
Copy link

I just got the new version of haskell-mode. The auto-complete function does not seem to work now.

Say one wants to write "sequence" and has written "sequ". Auto-completion now yields "sequsequence" instead of "sequence".

@geraldus
Copy link
Contributor

Oh, that's very sad. Do you have some special package for haskell-mode or just plain auto-complete? I've pushed some changes related to completions stuff recently, but it does not affected the format of result, there were just improvements of the way completions are collected. I'm using company-mode personally and have no much time to test auto-complete separately. Can you help with this?

@mathlover2
Copy link
Author

I checked the haskell-completions.el file, and nothing seems to be wrong when I invoke its functions in Emacs when in Haskell mode. As this is the file which you had changes merge into, I don't think the problem is there.

@joehillen
Copy link

I've had this happen with company-mode. I haven't been able to make it happen consistently. I'll take a screenshot next time it does.

@vwyu
Copy link
Contributor

vwyu commented Aug 10, 2015

I don't use company-mode or any other auto completion modes. Here is what I get by typing some import expressions after λ> and pressing tab:

  1. Pressing tab after "import Co" makes it "import CoCo".
  2. Pressing tab after "import Con" makes it "import ConControl."

It looks like part of the string is repeated. I would expect the following behavior:

Expected 1) Pressing tab after "import Co" shouldn't change it.
Expected 2) Pressing tab after "import Con" should make it "import Control."

It looks like this issue might be related to removal of the unused string (h1) from completions (cs) in haskell-process-get-repl-completions function of haskell-process.el (related commit: f0466a2). Adding the unused string (h1) to the completion list (cs) solves this issue for me. But I am not sure if this change breaks something else instead.

(let ((cnt1 (match-string 1 h0))
              (h1 (haskell-string-literal-decode (match-string 3 h0))))
          (unless (= (string-to-number cnt1) (length cs))
            (error "Lengths inconsistent in `:complete' reponse"))
          (cons h1 cs)))

@gracjan
Copy link
Contributor

gracjan commented Sep 2, 2015

This seems to be fixed by #810.

@gracjan gracjan closed this as completed Sep 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants