-
Notifications
You must be signed in to change notification settings - Fork 156
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
Rework documentation parser #446
Rework documentation parser #446
Conversation
cc @Krzysztof-Cieslak @baronfel Hello, I need your help to interpret the list tag documentation. How should we represent the Do you have any example usage of the |
I found a more detailed example from an old blog post (not microsoft-affilated). After reading the docs you linked and this post, I've come to the following sort of data-model for the list structures available to Xml Documentation: type Term = string
type Definition = string
type ListStyle = Bulleted | Numbered
type ItemList =
/// a list where the items are just single-strings (ie a markdown list item that looks like: * Some text here)
| Simple of elements: string list * style : ListStyle
/// a list where the items are a term followed by a definition (ie in markdown: * <TERM> - <DEFINITION>)
| Definitions of elements: (Term * Definition) list * style: ListStyle
type ColumnHeader = string
// the length of the rows is equal the the length of the headers list
type ItemTable = Table of headers: ColumnHeader list * rows: (Term list) list
/// the overall xmldoc structure can be parsed into this
type XmlListStructure =
| List of ItemList
| Table of ItemTable That is, there are two kinds of 'list item' (single terms and full-definitions), two kinds of list (bulleted and numbered) and then a way to represent tables. I think all of these could be translated into markdown equivalents fairly mechanically:
This is all assuming we get full-markdown in the tooltips/info panel. |
@baronfel Thank you for your analysis. I will try to implement the list parser now that I have examples and better comprehension of the block :) |
301e5d2
to
548d488
Compare
Next step is to update the regex to support void & closing version of a tag
548d488
to
7e4570a
Compare
Hello @Krzysztof-Cieslak @baronfel @7sharp9 I now have all the syntax covered by the new parser. And would like to tick the todo:
Should we put everything in the tooltip or only the |
I think just type info and summary, the other stuff should go in the doc viewer. |
To get the new parser out, I am postponing the commands generation. So now, we only need to decide what to include in the tooltip. Adding commands for all the tags like |
Maybe have single option? Something like full vs minimal? With Full we'd show everything, with minimal only summary? |
I am not sure to understand, do you want to add a setting so the user can configure it from his editor? |
I think there should be setting |
I'd agree with @Krzysztof-Cieslak. Defaulting to more info is how ionide works, and if a user prefers less information they can set one flag in their user profile settings to get that behavior across all Ionide instances. |
Biggest issue is not ionide but the tiny tot tooltip window in vscode.
It's already too tiny for the simple info without hacking it larger.
…On Thu, 5 Dec 2019 16:54 Chet Husk, ***@***.***> wrote:
I'd agree with @Krzysztof-Cieslak <https://github.com/Krzysztof-Cieslak>.
Defaulting to more info is how ionide works, and if a user prefers less
information they can set one flag in their user profile settings to get
that behavior across all Ionide instances.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#446>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEPXSRO6F772MI7U2FKPHLQXEW4JANCNFSM4IHNJXFA>
.
|
Hello guys, sorry for the long silence, I was taking a lot of vacations. Thank you for the input I will update the PR to include the settings. |
This finally is ready for review !!! 🎉 🎉 You should use Ionide from this PR ionide/ionide-vscode-fsharp#1259 in order to test it. |
Well, let's do this. Awesome work Maxime, thanks a lot! |
This PR is related to ionide/ionide-vscode-fsharp#1012
Its goal is to rework the documentation parser.
Today, we have more or less 3 parsers:
I proposed to @Krzysztof-Cieslak the possibility to only have one implementation and he was ok with that.
ionide/ionide-vscode-fsharp#1012 (comment)
Demo of the current state
One parser to rule them all
So I am removing the parsers 1 and 2 and keeps parser 3.
Mutualize as much code as possible
All the following elements use the same abstraction:
This abstraction support both "void and non-void" version of the elements and use the same regex to detect them.
Example:
<paramref name="c">c</paramref>
<paramref name="c" />
Implementation
We can them in the
Formatter
function, we decide how to retrieve the data depending on the version of the element.Non standard features
Support
lang
inside<code>
ℹ️ I am "the creator" of this feature
You can add a
lang
attributes on a<code>
block. This will alows us to provide coloration in the tooltip.Support for
-or-
blocks.ℹ️ Microsoft is using theses blocks
If the
-or-
block is on a single line Microsoft doesn't reformat it making it hard to read the different cases.My implementation will always try to optimise the display if possible (for example, inside a table cell it will leave it as it is).
or
generates the same output:
Preview
Table support
ℹ️ Microsoft is using theses blocks
This is already supported in current version of FSAC.
xref
block supportsℹ️ Microsoft is using theses blocks instead of
paramref
ortypeparamref
Fix invalid URLs
ℹ️ Microsoft is using theses blocks
Replace
~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md
byhttps://docs.microsoft.com/en-gb/dotnet/standard/cross-platform/cross-platform-development-with-the-portable-class-library
This is needed because of some links used inside of
netstandard.xml
Questions
On twitter some people complained that the tooltip could be too verbose, so my question should we make the tooltip less verbose?
If yes, what info should we remove?
Here are the info we can choose from:
TODO
When used to generates info panel, add bullet type support (this is not possible to do it in raw markdown so we need html to do it)Add configuration support to the parser in order to produce different outputsWhen used to generates info panel, add command supports