-
-
Notifications
You must be signed in to change notification settings - Fork 389
Show function argument documentation in hovers #2348
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
Comments
I think this is a HLS issue. What you see there is the hover documentation for an element, this is just markup, and so it's entirely up to the server what it puts in there. I don't know how HLS gets the information that goes in there. |
Hey, great! Thanks for the direction & transfer. & Thanks for showing the place to look at in the spec. |
Actually I happen to touch-related code yesterday. I already have some minor changes in the local branch. |
Probably GHC stores annotation info in https://hackage.haskell.org/package/ghc-9.2.1/docs/src/GHC.Iface.Ext.Types.html#NodeInfo & |
Seems like I almost pieced everything together. Only searching where the signature comments are hidden. Since https://hackage.haskell.org/package/ghc-9.2.1/docs/src/GHC.Iface.Ext.Types.html does not have anything on But at least something currently: I wonder, does GHC exposes signature comments or not, we well could lived on Haddock parsing signature comments all this time. Maybe I just need to look into |
I think GHC may not store those, we may need Haddock here. In fact, I'm not sure why we aren't getting this information from Haddock in the first place? |
HLS gets docs from interface files. Docs on arguments are also available, just hoogle |
In fact HLS already does the work to retrieve argument docs in
|
Thank you - it was twice removed for where I managed to search in, I never arrived into https://hackage.haskell.org/package/ghc-9.2.1/docs/GHC.html#v:mi_arg_docs.
GHC implementation should be both more elegant, everything is/can be retrieved from one place, in the same format & should be in the same scope, it would not need syncing of positions & their types conversions & regarding format - there is already internal conversion of Haddock syntax to markdown happening inside HLS that seems to be used widely. I wonder - would I need to do GHC API version support: https://github.com/haskell/haskell-language-server/pull/2338/files (I wish to do minimal MVP first). |
GHC has upstream progress on this subsystem in the pipeline: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6224 |
I don't think that GHC support is required here, see my earlier comment: |
I was distracted for some time, because, when working on the arg doc code, noticed Just collecting related arg doc pipeline info here, since that massive PR on arg docs in GHC is nearing merge - I need to know about it. & also to establish communication/collaboration between GHC process & HLS process in the theme, which already produced useful feedback: #2371 (comment) |
I'd loved to see those function "signature comments" displayed. HLS already helps to write them. I found them often being a true way of documenting what function does, as people often in function docs just white what functions accepts & does with args - people write that style way quite intuitively & that fits greatly to be a signature comments. To see those sometimes would be an immense simplification to read code.
Several years ago - I remember the dialog that Haddock-like signature comments were not yet in the LSP protocol specification.
What is the current status there (and here 8) )?
As I arrived though reading
lsp-haskell
->lsp-ui
->lsp-mode
-> searching thoughHLS
& looking atMicrosoft LSP specs
and seeing there as good as 🦇 🕶️ 😎 🌃 〰️ 🌙 〰️ & in that way I arrived here. & decided you should know something about what are the current affairs there 8)The text was updated successfully, but these errors were encountered: