Closed michaelpj closed 10 months ago
A further tidbit: it is essential that g
has Haddock, otherwise I also get no hovers appearing. It does not matter if f
has Haddock.
I cannot repro with ghcide, but I'm not sure I fully understand the description. A video would help...
A further note. Currently HLS and ghcide handle spans in a completely different way. The HLS way is based in HIE files and it is the future, but it's not yet merged in ghcide, so this issue was moved here prematurely. CC @wz1000
Does the file actually compile, or are there some other errors? I can't reproduce, suspect this might be due to position mapping, when we try to reuse stale information.
https://asciinema.org/a/CB0w07aTgsRcgeJAYCY8YLbuP
Action starts at 1.10, you can see a variety of weird hovers on comments, with a type corresponding to the binding above. They disappear when I delete the haddock for the binding below.
The file compiles fine. I would say it's something stale, but this persists on a clean start, and it consistently re-appears after I change things!
I assume there is no CPP in your file?
Nope!
The project in question is open-source, so you can try and repro here if you like: https://github.com/input-output-hk/plutus/blob/master/plutus-core/plutus-ir/Language/PlutusIR/Transform/Inline.hs
There's a hie-cabal.yaml
in the root which I'm using.
I can't reproduce this with the same pattern in other files unless I paste a whole prefix of Inline.hs
into them, at which point it starts happening. I haven't pinned down what feature of the file it is that triggers this...
Maybe this is fixed by now?
The initial example could be used as a regression test which would be nice to add (if it does not exist)
The reason I got stuck on this was that I couldn't reproduce it without a quite chunky example, which was a bit disappointing. I'll try and reproduce with more recent versions.
Haven't noticed this recently
If I hover over a Haddock comment for a function or any comment preceding such a comment, I get a type hover for the previously declared function without the name.
e.g.
Hovering over either
comment1
orcomment2
I see_ :: a -> b
. If there is no preceding function I don't get a hover.I think this is maybe something wrong with the spans in the HIE files or something? If they were incorrectly being set to "start of function definition -- start of next function definition" then the span for f could cover those comments.
Your environment
hls
version 0.3.0.0 (I can try again with a newer version)Steps to reproduce
I think the example I gave should reproduce, but I extracted it from the middle of my project, so it might not.
Expected behaviour
Probably no hover on comments!