haskelly-dev / Haskelly

Haskelly is a VS Code extension that provides complete support for casual and expert Haskell development.
https://marketplace.visualstudio.com/items?itemName=UCL.haskelly
GNU General Public License v3.0
152 stars 17 forks source link

Wish: Type hover shows doc comment #70

Open Rhywun opened 6 years ago

Rhywun commented 6 years ago

Is it possible to display the source code's documentation comment (in addition to the type) within the popup that appears when I hover over an item in the editor? I am pretty new to Haskell so I'm not sure if this is even possible. Thank you

martrik commented 6 years ago

Hello @Rhywun. You mean the actual Hoogle description of library functions?

Rhywun commented 6 years ago

I was thinking of the comments that begin with -- | in source code, e.g. from module GHC.Num:

-- | Unary negation.
negate              :: a -> a

But I don't see any command to show a doc comment in GHC similar to :t which shows the type, so I suspect it isn't possible.

martrik commented 6 years ago

I see what you mean. Yes I think the comments should be fetched from the Hoogle online documentation and parsed to then be displayed. We are not actively adding features to Haskelly but we do accept MRs. So if you feel like giving it a go feel free to contribute to the project!