-
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
Extract TipFormatters
into its own package
#1316
Comments
I think this is a good idea. Some other questions/thoughts.
|
I would prefer it to be a separate repository because it is easier to maintain (at least for me). I already have all the infrastructure needed to handle automatic release based on Git history etc. I only want to expose from This way it is the job of FSAC and F# Formatting to resolve the XMLDoc location based on the project cracker / FCS API. So I don't believe this library will be impacted by FCS release. It will just need Regex and XML API, so I don't think it will have anything dependencies beside NetStandard.
Only a portion of TipFormatter will be extracted and it should be backwards compatible. The main compatibility stuff to keep are the different styles of ToolTips we want to supports: [<RequireQualifiedAccess>]
type FormatCommentStyle =
| Legacy // Full text version of the tooltip
| FullEnhanced // This is the default used by FSAC at the moment (markdown output with stripped exemples)
| SummaryOnly // Markdown with summary content only
| Documentation // Used by InfoPanel and probably F# Formatting (markdown with full content) We could debate if Legacy is still needed, but every time I asked to remove it I was asked to not too 😅.
This library will not need to know/allow for other formatting outputs. It will just need for FSAC/F# Formatting to tell which version of the Tooltip they want (see above). Currently the tooltip is composed of:
The portion I want to extract is This is part of FSAC LSPServer: FsAutoComplete/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs Lines 966 to 987 in fc79e99
|
I'm generally in favor of this - my main comments are aligned with Jimmy. We need to keep an ability to define custom renderings for e.g. VSCode-specific clients vs NeoVim clients, for example. |
Details
Hello,
I am working on improving F# formatting API documentation and one of the main element is to improve the Tooltip formatting.
This leads to having to duplicate
TipFormatter
code between FSAC and F# Formatting. Would you be ok if we make it a standalone package?The portion of the
TipFormatter
that I would like to export is only the portion responsible for converting aXMLDoc
into a formatted text.It should correspond more or less to this portion of the file:
FsAutoComplete/src/FsAutoComplete.Core/TipFormatter.fs
Lines 17 to 858 in fc79e99
Having a separate library means:
Both project can benefit from improvements made to the XMLDoc formatter
Add tests to capture future regressions.
I think there are currently no tests regarding XMLDoc formatting in FSAC (at least I never wrote ones when I worked a lot with that portion of the code)
Extracting that portion of the code should not be too much of big deal because it doesn't depends on FSC or things complex like that. It just want an XMLElement and return a string / class instance.
It could be named something like
Ionide.XMLDocFormatter
? I worked on that code several times and volunteer to scaffold that project.Checklist
The text was updated successfully, but these errors were encountered: