Skip to content

Commit 4f409a1

Browse files
committed
Use in razor span mapping service
1 parent b4d8345 commit 4f409a1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/RazorSpanMappingService.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,18 @@ internal static bool TryGetMappedSpans(TextSpan span, SourceText source, RazorCS
9595
}
9696
}
9797

98+
foreach (var mapping in output.ComponentMappings)
99+
{
100+
var generated = mapping.AsTextSpan();
101+
102+
if (generated.Contains(span))
103+
{
104+
mappedSpan = new TextSpan(0, 0);
105+
linePositionSpan = new LinePositionSpan(new LinePosition(0, 0), new LinePosition(0, 0));
106+
return true;
107+
}
108+
}
109+
98110
mappedSpan = default;
99111
linePositionSpan = default;
100112
return false;

0 commit comments

Comments
 (0)