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

Hoogle it for unknown symbol

Open July541 opened this issue 3 years ago • 9 comments

As the image shows, I hope we can add a code action to hoogle it for unknown symbols

image

July541 avatar Sep 17 '22 14:09 July541

Very useful, but will it get chaotic sometimes and may feel spammy to the user?

sloorush avatar Sep 17 '22 15:09 sloorush

Very useful, but will it get chaotic sometimes and may feel spammy to the user?

People can disable it anytime, and I think there won't be so many unknown symbols at once.

July541 avatar Sep 17 '22 16:09 July541

Very useful, but will it get chaotic sometimes and may feel spammy to the user?

People can disable it anytime, and I think there won't be so many unknown symbols at once.

Yep! Then this will be pretty useful and fast for the users who want it.

sloorush avatar Sep 17 '22 17:09 sloorush

Why only unknown symbols? I might want to ~Google~ Hoogle any identifier that doesn't have documentation or a link to Hackage. Which brings me to the second point, I suspect a hover is a better fit than a code action for this.

pepeiborra avatar Sep 18 '22 05:09 pepeiborra

@jneira told me we have some attempts for hoogle integration, it's fine to have a hover. But for unknown symbols, I just want to redirect users to the hoogle web page because of worrying about the size of hoogle.

https://twitter.com/jneira/status/1571232027583602690

July541 avatar Sep 18 '22 05:09 July541

@jneira told me we have some attempts for hoogle integration, it's fine to have a hover. But for unknown symbols, I just want to redirect users to the hoogle web page because of worrying about the size of hoogle.

https://twitter.com/jneira/status/1571232027583602690

I don't think adding a Hoogle code action that will pop up for every single squiggly is going to be well received by users. On the other hand, a hover that presents a Hoogle link for identifiers that lack documentation might be useful

pepeiborra avatar Sep 18 '22 07:09 pepeiborra

On the other hand, a hover that presents a Hoogle link for identifiers that lack documentation might be useful.

Strongly agree with this.

I don't think adding a Hoogle code action that will pop up for every single squiggly is going to be well received by users.

Following your thought, what should be displayed while hovering on unknown symbols like getFist in the image?

July541 avatar Sep 18 '22 07:09 July541

Following your thought, what should be displayed while hovering on unknown symbols like getFist in the image?

Same as for known symbols without docs, hover should show a link to Hoogle it.

I should also point out that the screenshot that you shared in the issue description is very different from what I see in my HLS installation. Do you not have the ghcide plugins enabled? Maybe you are on 9.4?

image

pepeiborra avatar Sep 18 '22 08:09 pepeiborra

Yes, I'm on 9.4.

Emm, sounds great! So you are thinking to add a link like https://hoogle.haskell.org/?hoogle=getFirst for any symbols without docs(including unknown symbols)?

July541 avatar Sep 18 '22 08:09 July541