Skip to content
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

[FUSE] Add some missing runtime source mappings #9883

Merged
merged 4 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public override void WriteCSharpExpression(CodeRenderingContext context, CSharpE
{
if (node.Children[i] is IntermediateToken token && token.IsCSharp)
{
context.AddSourceMappingFor(token);
context.CodeWriter.Write(token.Content);
}
else
Expand Down Expand Up @@ -116,6 +117,7 @@ public override void WriteCSharpCode(CodeRenderingContext context, CSharpCodeInt
{
if (node.Children[i] is IntermediateToken token && token.IsCSharp)
{
context.AddSourceMappingFor(token);
context.CodeWriter.Write(token.Content);
}
else
Expand Down Expand Up @@ -232,6 +234,7 @@ public override void WriteCSharpExpressionAttributeValue(CodeRenderingContext co
{
if (node.Children[i] is IntermediateToken token && token.IsCSharp)
{
context.AddSourceMappingFor(token);
context.CodeWriter.Write(token.Content);
}
else
Expand Down Expand Up @@ -295,6 +298,7 @@ public override void WriteCSharpCodeAttributeValue(CodeRenderingContext context,
continue;
}

context.AddSourceMappingFor(token);
context.CodeWriter.Write(token.Content);

if (linePragmaScope != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public override void WriteCSharpExpression(CodeRenderingContext context, CSharpE
{
if (node.Children[i] is IntermediateToken token && token.IsCSharp)
{
context.AddSourceMappingFor(token);
WriteCSharpToken(context, token, includeLinePragma: false);
}
else
Expand Down Expand Up @@ -1215,6 +1216,8 @@ private static void WriteCSharpToken(CodeRenderingContext context, IntermediateT
using (context.CodeWriter.BuildLinePragma(token.Source, context))
{
context.CodeWriter.WritePadding(0, token.Source.Value, context);

context.AddSourceMappingFor(token);
context.CodeWriter.Write(token.Content);
}
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ internal void RenderTagHelperAttributeInline(
}
else if (node is IntermediateToken token)
{
if (context.Options.DesignTime && node.Source != null)
if (node.Source != null)
{
context.AddSourceMappingFor(node);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Source Location: (60:2,7 [42] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|c|
Generated Location: (767:18,26 [1] )
|c|

Source Location: (44:0,44 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|c|
Generated Location: (953:26,44 [1] )
|c|

Source Location: (60:2,7 [42] x:\dir\subdir\Test\TestComponent.cshtml)
|
private MyClass<string> c = new();
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
Source Location: (161:6,7 [42] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (55:1,19 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|true|
Generated Location: (760:18,19 [4] )
|true|

Source Location: (112:3,23 [9] x:\dir\subdir\Test\TestComponent.cshtml)
|() => { }|
Generated Location: (938:26,23 [9] )
|() => { }|

Source Location: (145:4,21 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|c|
Generated Location: (1109:34,21 [1] )
|c|

Source Location: (32:0,32 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|c|
Generated Location: (1283:42,32 [1] )
|c|

Source Location: (161:6,7 [42] x:\dir\subdir\Test\TestComponent.cshtml)
|
private MyClass<string> c = new();
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (42:2,7 [34] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|c|
Generated Location: (791:19,26 [1] )
|c|

Source Location: (42:2,7 [34] x:\dir\subdir\Test\TestComponent.cshtml)
|
private MyClass c = new();
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (48:2,7 [68] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|c1 = c2|
Generated Location: (791:19,26 [7] )
|c1 = c2|

Source Location: (48:2,7 [68] x:\dir\subdir\Test\TestComponent.cshtml)
|
private MyClass c1 = new();
private MyClass c2 = new();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
Source Location: (180:7,7 [42] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|c|
Generated Location: (767:18,26 [1] )
|c|

Source Location: (43:1,13 [9] x:\dir\subdir\Test\TestComponent.cshtml)
|() => { }|
Generated Location: (997:26,13 [9] )
|() => { }|

Source Location: (74:2,19 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|true|
Generated Location: (1167:34,19 [4] )
|true|

Source Location: (131:4,23 [9] x:\dir\subdir\Test\TestComponent.cshtml)
|() => { }|
Generated Location: (1345:42,23 [9] )
|() => { }|

Source Location: (164:5,21 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|c|
Generated Location: (1516:50,21 [1] )
|c|

Source Location: (180:7,7 [42] x:\dir\subdir\Test\TestComponent.cshtml)
|
private MyClass<string> c = new();
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
Source Location: (155:6,7 [51] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|c|
Generated Location: (767:18,26 [1] )
|c|

Source Location: (49:1,19 [4] x:\dir\subdir\Test\TestComponent.cshtml)
|true|
Generated Location: (928:26,19 [4] )
|true|

Source Location: (106:3,23 [9] x:\dir\subdir\Test\TestComponent.cshtml)
|() => { }|
Generated Location: (1106:34,23 [9] )
|() => { }|

Source Location: (139:4,21 [1] x:\dir\subdir\Test\TestComponent.cshtml)
|c|
Generated Location: (1277:42,21 [1] )
|c|

Source Location: (155:6,7 [51] x:\dir\subdir\Test\TestComponent.cshtml)
|
private readonly MyClass<string> c = new();
|
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Source Location: (94:2,19 [33] x:\dir\subdir\Test\TestComponent.cshtml)
|async (e) => await Task.Delay(10)|
Generated Location: (1165:32,19 [33] )
|async (e) => await Task.Delay(10)|

Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (112:3,7 [88] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (92:2,17 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|OnClick|
Generated Location: (1163:32,17 [7] )
|OnClick|

Source Location: (112:3,7 [88] x:\dir\subdir\Test\TestComponent.cshtml)
|
Task OnClick(MouseEventArgs e)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Source Location: (94:2,19 [32] x:\dir\subdir\Test\TestComponent.cshtml)
|async () => await Task.Delay(10)|
Generated Location: (1165:32,19 [32] )
|async () => await Task.Delay(10)|

Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (112:3,7 [72] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (92:2,17 [7] x:\dir\subdir\Test\TestComponent.cshtml)
|OnClick|
Generated Location: (1163:32,17 [7] )
|OnClick|

Source Location: (112:3,7 [72] x:\dir\subdir\Test\TestComponent.cshtml)
|
Task OnClick()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (895:19,26 [11] )
|ParentValue|

Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (54:1,7 [65] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (771:18,30 [11] )
|ParentValue|

Source Location: (54:1,7 [65] x:\dir\subdir\Test\TestComponent.cshtml)
|
public DateTime ParentValue { get; set; } = DateTime.Now;
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (54:1,7 [89] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (771:18,30 [11] )
|ParentValue|

Source Location: (54:1,7 [89] x:\dir\subdir\Test\TestComponent.cshtml)
|
public IEnumerable<DateTime> ParentValue { get; set; } = new [] { DateTime.Now };
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (895:19,26 [11] )
|ParentValue|

Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (50:1,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (895:19,26 [11] )
|ParentValue|

Source Location: (50:1,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
public string ParentValue { get; set; } = "42";
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (80:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (895:19,26 [11] )
|ParentValue|

Source Location: (80:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (80:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (791:19,26 [11] )
|ParentValue|

Source Location: (80:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (895:19,26 [11] )
|ParentValue|

Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (54:1,7 [65] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (771:18,30 [11] )
|ParentValue|

Source Location: (54:1,7 [65] x:\dir\subdir\Test\TestComponent.cshtml)
|
public DateTime ParentValue { get; set; } = DateTime.Now;
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (895:19,26 [11] )
|ParentValue|

Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (791:19,26 [11] )
|ParentValue|

Source Location: (50:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
Source Location: (50:1,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (26:0,26 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (895:19,26 [11] )
|ParentValue|

Source Location: (50:1,7 [55] x:\dir\subdir\Test\TestComponent.cshtml)
|
public string ParentValue { get; set; } = "42";
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Source Location: (81:1,7 [82] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (899:19,30 [11] )
|ParentValue|

Source Location: (62:0,62 [6] x:\dir\subdir\Test\TestComponent.cshtml)
|Update|
Generated Location: (1349:28,62 [6] )
|Update|

Source Location: (81:1,7 [82] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Source Location: (84:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (899:19,30 [11] )
|ParentValue|

Source Location: (62:0,62 [9] x:\dir\subdir\Test\TestComponent.cshtml)
|() => { }|
Generated Location: (1349:28,62 [9] )
|() => { }|

Source Location: (84:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
Source Location: (135:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
Source Location: (30:0,30 [11] x:\dir\subdir\Test\TestComponent.cshtml)
|ParentValue|
Generated Location: (899:19,30 [11] )
|ParentValue|

Source Location: (60:0,60 [62] x:\dir\subdir\Test\TestComponent.cshtml)
|(value => { ParentValue = value; return Task.CompletedTask; })|
Generated Location: (1212:28,60 [62] )
|(value => { ParentValue = value; return Task.CompletedTask; })|

Source Location: (135:1,7 [50] x:\dir\subdir\Test\TestComponent.cshtml)
|
public int ParentValue { get; set; } = 42;
|
Expand Down
Loading