razor
razor copied to clipboard
Formatting does a 5k across the screen for some more complex fields
A user submitted another issue on GitHub and I found that after formatting their document that things got a bit wonky. C#:
namespace RazorClassLibrary2.Models
{
public class Gopt<T>
{
public string Name { get; set; }
}
public static class GoptExtensions
{
public static Gopt<T> Editor<T>(this Gopt<T> gopt, Func<T, RenderFragment> renderFunc)
{
return gopt;
}
}
}
Razor:
@page "/"
@using RazorClassLibrary2.Models
@code{
private DateTime? date1;
Gopt<int> gopt = new Gopt<int>()
{
Name = "hi"
}
.Editor(m =>
{
return
@<text>hi</text>
; }
);
}
Format the document:

Confirmed its the render fragment being a problem here, doesn't repro with a "normal" object initializer. Probably lowers the priority a bit.
Those damned lambdas.
Revisit once the tooling and compilers repos merge.