Skip to content

HLS reports non-existent errors when using Calamity and Polysemy with Polysemy.Plugin (polysemy-plugin) #2989

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

Closed
subterfugue opened this issue Jun 26, 2022 · 10 comments
Labels
GHC issues with particular GHC versions type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@subterfugue
Copy link

haskell-language-server-wrapper --probe-tools:

haskell-language-server version: 1.7.0.0 (GHC: 9.2.2) (PATH: /home/mon/.local/share/ghcup/hls/1.7.0.0/lib/haskell-language-server-1.7.0.0/bin/haskell-language-server-wrapper)
Tool versions found on the $PATH
cabal:          3.6.2.0
stack:          Not found
ghc:            9.2.2

(I launched HLS in the terminal with haskell-language-server-wrapper to provide the errors it reports in the paste below)
HLS reports errors that seem to not exist, because building & running the project works, and testing the program results in correct behaviour. I have this paste: https://bpa.st/J32A which has the Main.hs and the errors that HLS thinks exist. The git repository is provided later on in this issue.

Your environment

Which OS do you use:
Arch Linux (Artix variant)
Which LSP client (editor/plugin) do you use:
doom emacs+lsp-mode
Describe your project (alternative: link to the project): https://git.sr.ht/~monaaraj/bot

Steps to reproduce

I just run doom emacs and open up my project. This issue happens only with this calamity and polysemy (with polysemy-plugin) project, HLS acts well in every other project I have.

Expected behaviour

The program should be deemed without error, if GHC builds and runs the program, with the program successfully running without issue.

Actual behaviour

HLS reports very very weird errors regarding Internal.Typeable things, P.Member instance overlaps, ambiguous use of type variables... the specific errors have been provided in the bpaste link above.

Include debug information

The HLS log seems to be too long to be pasted to any paste service, so I have provided it as an attachment file:
hls.log

@subterfugue subterfugue added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Jun 26, 2022
@MorrowM
Copy link
Contributor

MorrowM commented Jun 26, 2022

It's worth pointing out that these are the exact error messages you get from polysemy-plugin not being enabled.

@MorrowM
Copy link
Contributor

MorrowM commented Jun 26, 2022

It appears this is 9.2 specific. On 8.10.7 and 9.0.2 HLS does not raise any of the errors.

@drsooch drsooch added Medium Priority GHC issues with particular GHC versions and removed status: needs triage labels Jun 26, 2022
@oberblastmeister
Copy link

This also happens with effectful-plugin

@michaelpj
Copy link
Collaborator

I think @pepeiborra did the 9.2 compatibility work? Did something change wrt plugins?

@sonowz
Copy link

sonowz commented Oct 24, 2022

I'm having same issue with polysemy-plugin, and I strongly suggest that HLS does not handle GHC option -fplugin=Polysemy.Plugin correctly. GHC shows the same error as HLS if -fplugin=Polysemy.Plugin option is not given.

Can anyone confirm this behavior?

@tek
Copy link
Contributor

tek commented Oct 24, 2022

@sonowz that is correct. interestingly, I've been observing this kind of misbehaviour ever since, but only very infrequently. With GHC 9.2, it is now permanent.

@PPKFS
Copy link

PPKFS commented Oct 31, 2022

Completely forgot about this, but I had this issue with Cleff.Plugin some months back. 9.0.x was fine, but any 9.2.x build it would throw up HLS errors.

Ran into it again today when using Effectful.Plugin on 9.2. Again, vanishes if I swap to 9.0. It seems hls on 9.2 simply does not read plugins somehow.

@sonowz
Copy link

sonowz commented Jan 5, 2023

In my case upgrading to HLS 1.9.0.0 fixed this issue, thanks to #3309.
For GHC 9.2.4 Polysemy.Plugin is successfully loaded with HLS 1.9.0.0.

@tek
Copy link
Contributor

tek commented Jan 5, 2023

same, everything's working now

@michaelpj
Copy link
Collaborator

Yep, this should have been fixed in 1.9.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GHC issues with particular GHC versions type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants