Closed domdere closed 3 years ago
Ok, I've noticed that the backends (company-ghc
and company-yasnippet
) arent active until the next haskell source file loads, and whenever i switch back to the buffer for the first source file opened, the backends are still not active for that buffer...
(I've updated the reproduction steps)
Sorry for the silence. I'll take a look on this issue very soon.
As per point 7. You can just revisit the same file to make it working again.
So yeah, this is funny. Company is not properly set on first visit of hs file in project / session.
Same issue happening here, also the part where company-ghci
and company-yasnippet
are only loaded after next haskell source file is loaded.
Same issue here.
I think this happens because spacemacs-haskell//setup-completion-backend, the function that populates company-backends-haskell-mode
, is called by the local-vars hook, which is called after the functions that populate the company backends so the haskell backends are not included there. This gets fixed when the next haskell file is opened, since company-backends-haskell-mode
is populated already.
Moving the call to setup-completion-backend to haskell/post-init-company
[0], where the docs say it should be, works for ghci, but not when the completion backend is ghc-mod, because ghc-init is not available yet [1]:
An error occurred while post-configuring company in layer haskell (error: (void-function ghc-init))
I haven't checked with intero.
It seems to me that the way to fix this is by doing [0].
Fixing [1] should be done by moving (ghc-init) under haskell/init-ghc
or some similar place.
Any problems come up with the intero backend as a result of [0] need to be fixed as well.
If I understand the code correctly however, the haskell completion backend will no longer be settable via local variables. I'm not sure if it was ever set correctly this way though anyhow.
Still experiencing this on the dev branch, but only when using (haskell :variables haskell-completion-backend 'ghc-mod)
. With intero
as the completion backend, it's fine.
same here, on develop branch, almost 2 years after. It's too bad haskell does not have a smooth, self contained, out of the box experience with emacs.
Hi @nrolland,
What completion backend did you try?
I'll take a look on this issue very soon.
P. S. Ok, it didn't happen. 😿
At long last, I've merged that PR into develop
. Would be nice to have feedback.
Relevant commit is 152d41e.
Thanks, I'll have a look when I do some haskell. given the multiple configurations available for haskell, wouldn't that make sense to have some specialized layers, like haskell-intero, haskell-dante, etc..
It would be great to have a dead simple way to reuse custom layers between GitHub users, so that we rely on the official spacemacs only as a (hopefully good) default.
@d12frosted I'm on fba9447cfef900e4d955f45a424e0df27c40b2f7 in develop
right now and noticed a newly-started Haskell project not having completion (with neither ghci
nor dante
as completion backends).
Upon stumbling over this issue, I checked the enabled modes and company
wasn't there. I then tried adding another .hs
file, which immediately made company
appear and work. (In other languages/layers I use there doesn't seem to be any problem)
So I guess it's not really fixed yet, though with the easy workaround of opening a second Haskell source file once (or reopening the first one).
Can confirm that the bug still persists.
closing. If this is still a problem, please open a new issue with details. Alternatively, use haskell language server.
Description :octocat:
Company backends are not loaded in haskell layer.
For the reproduction steps, I used the
ghci
backend since its got less pre-reqs,But I actually use the
ghc-mod
backend (i.e i actually have(haskell :variables haskell-completion-backend 'ghc-mod)
)And I can see that this function is being run because the major mode key bindings are added to the
SPC
menu.I don't know to reproduce it, but i have noticed under some rare conditions, the additional backends (
company-{ghc|ghci|yasnippet}
) do become active, But they never seem to be active on startup, if they ever do get triggered, its always sometime in the middle of a sessionReproduction guide :beetle:
haskell
layer in.spacemacs
with line(haskell :variables haskell-completion-backend 'ghci)
M-x company-diag
company-ghci
norcompany-yasnippet
are in the list.company-ghci
andcompany-yasnippet
now appear in the backends listObserved behaviour: :eyes: :broken_heart:
Neither
company-ghci
norcompany-yasnippet
appear in the list of backends activeExpected behaviour: :heart: :smile:
Expect to see
company-ghci
andcompany-yasnippet
in the list of backends active/queried.System Info :computer:
Backtrace :paw_prints: