You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes it is useful to have type-parameters in quotes, allowing them to contain characters such as '<' and '>'. After formatting, this quotation is lost, leading to non-compiling code.
Extra information
The formatted result breaks my code.
The formatted result gives compiler warnings.
I or my company would be willing to help fix this.
Options
Fantomas main branch at 2023-05-05T09:52:15Z - 4093fa5
Default Fantomas configuration
Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?
The text was updated successfully, but these errors were encountered:
| TyparStaticReq.HeadType -> stn $"^{ident.idText}" range
Some check along these lines could do the trick:
letmkSynTypar(SynTypar(ident,req,_))=letrange=
mkRange
ident.idRange.FileName
(Position.mkPos ident.idRange.StartLine (ident.idRange.StartColumn -1))
ident.idRange.End
letidentText=letwidth= ident.idRange.EndColumn - ident.idRange.StartColumn
// 5 because of ^ or ' and `` on each sideif ident.idText.Length +5= width then
$"``{ident.idText}``"else
ident.idText
match req with| TyparStaticReq.None -> stn $"'{identText}" range
| TyparStaticReq.HeadType -> stn $"^{identText}" range
Issue created from fantomas-online
Code
Result
Problem description
Sometimes it is useful to have type-parameters in quotes, allowing them to contain characters such as '<' and '>'. After formatting, this quotation is lost, leading to non-compiling code.
Extra information
Options
Fantomas main branch at 2023-05-05T09:52:15Z - 4093fa5
Default Fantomas configuration
Did you know that you can ignore files when formatting from fantomas-tool or the FAKE targets by using a .fantomasignore file?
The text was updated successfully, but these errors were encountered: