ionide-vscode-fsharp
ionide-vscode-fsharp copied to clipboard
Use `cref` etc. information from XML documentation to generate links in tooltips and Info Panel
Describe the bug**
If something is documented with XML docs and they reference a generic type, the info tooltip displays these generic types incorrectly. It also breaks text following them.
It seems the backtick character `
is interpreted as markdown.
/// <summary>
/// Testing <see cref="T:Async`1" /> and some more text before <see cref="T:Async`1" />.
/// </summary>
let x = 1
Screenshots
There is sort of a workaround for the display issue that is compatible with FSharp.Formatting (haven't tested in VS/Rider).
/// <summary>
/// Testing ``<see cref="T:Async`1" />`` and some more text before ``<see cref="T:Async`1" />``.
/// </summary>
let x = 1
However, after doing this to a few XML docs, VSCode starts to heavily lag and eventually completely hangs. I've even seen VSCode bomb after doing this to one XML doc.
Hey @seanamos :wave:,
Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our OpenCollective and consider backing us.
https://opencollective.com/ionide
PS.: We offer
backer
support for all backers. Don't forget to addbacker
label when you start backing us :smile:
Hello, the problem you are encountering with the workaround is related to https://github.com/ionide/ionide-vscode-fsharp/issues/1073
There is probably something in FSAC that's causing this problem but we aren't able to find the reason...
About the problem of display it is coming from
https://github.com/fsharp/FsAutoComplete/blob/1e1f5e5338ecc69fb8103238d8fb44901d608dad/src/FsAutoComplete.Core/TipFormatter.fs#L81-L88
because we are just surrouding the extracted with `
so the code generates this markdown like that `Async`1`
.
@baronfel @Krzysztof-Cieslak What should we display in case like these?
Should we display the non generic version Async
or the generic version Async<_>
?
Commenting here just to know what will happen.
We should have proper process of 'see' links to resolve them to their known members: in this case whatever generic parameter name Async is defined with is what we should render in the tooltip, ideally with a hyperlink to either go to that type or open the info panel on that type
Generating an hyperlink should be doable now that https://github.com/microsoft/vscode-languageserver-node/issues/503 has been fixed.
The things, I don't know how to do is how to get the type information from the tips. Is their an example somewhere?
We don't currently have a nice way to resolve a type from the name...it's kinda an open question in tooling I think. At least as of now we are properly escaping the XMLdocs for See xmldoc:
Very happy with that in the interim, big improvement over the previous formatting!
I've renamed the issue to refocus it on including links - the issue with formatting was fixed a while ago.
I tried several time to look into this issue but I just don't know how to do it.
In order to generate a showDocumentation
command we need the assembly name. But how can we find the assembly name from just a type name?
Any ideas?