Skip to content

Commit 79f2331

Browse files
committed
Fixup more usages
1 parent 84a83b7 commit 79f2331

File tree

7 files changed

+7
-2
lines changed

7 files changed

+7
-2
lines changed

src/Compiler/Microsoft.AspNetCore.Razor.Language/src/CodeGeneration/CodeWriterExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ public static CSharpCodeWritingScope BuildClassDeclaration(
422422
}
423423

424424
writer.Write("class ");
425-
context.AddGeneratedOnlyMapping(name.Length);
425+
context?.AddGeneratedOnlyMapping(name.Length);
426426
writer.Write(name);
427427

428428
if (typeParameters != null && typeParameters.Count > 0)

src/Razor/benchmarks/Microsoft.AspNetCore.Razor.Microbenchmarks/LanguageServer/RazorDiagnosticsBenchmark.cs

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public void Setup()
6161
RazorCodeGenerationOptions.CreateDesignTimeDefault(),
6262
Array.Empty<RazorDiagnostic>(),
6363
SourceMappings,
64+
ImmutableArray<SourceSpan>.Empty,
6465
new List<LinePragma>()
6566
);
6667

src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Diagnostics/RazorTranslateDiagnosticsEndpointTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,7 @@ private static RazorCodeDocument CreateCodeDocumentWithCSharpProjection(
12161216
RazorCodeGenerationOptions.CreateDefault(),
12171217
Enumerable.Empty<RazorDiagnostic>(),
12181218
sourceMappings.ToImmutableArray(),
1219+
ImmutableArray<SourceSpan>.Empty,
12191220
Enumerable.Empty<LinePragma>());
12201221
codeDocument.SetCSharpDocument(csharpDocument);
12211222
return codeDocument;

src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Formatting/FormattingLanguageServerTestBase.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ internal static RazorCodeDocument CreateCodeDocument(string content, IReadOnlyLi
3232
var codeDocument = RazorCodeDocument.Create(sourceDocument);
3333
var syntaxTree = RazorSyntaxTree.Parse(sourceDocument, RazorParserOptions.CreateDefault());
3434
var razorCSharpDocument = RazorCSharpDocument.Create(
35-
codeDocument, content, RazorCodeGenerationOptions.CreateDefault(), Array.Empty<RazorDiagnostic>(), sourceMappings.ToImmutableArray(), Array.Empty<LinePragma>());
35+
codeDocument, content, RazorCodeGenerationOptions.CreateDefault(), Array.Empty<RazorDiagnostic>(), sourceMappings.ToImmutableArray(), ImmutableArray<SourceSpan>.Empty, Array.Empty<LinePragma>());
3636
codeDocument.SetSyntaxTree(syntaxTree);
3737
codeDocument.SetCSharpDocument(razorCSharpDocument);
3838

src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorLanguageQueryEndpointTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ private static RazorCodeDocument CreateCodeDocumentWithCSharpProjection(string r
150150
RazorCodeGenerationOptions.CreateDefault(),
151151
Enumerable.Empty<RazorDiagnostic>(),
152152
sourceMappings.ToImmutableArray(),
153+
ImmutableArray<SourceSpan>.Empty,
153154
Enumerable.Empty<LinePragma>());
154155
codeDocument.SetCSharpDocument(csharpDocument);
155156
return codeDocument;

src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/Mapping/RazorMapToDocumentRangesEndpointTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ private static RazorCodeDocument CreateCodeDocumentWithCSharpProjection(string r
260260
RazorCodeGenerationOptions.CreateDefault(),
261261
Enumerable.Empty<RazorDiagnostic>(),
262262
sourceMappings.ToImmutableArray(),
263+
ImmutableArray<SourceSpan>.Empty,
263264
Enumerable.Empty<LinePragma>());
264265
codeDocument.SetCSharpDocument(csharpDocument);
265266
return codeDocument;

src/Razor/test/Microsoft.AspNetCore.Razor.LanguageServer.Test/RazorDocumentMappingServiceTest.cs

+1
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ private static RazorCodeDocument CreateCodeDocumentWithCSharpProjection(string r
10831083
RazorCodeGenerationOptions.CreateDefault(),
10841084
Enumerable.Empty<RazorDiagnostic>(),
10851085
sourceMappings.ToImmutableArray(),
1086+
ImmutableArray<SourceSpan>.Empty,
10861087
Enumerable.Empty<LinePragma>());
10871088
codeDocument.SetCSharpDocument(csharpDocument);
10881089
return codeDocument;

0 commit comments

Comments
 (0)