haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Hover on inner signature gives confusing information

Open jacg opened this issue 6 years ago • 5 comments

Hovering on the signature of inner in the following sample, gives the signature of outer. Hovering on the definition of inner gives the correct signature of inner.

outer :: Bool
outer = undefined where

  inner :: Char
  inner = undefined

Tests in haskell/ghcide#311.

jacg avatar Jan 07 '20 11:01 jacg

As discussed in the PR with the tests (#311), hovering on top-level signatures currently does nothing, so for the sake of consistency we should do one of:

  • make hovering on inner signatures also do nothing at all
  • fix the inner signature behaviour to refer to the inner function, but in that case we should make the behaviour on top-level signatures work analogously.

jacg avatar Jan 07 '20 12:01 jacg

In summary, the conclusion we reached in haskell/ghcide#311 is: hover and gotoDef on both inner and top-level signatures should point to the first clasue of their corresponding definitions. The tests merged in haskell/ghcide#311 reflect this decision.

jacg avatar Jan 09 '20 07:01 jacg

Tests were moved to hls and there are here:

https://github.com/haskell/haskell-language-server/blob/2e59c60d9f0b2ecaf87fb4551ec6e478e0219330/ghcide/test/exe/Main.hs#L4011-L4012

With hls-1.5.2 i got

outer :: Bool
Defined at D:\ws\haskell\issues\empty\Main.hs:6:1
inner
Defined at D:\ws\haskell\issues\empty\Main.hs:9:3

So it seems to me that outer is right and no broken, as stated by the test

jneira avatar Dec 03 '21 08:12 jneira

Checking both tests in #2435, i would expect the outer one should be ok and the inner fail

jneira avatar Dec 03 '21 08:12 jneira

I get no signature: Screenshot_2022-07-13_18-52-53

hasufell avatar Jul 13 '22 16:07 hasufell