Skip to content

Commit 27a7d29

Browse files
committed
Update LocationConverter.cs
1 parent 6d92dd9 commit 27a7d29

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/Verify.SourceGenerators/Converters/LocationConverter.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
class LocationConverter :
22
WriteOnlyJsonConverter<Location>
33
{
4-
const int contextLines = 1;
5-
64
public override void Write(VerifyJsonWriter writer, Location value)
75
{
86
var lineSpan = value.GetMappedLineSpan();
@@ -23,8 +21,8 @@ static void WriteSourceTree(VerifyJsonWriter writer, Location value, FileLinePos
2321
var comment = new StringBuilder();
2422
comment.AppendLine();
2523
var lines = source.GetText().Lines;
26-
var startLine = Math.Max(lineSpan.StartLinePosition.Line - contextLines, 0);
27-
var endLine = Math.Min(lineSpan.EndLinePosition.Line + contextLines, lines.Count - 1);
24+
var startLine = Math.Max(lineSpan.StartLinePosition.Line - 1, 0);
25+
var endLine = Math.Min(lineSpan.EndLinePosition.Line + 1, lines.Count - 1);
2826
for (var index = startLine; index <= endLine; index++)
2927
{
3028
var line = lines[index];

0 commit comments

Comments
 (0)